Skip to content

Commit

Permalink
KVM: Fix reboot on Intel hosts
Browse files Browse the repository at this point in the history
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.

KVM-Stable-Tag.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
avikivity authored and matosatti committed Sep 23, 2010
1 parent 6bbfb26 commit ca242ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virt/kvm/kvm_main.c
Expand Up @@ -1970,10 +1970,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();
}
Expand Down

0 comments on commit ca242ac

Please sign in to comment.