diff options
author | Jan H. Schönherr <jschoenh@amazon.de> | 2017-10-25 17:43:26 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-11-02 20:27:11 +0300 |
commit | a4888486c5d755118a3c8a30416d7e0febdfb298 (patch) | |
tree | 5c0e2e0f193d2dadeeb6d576aad1341c36c9a065 /arch/x86/kvm | |
parent | 008755209ce1ae86c0f562a44810b57d9ea31a71 (diff) | |
download | linux-a4888486c5d755118a3c8a30416d7e0febdfb298.tar.xz |
KVM: VMX: Do not fully reset PI descriptor on vCPU reset
Parts of the posted interrupt descriptor configure host behavior,
such as the notification vector and destination. Overwriting them
with zero as done during vCPU reset breaks posted interrupts.
KVM (re-)writes these fields on certain occasions and belatedly fixes
the situation in many cases. However, if you have a guest configured
with "idle=poll", for example, the fields might stay zero forever.
Do not reset the full descriptor in vmx_vcpu_reset(). Instead,
reset only the outstanding notifications and leave everything
else untouched.
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 95a01609d7ee..e0b4b64f211a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -5619,8 +5619,10 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu); - if (kvm_vcpu_apicv_active(vcpu)) - memset(&vmx->pi_desc, 0, sizeof(struct pi_desc)); + if (kvm_vcpu_apicv_active(vcpu)) { + pi_clear_on(&vmx->pi_desc); + memset(vmx->pi_desc.pir, 0, sizeof(vmx->pi_desc.pir)); + } if (vmx->vpid != 0) vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); |