linux/drivers/iommu/amd
David Woodhouse b34f10c2dc iommu/amd: Stop irq_remapping_select() matching when remapping is disabled
The AMD IOMMU initialisation registers the IRQ remapping domain for
each IOMMU before doing the final sanity check that every I/OAPIC is
covered.

This means that the AMD irq_remapping_select() function gets invoked
even when IRQ remapping has been disabled, eventually leading to a NULL
pointer dereference in alloc_irq_table().

Unfortunately, the IVRS isn't fully parsed early enough that the sanity
check can be done in time to registering the IRQ domain altogether.
Doing that would be nice, but is a larger and more error-prone task. The
simple fix is just for irq_remapping_select() to refuse to report a
match when IRQ remapping has disabled.

Link: https://lore.kernel.org/lkml/ed4be9b4-24ac-7128-c522-7ef359e8185d@gmx.at
Fixes: a1a785b572 ("iommu/amd: Implement select() method on remapping irqdomain")
Reported-by: Johnathan Smithinovic <johnathan.smithinovic@gmx.at>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/04bbe8bca87f81a3cfa93ec4299e53f47e00e5b3.camel@infradead.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-01-05 19:24:12 +00:00
..
Kconfig iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE 2020-09-04 11:53:18 +02:00
Makefile iommu/amd: Move Kconfig and Makefile bits down into amd directory 2020-07-29 14:15:36 +02:00
amd_iommu.h IOMMU Updates for Linux v5.10 2020-10-14 12:08:34 -07:00
amd_iommu_types.h IOMMU updates for 5.11 2020-12-16 13:58:47 -08:00
debugfs.c
init.c iommu/amd: Set iommu->int_enabled consistently when interrupts are set up 2021-01-05 19:20:21 +00:00
iommu.c iommu/amd: Stop irq_remapping_select() matching when remapping is disabled 2021-01-05 19:24:12 +00:00
iommu_v2.c drm, iommu: Change type of pasid to u32 2020-09-17 19:21:16 +02:00
quirks.c