iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping
authorLogan Gunthorpe <logang@deltatee.com>
Tue, 22 Oct 2019 22:01:21 +0000 (16:01 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Feb 2020 09:34:48 +0000 (09:34 +0000)
commitb02b0a6bcc81c76d243eddcfed7271c8e54fde40
tree5ec2e1f58946a78531d8c643992d1443813fa27a
parent1f03a258f20f1699ede29bb40804074db9398a0d
iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping

[ Upstream commit 3c124435e8dd516df4b2fc983f4415386fd6edae ]

Non-Transparent Bridge (NTB) devices (among others) may have many DMA
aliases seeing the hardware will send requests with different device ids
depending on their origin across the bridged hardware.

See commit ad281ecf1c7d ("PCI: Add DMA alias quirk for Microsemi Switchtec
NTB") for more information on this.

The AMD IOMMU IRQ remapping functionality ignores all PCI aliases for
IRQs so if devices send an interrupt from one of their aliases they
will be blocked on AMD hardware with the IOMMU enabled.

To fix this, ensure IRQ remapping is enabled for all aliases with
MSI interrupts.

This is analogous to the functionality added to the Intel IRQ remapping
code in commit 3f0c625c6ae7 ("iommu/vt-d: Allow interrupts from the entire
bus for aliased devices")

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd_iommu.c