Fix reboot on Intel hosts
cover Fix reboot on Intel hosts
For a while (how long?) reboots with active guests are broken on Intel hosts. This patch set fixes the problem.
Avi Kivity (2):
KVM: Fix reboot on Intel hosts
KVM: cpu_relax() during spin waiting for reboot
virt/kvm/kvm_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.2.3
PATCH 1/2 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.
--- virt/kvm/kvm_main.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
virt/kvm/kvm_main.c +3 -1
@@ -2018,10 +2018,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 (); }
Signature · 1 line
1.7.2.3
PATCH 2/2 KVM: cpu_relax() during spin waiting for reboot
In reply to Avi KivityIt doesn't really matter, but if we spin, we should spin in a more relaxed manner. This way, if something goes wrong at least it won't contribute to global warming.
--- virt/kvm/kvm_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
virt/kvm/kvm_main.c +1 -1
@@ -2022,7 +2022,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void)/* spin while reset goes on */ local_irq_enable ();while (true) - ; +cpu_relax (); }/* Fault while not rebooting. We want the trace. */ BUG ();
Signature · 1 line
1.7.2.3
Marcelo Tosatti
AppliedQuoted 9 lines · Avi Kivity
For a while (how long?) reboots with active guests are broken on Intel hosts. This patch set fixes the problem.
Avi Kivity (2):
KVM: Fix reboot on Intel hosts
KVM:cpu_relax()during spin waiting for rebootvirt/kvm/kvm_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
Applied, thanks.