diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
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; |