lkml.org 
[lkml]   [2008]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [ANNOUNCE] Merkey's Kernel Debugger
From
>> In a partitioned system [I work for SGI, so I'm talking about an Altix],
>> there is memory sharing among multiple single-system images. And if
>> one of those partitions were to panic the other partitions need to
>> be informed that they cannot address the panic'd partition's memory.
>> (Once that partition is rebooted any such access will cause an MCA
>> in the accessor.)
>
> There are already existing shutdown hooks. Aren't they good enough
> for that?
>
> I would feel uneasy about having arbitary drivers hook into panic().
> While I'm sure your code is great there is unfortunately a lot
> of crappy driver code around.
>
> -Andi
>

I hooked panic last night and inserted a notify_die hook -- there is even
a state defined for it already -- DIE_PANIC. The rest of the code should
be ok. My only question was where to harvest the regs variable since
panic is not a real exception.

Here's a first stab. You also must add #include <linux/kdebug.h> to the
top of panic as well.

diff -Naur linux-2.6.27/kernel/panic.c linux-2.6.27-mdb/kernel/panic.c
--- linux-2.6.27/kernel/panic.c 2008-08-07 15:32:29.000000000 -0600
+++ linux-2.6.27-mdb/kernel/panic.c 2008-08-07 15:29:09.000000000 -0600
@@ -82,6 +82,12 @@
printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
bust_spinlocks(0);

+ // call the notify_die handler for any resident debuggers which
+ // may be active and pass the message string. On a software
+ // fault return at least some sort of regs for a remote debugger
+ // to look at.
+ notify_die(DIE_PANIC, buf, get_irq_regs(), 0, 0, 0);
+
/*
* If we have crashed and we have a crash kernel loaded let it handle
* everything else.

Jeff




\
 
 \ /
  Last update: 2008-08-08 15:43    [W:1.152 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site