Skip to content

Commit 885cd42

Browse files
committed
NVIDIA: SAUCE: iommu/arm-smmu-v3: Use identity domain for ASPEED BMC devices
ASPEED BMC devices behind an AST1150 PCIe-to-PCI bridge receive DMA from BMC firmware using host physical addresses that bypass the kernel's DMA API entirely. When these devices are assigned a DMA translated domain, the SMMU generates F_TRANSLATION faults because the BMC's physical addresses have no corresponding IOVA mappings in the SMMU page tables. Fix this by returning IOMMU_DOMAIN_IDENTITY for PCI devices whose parent bridge has both the PCI_BRIDGE_NO_ALIASES flag and an ASPEED vendor ID, so the SMMU passes BMC DMA transactions through untranslated. Signed-off-by: Koba Ko <kobak@nvidia.com> (backported from commit 738fff0 linux-nvidia-6.17) [koba: rename PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES -> PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIAS; Nirmoy's upstream AST1150 NO_ALIAS quirk in 7.0 uses the singular form (bit 14 in include/linux/pci.h) vs the plural form (bit 15) in 6.17-next] Signed-off-by: Koba Ko <kobak@nvidia.com>
1 parent 6179a7b commit 885cd42

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,6 +3731,19 @@ static int arm_smmu_def_domain_type(struct device *dev)
37313731
if (IS_HISI_PTT_DEVICE(pdev))
37323732
return IOMMU_DOMAIN_IDENTITY;
37333733

3734+
/*
3735+
* ASPEED BMC devices behind an AST1150 PCIe-to-PCI bridge
3736+
* receive DMA from BMC firmware using host physical addresses
3737+
* that bypass the kernel DMA API. Use identity mapping so
3738+
* the SMMU passes these transactions through untranslated.
3739+
*/
3740+
if (pdev->bus->self &&
3741+
(pdev->bus->self->dev_flags &
3742+
PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIAS) &&
3743+
pdev->bus->self->vendor == PCI_VENDOR_ID_ASPEED &&
3744+
pdev->bus->self->device == 0x1150)
3745+
return IOMMU_DOMAIN_IDENTITY;
3746+
37343747
if (pdev->vendor == PCI_VENDOR_ID_NVIDIA &&
37353748
(pdev->device == 0x2E12 || pdev->device == 0x2E2A ||
37363749
pdev->device == 0x2E2B))

0 commit comments

Comments
 (0)