Skip to content

Commit 55f7351

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>
1 parent 93e1b6a commit 55f7351

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
@@ -3774,6 +3774,19 @@ static int arm_smmu_def_domain_type(struct device *dev)
37743774
if (IS_HISI_PTT_DEVICE(pdev))
37753775
return IOMMU_DOMAIN_IDENTITY;
37763776

3777+
/*
3778+
* ASPEED BMC devices behind an AST1150 PCIe-to-PCI bridge
3779+
* receive DMA from BMC firmware using host physical addresses
3780+
* that bypass the kernel DMA API. Use identity mapping so
3781+
* the SMMU passes these transactions through untranslated.
3782+
*/
3783+
if (pdev->bus->self &&
3784+
(pdev->bus->self->dev_flags &
3785+
PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES) &&
3786+
pdev->bus->self->vendor == PCI_VENDOR_ID_ASPEED &&
3787+
pdev->bus->self->device == 0x1150)
3788+
return IOMMU_DOMAIN_IDENTITY;
3789+
37773790
if (pdev->vendor == PCI_VENDOR_ID_NVIDIA &&
37783791
(pdev->device == 0x2E12 || pdev->device == 0x2E2A ||
37793792
pdev->device == 0x2E2B))

0 commit comments

Comments
 (0)