summaryrefslogtreecommitdiffstats
path: root/lib/swiotlb.c
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2017-10-20 10:30:53 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-11-07 09:35:58 -0500
commitd7b417fa08d1187923c270bc33a3555c2fcff8b9 (patch)
tree2f1793ae8e6b6a2ab89fdc52247a7d8f5422bd55 /lib/swiotlb.c
parent0e4c12b45aa88e74fdda117896d2b61c4e510cb9 (diff)
x86/mm: Add DMA support for SEV memory encryption
DMA access to encrypted memory cannot be performed when SEV is active. In order for DMA to properly work when SEV is active, the SWIOTLB bounce buffers must be used. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Borislav Petkov <bp@suse.de>C Tested-by: Borislav Petkov <bp@suse.de> Cc: kvm@vger.kernel.org Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Borislav Petkov <bp@alien8.de> Link: https://lkml.kernel.org/r/20171020143059.3291-12-brijesh.singh@amd.com
Diffstat (limited to 'lib/swiotlb.c')
-rw-r--r--lib/swiotlb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 8c6c83ef57a4..cea19aaf303c 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -507,8 +507,9 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
507 if (no_iotlb_memory) 507 if (no_iotlb_memory)
508 panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer"); 508 panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer");
509 509
510 if (sme_active()) 510 if (mem_encrypt_active())
511 pr_warn_once("SME is active and system is using DMA bounce buffers\n"); 511 pr_warn_once("%s is active and system is using DMA bounce buffers\n",
512 sme_active() ? "SME" : "SEV");
512 513
513 mask = dma_get_seg_boundary(hwdev); 514 mask = dma_get_seg_boundary(hwdev);
514 515