xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* x86/nmi: Fix deadlock in unknown_nmi_error()
@ 2012-06-08 18:56 Andrew Cooper
  0 siblings, 0 replies; only message in thread
From: Andrew Cooper @ 2012-06-08 18:56 UTC (permalink / raw)
  To: xen-devel@lists.xen.org; +Cc: Keir Fraser, Jan Beulich

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

x86/nmi: Fix deadlock in unknown_nmi_error()

Additionally, correct the text description to reflect what is being
done, and
make use of fatal_trap() in preference to kexec_crash() in case an
unknown NMI
occurs before a kdump kernel has been loaded.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


diff -r 32034d1914a6 -r 996f7fe3c3b8 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3293,7 +3293,7 @@ static void io_check_error(struct cpu_us
     outb((inb(0x61) & 0x07) | 0x00, 0x61); /* enable IOCK */
 }
 
-static void unknown_nmi_error(unsigned char reason)
+static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char
reason)
 {
     switch ( opt_nmi[0] )
     {
@@ -3302,10 +3302,10 @@ static void unknown_nmi_error(unsigned c
     case 'i': /* 'ignore' */
         break;
     default:  /* 'fatal' */
+        console_force_unlock();
         printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
-        printk("Dazed and confused, but trying to continue\n");
         printk("Do you have a strange power saving mode enabled?\n");
-        kexec_crash();
+        fatal_trap(TRAP_nmi, regs);
     }
 }
 
@@ -3338,7 +3338,7 @@ void do_nmi(struct cpu_user_regs *regs)
         else if ( reason & 0x40 )
             io_check_error(regs);
         else if ( !nmi_watchdog )
-            unknown_nmi_error((unsigned char)(reason&0xff));
+            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
     }
 }

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


[-- Attachment #2: nmi-fix-deadlock.patch --]
[-- Type: text/x-patch, Size: 1542 bytes --]

# HG changeset patch
# Parent 32034d1914a607d7b6f1f060352b4cac973600f8
x86/nmi: Fix deadlock in unknown_nmi_error()

Additionally, correct the text description to reflect what is being done, and
make use of fatal_trap() in preference to kexec_crash() in case an unknown NMI
occurs before a kdump kernel has been loaded.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 32034d1914a6 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3293,7 +3293,7 @@ static void io_check_error(struct cpu_us
     outb((inb(0x61) & 0x07) | 0x00, 0x61); /* enable IOCK */
 }
 
-static void unknown_nmi_error(unsigned char reason)
+static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
 {
     switch ( opt_nmi[0] )
     {
@@ -3302,10 +3302,10 @@ static void unknown_nmi_error(unsigned c
     case 'i': /* 'ignore' */
         break;
     default:  /* 'fatal' */
+        console_force_unlock();
         printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
-        printk("Dazed and confused, but trying to continue\n");
         printk("Do you have a strange power saving mode enabled?\n");
-        kexec_crash();
+        fatal_trap(TRAP_nmi, regs);
     }
 }
 
@@ -3338,7 +3338,7 @@ void do_nmi(struct cpu_user_regs *regs)
         else if ( reason & 0x40 )
             io_check_error(regs);
         else if ( !nmi_watchdog )
-            unknown_nmi_error((unsigned char)(reason&0xff));
+            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
     }
 }
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-08 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 18:56 x86/nmi: Fix deadlock in unknown_nmi_error() Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).