Skip to contentSkip to conversation

x86/xen: no need to explicitly register an NMI callback

PATCH In review David Vrabel 2 participants 2 messages Jun 16, 2014 – Jun 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/xen: no need to explicitly register an NMI callback

Remove xen_enable_nmi() to fix a 64-bit guest crash when registering the NMI callback on Xen 3.1 and earlier.

It's not needed since the NMI callback is set by a set_trap_table hypercall (in xen_load_idt() or xen_write_idt_entry()).

It's also broken since it only set the current VCPU's callback.

---
 arch/x86/xen/setup.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/x86/xen/setup.c +1 -8
index 821a11a..3f96911 100644
@@ -590,13 +590,7 @@ void xen_enable_syscall(void)
 	}
 #endif /* CONFIG_X86_64 */
 }
-void xen_enable_nmi(void)
-{
-#ifdef CONFIG_X86_64
-	if (register_callback(CALLBACKTYPE_nmi, (char *)nmi))
-		BUG();
-#endif
-}
+
 void __init xen_pvmmu_arch_setup(void)
 {
 	HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
@@ -611,7 +605,6 @@ void __init xen_pvmmu_arch_setup(void)
 
 	xen_enable_sysenter();
 	xen_enable_syscall();
-	xen_enable_nmi();
 }
 
 /* This function is not called for HVM domains */
Signature · 1 line
1.7.10.4
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · David Vrabel

Remove xen_enable_nmi() to fix a 64-bit guest crash when registering the NMI callback on Xen 3.1 and earlier.

It's not needed since the NMI callback is set by a set_trap_table hypercall (in xen_load_idt() or xen_write_idt_entry()).

It's also broken since it only set the current VCPU's callback.

Smoke tested with RHEL5 Xen and x86_64 PV guest + Xen-4.3.2 and x86_64 PV guest.

Quoted 31 lines
---
 arch/x86/xen/setup.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/x86/xen/setup.c +1 -8
index 821a11a..3f96911 100644
@@ -590,13 +590,7 @@ void xen_enable_syscall(void)
 	}
 #endif /* CONFIG_X86_64 */
 }
-void xen_enable_nmi(void)
-{
-#ifdef CONFIG_X86_64
-	if (register_callback(CALLBACKTYPE_nmi, (char *)nmi))
-		BUG();
-#endif
-}
+
 void __init xen_pvmmu_arch_setup(void)
 {
 	HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
@@ -611,7 +605,6 @@ void __init xen_pvmmu_arch_setup(void)
 
 	xen_enable_sysenter();
 	xen_enable_syscall();
-	xen_enable_nmi();
 }
 
 /* This function is not called for HVM domains */
Signature · 1 line
  Vitaly