diff options
| author | Sean Christopherson <seanjc@google.com> | 2025-06-11 15:45:55 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2025-06-23 09:50:46 -0700 |
| commit | 99836eb9c5dcae1f0e64da2cb6f7e0bb9151f95d (patch) | |
| tree | c60664e996ce09ba2b6af0c0c99387d391f99520 /arch/x86/kvm/svm/svm.c | |
| parent | KVM: x86: WARN if IRQ bypass routing is updated without in-kernel local APIC (diff) | |
| download | linux-99836eb9c5dcae1f0e64da2cb6f7e0bb9151f95d.tar.gz linux-99836eb9c5dcae1f0e64da2cb6f7e0bb9151f95d.zip | |
KVM: SVM: WARN if ir_list is non-empty at vCPU free
Now that AVIC IRTE tracking is in a mostly sane state, WARN if a vCPU is
freed with ir_list entries, i.e. if KVM leaves a dangling IRTE.
Initialize the per-vCPU interrupt remapping list and its lock even if AVIC
is disabled so that the WARN doesn't hit false positives (and so that KVM
doesn't need to call into AVIC code for a simple sanity check).
Link: https://lore.kernel.org/r/20250611224604.313496-54-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
| -rw-r--r-- | arch/x86/kvm/svm/svm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 68b6a1922078..7f0df9dbc232 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1491,6 +1491,8 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); + WARN_ON_ONCE(!list_empty(&svm->ir_list)); + svm_leave_nested(vcpu); svm_free_nested(svm); |
