diff options
author | Jan H. Schönherr <jschoenh@amazon.de> | 2017-10-25 17:43:27 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-11-02 20:28:13 +0300 |
commit | 4191db26b714e077e6faddd82d575ae4a8ae7d63 (patch) | |
tree | 1c52d376e8fa871dd37d24a4264c9e68ae382c44 /arch/x86/kvm/lapic.c | |
parent | a4888486c5d755118a3c8a30416d7e0febdfb298 (diff) | |
download | linux-4191db26b714e077e6faddd82d575ae4a8ae7d63.tar.xz |
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>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r-- | arch/x86/kvm/lapic.c | 5 |
1 files changed, 5 insertions, 0 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) vcpu->arch.apic_base | MSR_IA32_APICBASE_BSP); vcpu->arch.pv_eoi.msr_val = 0; apic_update_ppr(apic); + if (vcpu->arch.apicv_active) { + kvm_x86_ops->apicv_post_state_restore(vcpu); + kvm_x86_ops->hwapic_irr_update(vcpu, -1); + kvm_x86_ops->hwapic_isr_update(vcpu, -1); + } vcpu->arch.apic_arb_prio = 0; vcpu->arch.apic_attention = 0; |