public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP
@ 2005-10-26 14:44 Jan Beulich
  2005-10-26 15:01 ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2005-10-26 14:44 UTC (permalink / raw)
  To: Andreas Kleen, linux-kernel; +Cc: discuss

What is the reason for notify_die(DIE_GPF, ...) to be run late in the GP
fault handler (on both i386 and x86-64), while for other exceptions it
gets run first thing (as I would have expected for all exceptions)?

Thanks, Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP
  2005-10-26 14:44 DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP Jan Beulich
@ 2005-10-26 15:01 ` Andi Kleen
  2005-10-26 15:21   ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-10-26 15:01 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel, discuss

On Wednesday 26 October 2005 16:44, Jan Beulich wrote:
> What is the reason for notify_die(DIE_GPF, ...) to be run late in the GP
> fault handler (on both i386 and x86-64), while for other exceptions it
> gets run first thing (as I would have expected for all exceptions)?

"die"s as the name says are normally only supposed to run when the
error is determined to be an illegal kernel fault.  Page fault
got an exception to that to make kprobes work. For the others
it is mostly only because there is no good way to check
for illegal kernel faults first.

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP
  2005-10-26 15:01 ` Andi Kleen
@ 2005-10-26 15:21   ` Jan Beulich
  2005-10-26 15:50     ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2005-10-26 15:21 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, discuss

>>> Andi Kleen <ak@suse.de> 26.10.05 17:01:52 >>>
>On Wednesday 26 October 2005 16:44, Jan Beulich wrote:
>> What is the reason for notify_die(DIE_GPF, ...) to be run late in
the GP
>> fault handler (on both i386 and x86-64), while for other exceptions
it
>> gets run first thing (as I would have expected for all exceptions)?
>
>"die"s as the name says are normally only supposed to run when the
>error is determined to be an illegal kernel fault.  Page fault
>got an exception to that to make kprobes work. For the others
>it is mostly only because there is no good way to check
>for illegal kernel faults first.

Hmm, then this isn't really useful for a debugger. There ought to be a
chance to filter exceptions early (i.e. debugger accesses to non-mapped
memory or non-existing MSRs) and a chance to detect bad faults (note
that the kernel normal exception recovery mechanism may not be usable
here because for example page faults first try to service the fault
before scanning the fixup tables, but a debugger will normally not want
a page-in to happen behind its back). I thought the latter was what gets
reported as DIE_OOPS, while the former would be the filtering occasions
(and I actually took the "grossly misnamed" comment in asm/kdebug.h as
additional indication for that).

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP
  2005-10-26 15:21   ` Jan Beulich
@ 2005-10-26 15:50     ` Andi Kleen
  2005-10-26 16:00       ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-10-26 15:50 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel, discuss

On Wednesday 26 October 2005 17:21, Jan Beulich wrote:
 
> Hmm, then this isn't really useful for a debugger. There ought to be a
> chance to filter exceptions early (i.e. debugger accesses to non-mapped
> memory or non-existing MSRs) and a chance to detect bad faults (note
> that the kernel normal exception recovery mechanism may not be usable
> here because for example page faults first try to service the fault
> before scanning the fixup tables, but a debugger will normally not want
> a page-in to happen behind its back). I thought the latter was what gets
> reported as DIE_OOPS, while the former would be the filtering occasions
> (and I actually took the "grossly misnamed" comment in asm/kdebug.h as
> additional indication for that).

All you want is a hook early in GPF, right? I guess that should be ok.
I can see that it's useful on x86-64 due to the non canonical address 
fault resulting in GPFs mess. 

Just send a patch.

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP
  2005-10-26 15:50     ` Andi Kleen
@ 2005-10-26 16:00       ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2005-10-26 16:00 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, discuss

>>> Andi Kleen <ak@suse.de> 26.10.05 17:50:44 >>>
>On Wednesday 26 October 2005 17:21, Jan Beulich wrote:
> 
>> Hmm, then this isn't really useful for a debugger. There ought to be
a
>> chance to filter exceptions early (i.e. debugger accesses to
non-mapped
>> memory or non-existing MSRs) and a chance to detect bad faults
(note
>> that the kernel normal exception recovery mechanism may not be
usable
>> here because for example page faults first try to service the fault
>> before scanning the fixup tables, but a debugger will normally not
want
>> a page-in to happen behind its back). I thought the latter was what
gets
>> reported as DIE_OOPS, while the former would be the filtering
occasions
>> (and I actually took the "grossly misnamed" comment in asm/kdebug.h
as
>> additional indication for that).
>
>All you want is a hook early in GPF, right? I guess that should be
ok.
>I can see that it's useful on x86-64 due to the non canonical address

>fault resulting in GPFs mess. 

Yes. Now, would you see this to replace the current one, or in addition
to it?

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-26 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26 14:44 DIE_GPF vs. DIE_PAGE_FAULT/DIE_TRAP Jan Beulich
2005-10-26 15:01 ` Andi Kleen
2005-10-26 15:21   ` Jan Beulich
2005-10-26 15:50     ` Andi Kleen
2005-10-26 16:00       ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox