summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVasant Hegde <vasant.hegde@amd.com>2026-08-24 08:58:21 +0000
committerJoerg Roedel <joerg.roedel@amd.com>2026-09-24 13:24:35 +0200
commitbf5bdfd1f8d4ad5c6020468d09b68b09c2adc5c2 (patch)
tree5a6983a7754da7f236f9d87982dcb00c80011e50 /scripts
parent567e74ce4dfde40a3b814de6af4adbfbe4ba1f38 (diff)
downloadlinux-bf5bdfd1f8d4ad5c6020468d09b68b09c2adc5c2.tar.gz
linux-bf5bdfd1f8d4ad5c6020468d09b68b09c2adc5c2.zip
iommu/amd: Force identity mode for selected GPUs only
Certain AMD GPUs must always operate in IOMMU identity mode. This was previously enforced using a PASID check, which happened to work because these specific GPUs are PASID-capable. However, this approach incorrectly applies identity mode enforcement to all PASID-capable devices, not just the GPUs that require it. This made sense in the past because the domain allocation API (iommu_ops->domain_alloc()) only received the domain type, so the driver had no way to inspect device capabilities and pick the most suitable page table format (v1 or v2). With the recent driver enhancement to use domain_alloc_paging_flags() for all paging domain allocations, the driver can now inspect the device and flags directly and choose the appropriate page table type per device. Update amd_iommu_def_domain_type() to force identity mapping only for the specific GPUs that require it, via a new quirks_force_identity_mapping(). With this change, a system booting in DMA translation mode will now select: * Guest (v2) page table for PASID-capable devices * Host (v1) page table for non-PASID-capable devices Also drop the amd_iommu_snp_en check, as SNP enforces paging domain, which doesn't work with the identity requirement of these GPUs. Link: https://lore.kernel.org/all/20200824105415.21000-1-joro@8bytes.org/ Link: https://lore.kernel.org/linux-iommu/20260723061548.10187-1-vasant.hegde@amd.com/ Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions