Skip to content

Commit

Permalink
iommu/amd: Do not use IOMMUv2 functionality when SME is active
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Sep 4, 2020
1 parent 7cad554 commit 2822e58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/iommu/amd/iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)

might_sleep();

/*
* When memory encryption is active the device is likely not in a
* direct-mapped domain. Forbid using IOMMUv2 functionality for now.
*/
if (mem_encrypt_active())
return -ENODEV;

if (!amd_iommu_v2_supported())
return -ENODEV;

Expand Down

0 comments on commit 2822e58

Please sign in to comment.