diff options
author | Corey Minyard <minyard@acm.org> | 2006-05-08 09:17:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-08 12:34:56 -0400 |
commit | 8b1ffe9550e71224c43d8c754245bd76f4ea9bb8 (patch) | |
tree | f569da4b1dabc94867ff2a7a0d383bef0d4f49bf | |
parent | cdc60a4c8e71c4bcf67e83fac6c0cabd0ff19bfe (diff) |
[PATCH] x86_64: add nmi_exit to die_nmi
Playing with NMI watchdog on x86_64, I discovered that it didn't
do what I expected. It always panic-ed, even when it didn't
happen from interrupt context. This patch solves that
problem for me. Also, in this case, do_exit() will be called
with interrupts disabled, I believe. Would it be wise to also
call local_irq_enable() after nmi_exit()?
[Yes I added it -AK]
Currently, on x86_64, any NMI watchdog timeout will cause a panic
because the irq count will always be set to be in an interrupt
when do_exit() is called from die_nmi(). If we add nmi_exit() to
the die_nmi() call (since the nmi will never exit "normally")
it seems to solve this problem. The following small program
can be used to trigger the NMI watchdog to reproduce this:
main ()
{
iopl(3);
for (;;) asm("cli");
}
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/kernel/traps.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 0ebb281aa178..6b87268c5c2e 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -472,6 +472,8 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs) | |||
472 | panic("nmi watchdog"); | 472 | panic("nmi watchdog"); |
473 | printk("console shuts up ...\n"); | 473 | printk("console shuts up ...\n"); |
474 | oops_end(flags); | 474 | oops_end(flags); |
475 | nmi_exit(); | ||
476 | local_irq_enable(); | ||
475 | do_exit(SIGSEGV); | 477 | do_exit(SIGSEGV); |
476 | } | 478 | } |
477 | 479 | ||