KVM: VMX: Stop the preemption timer during vCPU reset
authorWanpeng Li <wanpengli@tencent.com>
Thu, 5 Sep 2019 06:26:28 +0000 (14:26 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Sep 2019 16:05:53 +0000 (18:05 +0200)
The hrtimer which is used to emulate lapic timer is stopped during
vcpu reset, preemption timer should do the same.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c

index d95c2f3..99f52f8 100644 (file)
@@ -4162,6 +4162,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
 
        vcpu->arch.microcode_version = 0x100000000ULL;
        vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
+       vmx->hv_deadline_tsc = -1;
        kvm_set_cr8(vcpu, 0);
 
        if (!init_event) {