KVM: SVM: Don't rewrite guest ICR on AVIC IPI virtualization failure
authorSean Christopherson <seanjc@google.com>
Fri, 4 Feb 2022 21:41:59 +0000 (21:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:48:49 +0000 (08:48 +0100)
commita78a355052abcfeb0cdaea9ef3f0a21aad7a5c32
tree545eeb9331409b15cf6dd21fb7e8a5bd950218d7
parent45bcf4a4f2b1e9cf73fb05e0383f2492c5cd53ba
KVM: SVM: Don't rewrite guest ICR on AVIC IPI virtualization failure

[ Upstream commit b51818afdc1d3c7cc269e295953685558d3af71c ]

Don't bother rewriting the ICR value into the vAPIC page on an AVIC IPI
virtualization failure, the access is a trap, i.e. the value has already
been written to the vAPIC page.  The one caveat is if hardware left the
BUSY flag set (which appears to happen somewhat arbitrarily), in which
case go through the "nodecode" APIC-write path in order to clear the BUSY
flag.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220204214205.3306634-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: 5aede752a839 ("KVM: SVM: Process ICR on AVIC IPI delivery failure due to invalid target")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/lapic.c
arch/x86/kvm/svm/avic.c