From: Andi Kleen <ak@suse.de>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Jesper Juhl <juhl-lkml@dif.dk>, Andi Kleen <ak@suse.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
prasanna@in.ibm.com
Subject: Re: x86_64 GPF handler (was: [PATCH] remove errornous semicolon)
Date: Wed, 24 Nov 2004 11:43:38 +0100 [thread overview]
Message-ID: <20041124104338.GC10495@wotan.suse.de> (raw)
In-Reply-To: <200411240026_MC3-1-8F47-CE27@compuserve.com>
On Wed, Nov 24, 2004 at 12:23:23AM -0500, Chuck Ebbert wrote:
> Jesper Juhl wrote:
>
> > arch/i386/kernel/traps.c: In function `do_general_protection':
> > arch/i386/kernel/traps.c:506: warning: empty body in an if-statement
> >
> > upon inspecting the code I see what looks like a mistakenly placed ";"
> >
> > if (!fixup_exception(regs)) {
> > if (notify_die(DIE_GPF, "general protection fault", regs,
> > error_code, 13, SIGSEGV) == NOTIFY_STOP);
> > return;
> > die("general protection fault", regs, error_code);
> > }
>
>
> Ouch. No matter what the notifier chain returns it will be treated
> as if it returned NOTIFY_STOP, and no kernel-mode GPF will ever reach
> the die().
>
> This bug was introduced 31 Aug 04 by prasanna@in.ibm.com during a
> kprobes update. The comments say it was ported from x86_64, so I had
> a look:
>
> /* kernel gp */
> {
> const struct exception_table_entry *fixup;
> fixup = search_exception_tables(regs->rip);
> if (fixup) {
> regs->rip = fixup->fixup;
> return;
> }
> notify_die(DIE_GPF, "general protection fault", regs, error_code,
> 13, SIGSEGV);
> die("general protection fault", regs, error_code);
> }
>
> x86_64 never checks the result of notify_die() and unconditionally does a die().
> I don't know if this is a bug or not...
>
> Andi, if this is not a bug could you explain why not?
It depends on what the debugger (or kprobes) wants. These checks
are added based on their needs. Perhaps he didn't consider it
necessary on x86-64. But why don't you ask Prasanna directly? (cc'ed)
-Andi
next prev parent reply other threads:[~2004-11-24 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-24 5:23 x86_64 GPF handler (was: [PATCH] remove errornous semicolon) Chuck Ebbert
2004-11-24 10:43 ` Andi Kleen [this message]
2004-11-24 11:45 ` Prasanna S Panchamukhi
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=20041124104338.GC10495@wotan.suse.de \
--to=ak@suse.de \
--cc=76306.1226@compuserve.com \
--cc=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=prasanna@in.ibm.com \
/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