From: Rusty Russell "handle" NMI by ignoring it. Can't have been important, right? As the lguest64 hackers explained, handling NMI is a PITA. Now oprofile does not crash machine. Signed-off-by: Rusty Russell Cc: Andi Kleen Signed-off-by: Andrew Morton --- arch/i386/lguest/hypervisor.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN arch/i386/lguest/hypervisor.S~lguest-dont-crash-host-on-nmi arch/i386/lguest/hypervisor.S --- a/arch/i386/lguest/hypervisor.S~lguest-dont-crash-host-on-nmi +++ a/arch/i386/lguest/hypervisor.S @@ -116,6 +116,11 @@ deliver_to_host: orl %eax, %edx jmp *%edx +/* We ignore NMI and return. */ +handle_nmi: + addl $8, %esp + iret + /* Real hardware interrupts are delivered straight to the host. Others cause us to return to run_guest_once so it can decide what to do. Note that some of these are overridden by the guest to deliver directly, and @@ -148,8 +153,7 @@ irq_stubs: default_idt_entries: .text IRQ_STUBS 0 1 return_to_host /* First two traps */ -/* FIXME: NMI needs something completely different. Don't SWITCH_TO_HOST. */ - IRQ_STUB 2 deliver_to_host /* NMI */ + IRQ_STUB 2 handle_nmi /* NMI */ IRQ_STUBS 3 31 return_to_host /* Rest of traps */ IRQ_STUBS 32 127 deliver_to_host /* Real interrupts */ IRQ_STUB 128 return_to_host /* System call (overridden) */ _