KVM: SVM: Don't check vCPU's blocking status when toggling AVIC on/off
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:46:01 +0000 (15:46 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:50 +0000 (09:50 -0700)
commit6eab2340f339cabb63079c94e5dbaea4d90007df
treef9932102d0745cec9db37ab7883337c6a2d96653
parentf2bc961d383bbc26c72f77e3f452da2f9f44dc0d
KVM: SVM: Don't check vCPU's blocking status when toggling AVIC on/off

Don't query a vCPU's blocking status when toggling AVIC on/off; barring
KVM bugs, the vCPU can't be blocking when refreshing AVIC controls.  And
if there are KVM bugs, ensuring the vCPU and its associated IRTEs are in
the correct state is desirable, i.e. well worth any overhead in a buggy
scenario.

Isolating the "real" load/put flows will allow moving the IOMMU IRTE
(de)activation logic from avic_refresh_apicv_exec_ctrl() to
avic_update_iommu_vcpu_affinity(), i.e. will allow updating the vCPU's
physical ID entry and its IRTEs in a common path, under a single critical
section of ir_list_lock.

Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-60-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c