phys_to_dma() sets the encryption bit on the translated DMA address. ButReviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
dma_to_phys() clears the encryption bit after it has been translated back
to the physical address, which could fail if the device uses DMA ranges.
AMD SME doesn't use the DMA ranges and thus this is harmless. But as we
are about to add support for other architectures, let us fix this.
Reported-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxx>
Link: https://lkml.kernel.org/r/yq5amsen9stc.fsf@xxxxxxxxxx
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Robin Murphy <robin.murphy@xxxxxxx>
Cc: Steven Price <steven.price@xxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Cc: Tom Lendacky <thomas.lendacky@xxxxxxx>
Reviewed-by: Robin Murphy <robin.murphy@xxxxxxx>
Acked-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
include/linux/dma-direct.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)