diff options
author | Joerg Roedel <jroedel@suse.de> | 2020-08-24 13:54:15 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2020-09-04 13:07:08 +0300 |
commit | 2822e582501b65707089b097e773e6fd70774841 (patch) | |
tree | bd28e8837fcb61baed583a7b4486aa57121965c3 /drivers/iommu/amd/iommu_v2.c | |
parent | 7cad554887f1c5fd77e57e6bf4be38370c2160cb (diff) | |
download | linux-2822e582501b65707089b097e773e6fd70774841.tar.xz |
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>
Diffstat (limited to 'drivers/iommu/amd/iommu_v2.c')
-rw-r--r-- | drivers/iommu/amd/iommu_v2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c index c259108ab6dd..0d175aed1d92 100644 --- a/drivers/iommu/amd/iommu_v2.c +++ b/drivers/iommu/amd/iommu_v2.c @@ -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; |