Thread (67 messages) 67 messages, 6 authors, 2016-10-18
STALE3540d
Revisions (14)
  1. v1 [diff vs current]
  2. v1 current
  3. v3 [diff vs current]
  4. v3 [diff vs current]
  5. v4 [diff vs current]
  6. v4 [diff vs current]
  7. v5 [diff vs current]
  8. v5 [diff vs current]
  9. v6 [diff vs current]
  10. v6 [diff vs current]
  11. v7 [diff vs current]
  12. v7 [diff vs current]
  13. v8 [diff vs current]
  14. v9 [diff vs current]

[RFC PATCH v1 13/28] iommu/amd: AMD IOMMU support for SEV

From: Brijesh Singh <hidden>
Date: 2016-08-22 23:58:11
Also in: kvm, linux-efi, lkml
Subsystem: the rest, x86 architecture (32-bit and 64-bit), x86 mm · Maintainers: Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, Andy Lutomirski, Peter Zijlstra

From: Tom Lendacky <thomas.lendacky@amd.com>

DMA must be performed to memory that is not mapped encrypted when running
with SEV active. So if SEV is active, do not return the encryption mask
to the IOMMU.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 arch/x86/mm/mem_encrypt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index ce6e3ea..d6e9f96 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -237,7 +237,7 @@ void __init mem_encrypt_init(void)
 
 unsigned long amd_iommu_get_me_mask(void)
 {
-	return sme_me_mask;
+	return sev_active ? 0 : sme_me_mask;
 }
 
 unsigned long swiotlb_get_me_mask(void)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help