Skip to content

Commit 30315e7

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Do not support IOMMUv2 APIs when SNP is enabled
The IOMMUv2 APIs (for supporting shared virtual memory with PASID) configures the domain with IOMMU v2 page table, and sets DTE[Mode]=0. This configuration cannot be supported on SNP-enabled system. Signed-off-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8388f7d commit 30315e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/iommu/amd/init.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3458,7 +3458,12 @@ __setup("ivrs_acpihid", parse_ivrs_acpihid);
34583458

34593459
bool amd_iommu_v2_supported(void)
34603460
{
3461-
return amd_iommu_v2_present;
3461+
/*
3462+
* Since DTE[Mode]=0 is prohibited on SNP-enabled system
3463+
* (i.e. EFR[SNPSup]=1), IOMMUv2 page table cannot be used without
3464+
* setting up IOMMUv1 page table.
3465+
*/
3466+
return amd_iommu_v2_present && !amd_iommu_snp_en;
34623467
}
34633468
EXPORT_SYMBOL(amd_iommu_v2_supported);
34643469

0 commit comments

Comments
 (0)