KVM: SVM: Process ICR on AVIC IPI delivery failure due to invalid target
authorSean Christopherson <seanjc@google.com>
Fri, 6 Jan 2023 01:12:37 +0000 (01:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:48:49 +0000 (08:48 +0100)
commitc5a23d43c23ac2f896603b9929e148eec07b6d15
treebac858a2e2df96698fd5e842d3285e101899fc6c
parenta78a355052abcfeb0cdaea9ef3f0a21aad7a5c32
KVM: SVM: Process ICR on AVIC IPI delivery failure due to invalid target

[ Upstream commit 5aede752a839904059c2b5d68be0dc4501c6c15f ]

Emulate ICR writes on AVIC IPI failures due to invalid targets using the
same logic as failures due to invalid types.  AVIC acceleration fails if
_any_ of the targets are invalid, and crucially VM-Exits before sending
IPIs to targets that _are_ valid.  In logical mode, the destination is a
bitmap, i.e. a single IPI can target multiple logical IDs.  Doing nothing
causes KVM to drop IPIs if at least one target is valid and at least one
target is invalid.

Fixes: 18f40c53e10f ("svm: Add VMEXIT handlers for AVIC")
Cc: stable@vger.kernel.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230106011306.85230-5-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/svm/avic.c