]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Do not disable SWIOTLB if SME is active
authorTom Lendacky <thomas.lendacky@amd.com>
Fri, 6 Oct 2017 21:35:40 +0000 (16:35 -0500)
committerJoerg Roedel <jroedel@suse.de>
Tue, 10 Oct 2017 17:49:30 +0000 (19:49 +0200)
commitfe292df21eb495bcd932ec9f9b77cefd96a37d38
tree6cfb500a8efede70d0f23bfa6de5364547afd41d
parentc1b31305bd9ced7f4232632fe8925af072cfcafa
iommu/amd: Do not disable SWIOTLB if SME is active

When SME memory encryption is active it will rely on SWIOTLB to handle
DMA for devices that cannot support the addressing requirements of
having the encryption mask set in the physical address.  The IOMMU
currently disables SWIOTLB if it is not running in passthrough mode.
This is not desired as non-PCI devices attempting DMA may fail. Update
the code to check if SME is active and not disable SWIOTLB.

Fixes: be30f50e64df ("iommu/amd: Allow the AMD IOMMU to work with memory encryption")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c