[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] VMX: issue an NMI rather than just calling the NMI handler



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1250243912 -3600
# Node ID 76a65bf2aa4d0b27fb55e85cc2d9ce8b9ff1bbf3
# Parent  c8beb04afbf0a7a3a4290df212d1b7fe7d288dca
VMX: issue an NMI rather than just calling the NMI handler
when the VMEXIT code indicates that an NMI has been raised.
Otherwise we might hit a real NMI while in the handler.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |    4 +---
 xen/arch/x86/nmi.c         |   11 +++++++----
 xen/include/asm-x86/apic.h |    1 +
 3 files changed, 9 insertions(+), 7 deletions(-)

diff -r c8beb04afbf0 -r 76a65bf2aa4d xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Fri Aug 14 10:57:24 2009 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Aug 14 10:58:32 2009 +0100
@@ -945,8 +945,6 @@ static void vmx_enable_rdtsc_exiting(str
     vmx_vmcs_exit(v);
  }
 
-void do_nmi(struct cpu_user_regs *);
-
 static void vmx_init_hypercall_page(struct domain *d, void *hypercall_page)
 {
     char *p;
@@ -2470,7 +2468,7 @@ asmlinkage void vmx_vmexit_handler(struc
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            do_nmi(regs); /* Real NMI, vector 2: normal processing. */
+            self_nmi(); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);
diff -r c8beb04afbf0 -r 76a65bf2aa4d xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c        Fri Aug 14 10:57:24 2009 +0100
+++ b/xen/arch/x86/nmi.c        Fri Aug 14 10:58:32 2009 +0100
@@ -441,16 +441,19 @@ void nmi_watchdog_tick(struct cpu_user_r
  * 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
  * our own APIC ID explicitly which is valid.
  */
-static void do_nmi_trigger(unsigned char key)
+void self_nmi(void) 
 {
     u32 id = get_apic_id();
-
-    printk("Triggering NMI on APIC ID %x\n", id);
-
     local_irq_disable();
     apic_wait_icr_idle();
     apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
     local_irq_enable();
+}
+
+static void do_nmi_trigger(unsigned char key)
+{
+    printk("Triggering NMI on APIC ID %x\n", get_apic_id());
+    self_nmi();
 }
 
 static struct keyhandler nmi_trigger_keyhandler = {
diff -r c8beb04afbf0 -r 76a65bf2aa4d xen/include/asm-x86/apic.h
--- a/xen/include/asm-x86/apic.h        Fri Aug 14 10:57:24 2009 +0100
+++ b/xen/include/asm-x86/apic.h        Fri Aug 14 10:58:32 2009 +0100
@@ -196,6 +196,7 @@ extern void setup_apic_nmi_watchdog (voi
 extern void setup_apic_nmi_watchdog (void);
 extern int reserve_lapic_nmi(void);
 extern void release_lapic_nmi(void);
+extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
 extern void nmi_watchdog_tick (struct cpu_user_regs *regs);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.