aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-09-10 15:40:55 -0400
committerAvi Kivity <avi@qumranet.com>2008-10-15 04:15:26 -0400
commit9c3e4aab5ae27bf8589d61c7874e213832b4b7d2 (patch)
tree38e3fcc1cbf7c2fdecfc5e95cd63f6c3b6b14702 /arch/x86
parentd19292e457a7c1b7f6c12bccbfdfd53630de1cee (diff)
KVM: x86: unhalt vcpu0 on reset
Since "KVM: x86: do not execute halted vcpus", HLT by vcpu0 before system reset by the IO thread will hang the guest. Mark vcpu as runnable in such case. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bf98d40b21ec..2134f3e0a516 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3959,6 +3959,12 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
3959 kvm_set_segment(vcpu, &sregs->tr, VCPU_SREG_TR); 3959 kvm_set_segment(vcpu, &sregs->tr, VCPU_SREG_TR);
3960 kvm_set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); 3960 kvm_set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR);
3961 3961
3962 /* Older userspace won't unhalt the vcpu on reset. */
3963 if (vcpu->vcpu_id == 0 && kvm_rip_read(vcpu) == 0xfff0 &&
3964 sregs->cs.selector == 0xf000 && sregs->cs.base == 0xffff0000 &&
3965 !(vcpu->arch.cr0 & X86_CR0_PE))
3966 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
3967
3962 vcpu_put(vcpu); 3968 vcpu_put(vcpu);
3963 3969
3964 return 0; 3970 return 0;