]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: Fix reboot on Intel hosts
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 14 Oct 2010 16:49:59 +0000 (13:49 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 29 Oct 2010 04:51:38 +0000 (21:51 -0700)
commit ca242ac9960dc61530e25a2c190e4e13fd5f1ecb upstream.

When we reboot, we disable vmx extensions or otherwise INIT gets blocked.
If a task on another cpu hits a vmx instruction, it will fault if vmx is
disabled.  We trap that to avoid a nasty oops and spin until the reboot
completes.

Problem is, we sleep with interrupts disabled.  This blocks smp_send_stop()
from running, and the reboot process halts.

Fix by enabling interrupts before spinning.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
virt/kvm/kvm_main.c

index 27745285131341f2374301a099e542b320db472e..dd85e29981962192a32745456e78ff4450fd5a90 100644 (file)
@@ -1942,10 +1942,12 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
 
 asmlinkage void kvm_handle_fault_on_reboot(void)
 {
-       if (kvm_rebooting)
+       if (kvm_rebooting) {
                /* spin while reset goes on */
+               local_irq_enable();
                while (true)
                        ;
+       }
        /* Fault while not rebooting.  We want the trace. */
        BUG();
 }