Commit f12ce53f authored by Joerg Roedel's avatar Joerg Roedel Committed by Greg Kroah-Hartman

iommu/amd: Do not use IOMMUv2 functionality when SME is active

[ Upstream commit 2822e582 ]

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: default avatarJoerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20200824105415.21000-3-joro@8bytes.orgSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 349eb8ed
...@@ -776,6 +776,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids) ...@@ -776,6 +776,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)
might_sleep(); 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()) if (!amd_iommu_v2_supported())
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment