]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Don't do full kick when triggering posted interrupt "fails"
authorSean Christopherson <seanjc@google.com>
Wed, 8 Dec 2021 01:52:26 +0000 (01:52 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Jan 2022 17:14:45 +0000 (12:14 -0500)
commit3ce7bf58e125bc83ebac91f849adb04460f3e9fa
treeff3b05ff49c38cbb4b12fe43f01abb0f21b46f62
parent48ec363fbb4d655ef761346d7fd79b968b03e9b2
KVM: VMX: Don't do full kick when triggering posted interrupt "fails"

Replace the full "kick" with just the "wake" in the fallback path when
triggering a virtual interrupt via a posted interrupt fails because the
guest is not IN_GUEST_MODE.  If the guest transitions into guest mode
between the check and the kick, then it's guaranteed to see the pending
interrupt as KVM syncs the PIR to IRR (and onto GUEST_RVI) after setting
IN_GUEST_MODE.  Kicking the guest in this case is nothing more than an
unnecessary VM-Exit (and host IRQ).

Opportunistically update comments to explain the various ordering rules
and barriers at play.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211208015236.1616697-17-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c