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

[Xen-devel] [PATCH v2 1/3] x86/nmi: Cleanup usage of nmi_watchdog



Use NMI_NONE when testing whether NMI watchdog is off.

Remove unused NMI_INVALID macro.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
 xen/arch/x86/nmi.c         | 4 ++--
 xen/arch/x86/traps.c       | 3 ++-
 xen/include/asm-x86/apic.h | 1 -
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 98c1e15..2ab97a0 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -148,7 +148,7 @@ int __init check_nmi_watchdog (void)
     int cpu;
     bool_t ok = 1;
 
-    if ( !nmi_watchdog )
+    if ( nmi_watchdog == NMI_NONE )
         return 0;
 
     printk("Testing NMI watchdog on all CPUs:");
@@ -361,7 +361,7 @@ static int __pminit setup_p4_watchdog(void)
 
 void __pminit setup_apic_nmi_watchdog(void)
 {
-    if (!nmi_watchdog)
+    if ( nmi_watchdog == NMI_NONE )
         return;
 
     switch (boot_cpu_data.x86_vendor) {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index ec324b0..f5516dc 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3385,7 +3385,8 @@ void do_nmi(const struct cpu_user_regs *regs)
     if ( nmi_callback(regs, cpu) )
         return;
 
-    if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) )
+    if ( (nmi_watchdog == NMI_NONE) ||
+         (!nmi_watchdog_tick(regs) && watchdog_force) )
         handle_unknown = 1;
 
     /* Only the BSP gets external NMIs from the system. */
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 6697245..be9a535 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -221,7 +221,6 @@ extern unsigned int nmi_watchdog;
 #define NMI_NONE       0
 #define NMI_IO_APIC    1
 #define NMI_LOCAL_APIC 2
-#define NMI_INVALID    3
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline int lapic_suspend(void) {return 0;}
-- 
1.8.1.4


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


 


Rackspace

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