Skip to content

Commit 0a9f682

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> (cherry picked from commit 738fff0) [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]
1 parent 61e3d30 commit 0a9f682

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
@@ -3784,6 +3784,19 @@ static int arm_smmu_def_domain_type(struct device *dev)
37843784
if (IS_HISI_PTT_DEVICE(pdev))
37853785
return IOMMU_DOMAIN_IDENTITY;
37863786

3787+
/*
3788+
* ASPEED BMC devices behind an AST1150 PCIe-to-PCI bridge
3789+
* receive DMA from BMC firmware using host physical addresses
3790+
* that bypass the kernel DMA API. Use identity mapping so
3791+
* the SMMU passes these transactions through untranslated.
3792+
*/
3793+
if (pdev->bus->self &&
3794+
(pdev->bus->self->dev_flags &
3795+
PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIAS) &&
3796+
pdev->bus->self->vendor == PCI_VENDOR_ID_ASPEED &&
3797+
pdev->bus->self->device == 0x1150)
3798+
return IOMMU_DOMAIN_IDENTITY;
3799+
37873800
if (pdev->vendor == PCI_VENDOR_ID_NVIDIA &&
37883801
(pdev->device == 0x2E12 || pdev->device == 0x2E2A ||
37893802
pdev->device == 0x2E2B))

0 commit comments

Comments
 (0)