iommu/amd: Don't register interrupt remapping irqdomain when IR is disabled
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 11 Nov 2020 14:43:20 +0000 (14:43 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 11 Nov 2020 22:01:58 +0000 (23:01 +0100)
Registering the remapping irq domain unconditionally is potentially
allowing I/O-APIC and MSI interrupts to be parented in the IOMMU IR domain
even when IR is disabled. Don't do that.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201111144322.1659970-1-dwmw2@infradead.org
drivers/iommu/amd/init.c

index c2769f2..a94b96f 100644 (file)
@@ -1601,9 +1601,11 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
        if (ret)
                return ret;
 
-       ret = amd_iommu_create_irq_domain(iommu);
-       if (ret)
-               return ret;
+       if (amd_iommu_irq_remap) {
+               ret = amd_iommu_create_irq_domain(iommu);
+               if (ret)
+                       return ret;
+       }
 
        /*
         * Make sure IOMMU is not considered to translate itself. The IVRS