Message ID | 20180717002428.39055-1-pshier@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
2018-07-16 17:24-0700, Peter Shier: > From: Andrew Honig <ahonig@google.com> > > Prior to this change if userspace set the local apic state while there > was a posted interrupt waiting, then the posted interrupt would not be > cleared. > > To fix this issue we clear all the not-yet-delivered posted interrupts > and put them in the apic, so that when userspace overwrites the apic, > registers, it also clears any posted interrupts. > > Signed-off-by: Andrew Honig <ahonig@google.com> > Signed-off-by: Peter Shier <pshier@google.com> > --- Isn't this already covered by 967235d32032 ("KVM: vmx: clear pending interrupts on KVM_SET_LAPIC")? Thanks.
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0046aa70205aa..cbb097946d32f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3163,6 +3163,9 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu, { int r; + if (vcpu->arch.apicv_active) + kvm_x86_ops->sync_pir_to_irr(vcpu); + r = kvm_apic_set_state(vcpu, s); if (r) return r;