kdb
[Top] [All Lists]

Re: [kdb] [PATCH, RFC] merge i386 and x86_64 kdb arch code

To: Keith Owens <kaos@xxxxxxxxxx>
Subject: Re: [kdb] [PATCH, RFC] merge i386 and x86_64 kdb arch code
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 5 Jan 2009 17:54:16 -0500
Cc: Martin Hicks <mort@xxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, kdb@xxxxxxxxxxx
In-reply-to: <11221.1231195475@ocs14w>
References: <20090105212413.GK178422@xxxxxxxxxxxxxxxxxxxxxxxxx> <11221.1231195475@ocs14w>
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Jan 06, 2009 at 09:44:35AM +1100, Keith Owens wrote:
> AFAICR when Andi Kleen was adding AMD64 support to Linux, he defined
> some die notifiers for AMD64.  At the time those die notifiers were not
> in i386.  I took advantage of the notifier to simplify kdb for AMD64.
> 
> There is no reason not to use the i386 die notifiers now, as long as
> the semantics are the same.  At one stage i386 and x86_64 used the same
> notifier names but with slightly different meanings.

The die notifier implementation now lives in kernel/notifier.c and
is shared by all platforms.  The actual notifier values used by kdb
are:

 - DIE_NMI_IPI: implemented by x86
 - DIE_OOPS: implemented by most (all?) architectures
 - DIE_CALL: not implemented by any architecture, define by a few
 - DIE_DEBUG: implemented by x86
 - DIE_NMIWATCHDOG: implemented by x86, defined but not implemented by
   s390
 - DIE_INT3: implemented by x86 only if CONFIG_KPROBES is set

all the x86 implementations are in code shared by 32bit and 64bit mode.

Note that some code is rather weird now, e.g. the x86 do_debug directly
calling into kdb and in the next line calling into it through DIE_DEBUG
with both of them happening for 32 and 64 bits.

<Prev in Thread] Current Thread [Next in Thread>