aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan H. Schönherr <jschoenh@amazon.de>2017-10-25 10:43:27 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2017-11-02 13:28:13 -0400
commit4191db26b714e077e6faddd82d575ae4a8ae7d63 (patch)
tree1c52d376e8fa871dd37d24a4264c9e68ae382c44
parenta4888486c5d755118a3c8a30416d7e0febdfb298 (diff)
KVM: x86: Update APICv on APIC reset
In kvm_apic_set_state() we update the hardware virtualized APIC after the full APIC state has been overwritten. Do the same, when the full APIC state has been reset in kvm_lapic_reset(). This updates some hardware state that was previously forgotten, as far as I can tell. Also, this allows removing some APIC-related reset code from vmx_vcpu_reset(). Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/lapic.c5
-rw-r--r--arch/x86/kvm/vmx.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 69c5612be786..36c90d631096 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1992,6 +1992,11 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)
1992 vcpu->arch.apic_base | MSR_IA32_APICBASE_BSP); 1992 vcpu->arch.apic_base | MSR_IA32_APICBASE_BSP);
1993 vcpu->arch.pv_eoi.msr_val = 0; 1993 vcpu->arch.pv_eoi.msr_val = 0;
1994 apic_update_ppr(apic); 1994 apic_update_ppr(apic);
1995 if (vcpu->arch.apicv_active) {
1996 kvm_x86_ops->apicv_post_state_restore(vcpu);
1997 kvm_x86_ops->hwapic_irr_update(vcpu, -1);
1998 kvm_x86_ops->hwapic_isr_update(vcpu, -1);
1999 }
1995 2000
1996 vcpu->arch.apic_arb_prio = 0; 2001 vcpu->arch.apic_arb_prio = 0;
1997 vcpu->arch.apic_attention = 0; 2002 vcpu->arch.apic_attention = 0;
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e0b4b64f211a..a6f4f095f8f4 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5619,11 +5619,6 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
5619 5619
5620 kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu); 5620 kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu);
5621 5621
5622 if (kvm_vcpu_apicv_active(vcpu)) {
5623 pi_clear_on(&vmx->pi_desc);
5624 memset(vmx->pi_desc.pir, 0, sizeof(vmx->pi_desc.pir));
5625 }
5626
5627 if (vmx->vpid != 0) 5622 if (vmx->vpid != 0)
5628 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); 5623 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid);
5629 5624