Skip to content

Commit 2822e58

Browse files
committed
iommu/amd: Do not use IOMMUv2 functionality when SME is active
When memory encryption is active the device is likely not in a direct mapped domain. Forbid using IOMMUv2 functionality for now until finer grained checks for this have been implemented. Signed-off-by: Joerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20200824105415.21000-3-joro@8bytes.org Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 7cad554 commit 2822e58

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/iommu/amd/iommu_v2.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)
737737

738738
might_sleep();
739739

740+
/*
741+
* When memory encryption is active the device is likely not in a
742+
* direct-mapped domain. Forbid using IOMMUv2 functionality for now.
743+
*/
744+
if (mem_encrypt_active())
745+
return -ENODEV;
746+
740747
if (!amd_iommu_v2_supported())
741748
return -ENODEV;
742749

0 commit comments

Comments
 (0)