KVM: SVM: Delete IRTE link from previous vCPU irrespective of new routing
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:10 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:52:56 +0000 (13:52 -0700)
commita0ca34bb1aad0c72e3fe7b9377c7ac87fa3b7098
tree314fffd0d34aa90a01ea9fa2dcd1c9cc867e4826
parent1da19c5ce0533796179d9e1b55e64bf78478c4c1
KVM: SVM: Delete IRTE link from previous vCPU irrespective of new routing

Delete the IRTE link from the previous vCPU irrespective of the new
routing state, i.e. even if the IRTE won't be configured to post IRQs to a
vCPU.  Whether or not the new route is postable as no bearing on the *old*
route.  Failure to delete the link can result in KVM incorrectly updating
the IRTE, e.g. if the "old" vCPU is scheduled in/out.

Fixes: 411b44ba80ab ("svm: Implements update_pi_irte hook to setup posted interrupt")
Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c