mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH 2/3] kgdb,i386: use address that SP register points to in the exception frame
Date: Fri, 15 May 2009 08:16:26 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0905150814180.3343@localhost.localdomain> (raw)
In-Reply-To: <1242393479-19351-3-git-send-email-jason.wessel@windriver.com>



On Fri, 15 May 2009, Jason Wessel wrote:
>
> The treatment of the SP register is different on x86_64 and i386.
> This is a regression fix that lived outside the mainline kernel from
> 2.6.27 to now.  The regression was a result of the original merge
> consolidation of the i386 and x86_64 archs to x86.
> 
> The incorrectly reported SP on i386 prevented stack tracebacks from
> working correctly in gdb.

Is this only ever used for kernel register state?

Because in the _general_ case, the code should likely be something like

	if (user_mode_vm(regs)) {
		gdb_regs[GDB_SS] = regs->ss;
		gdb_regs[GDB_SP] = regs->sp;
	} else {
		gdb_regs[GDB_SS] = __KERNEL_DS;
		gdb_regs[GDB_SP] = (unsigned long)&regs->sp
	}

if the 'regs' contents can ever point to user mode state.

		Linus

  parent reply	other threads:[~2009-05-15 15:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 13:17 [git pull] kgdb 2.6.30-rc5 regression fixes Jason Wessel
2009-05-15 13:17 ` [PATCH 1/3] sysrq, intel_fb: fix sysrq g collision Jason Wessel
2009-05-15 13:17   ` [PATCH 2/3] kgdb,i386: use address that SP register points to in the exception frame Jason Wessel
2009-05-15 13:17     ` [PATCH 3/3] kgdb: gdb documentation fix Jason Wessel
2009-05-15 15:16     ` Linus Torvalds [this message]
2009-05-15 19:20       ` [PATCH 2/3] kgdb,i386: use address that SP register points to in the exception frame Jason Wessel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0905150814180.3343@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®