瀏覽代碼

KVM: Fix reboot on Intel hosts

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>
Avi Kivity 14 年之前
父節點
當前提交
ca242ac996
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      virt/kvm/kvm_main.c

+ 3 - 1
virt/kvm/kvm_main.c

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