]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: SVM: Allocate IR data using atomic allocation
authorSean Christopherson <seanjc@google.com>
Fri, 4 Apr 2025 19:38:16 +0000 (12:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:31 +0000 (07:44 +0200)
commit 7537deda36521fa8fff9133b39c46e31893606f2 upstream.

Allocate SVM's interrupt remapping metadata using GFP_ATOMIC as
svm_ir_list_add() is called with IRQs are disabled and irqfs.lock held
when kvm_irq_routing_update() reacts to GSI routing changes.

Fixes: 411b44ba80ab ("svm: Implements update_pi_irte hook to setup posted interrupt")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250404193923.1413163-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/svm/avic.c

index b595a33860d703572a59d80394123b6d08c375c6..2274981487d891c1d716cdd87f7131b09c883f1a 100644 (file)
@@ -737,7 +737,7 @@ static int svm_ir_list_add(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi)
         * Allocating new amd_iommu_pi_data, which will get
         * add to the per-vcpu ir_list.
         */
-       ir = kzalloc(sizeof(struct amd_svm_iommu_ir), GFP_KERNEL_ACCOUNT);
+       ir = kzalloc(sizeof(struct amd_svm_iommu_ir), GFP_ATOMIC | __GFP_ACCOUNT);
        if (!ir) {
                ret = -ENOMEM;
                goto out;