[PATCH v3 1/3] dma: Fix encryption bit clearing for dma_to_phys
Gavin Shan
gshan at redhat.com
Thu Feb 27 18:08:47 PST 2025
On 2/28/25 12:41 AM, Suzuki K Poulose wrote:
> phys_to_dma() sets the encryption bit on the translated DMA address. But
> 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 at kernel.org>
> Link: https://lkml.kernel.org/r/yq5amsen9stc.fsf@kernel.org
> Cc: Will Deacon <will at kernel.org>
> Cc: Jean-Philippe Brucker <jean-philippe at linaro.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Robin Murphy <robin.murphy at arm.com>
> Cc: Steven Price <steven.price at arm.com>
> Cc: Christoph Hellwig <hch at lst.de>
> Cc: Marek Szyprowski <m.szyprowski at samsung.com>
> Cc: Tom Lendacky <thomas.lendacky at amd.com>
> Reviewed-by: Robin Murphy <robin.murphy at arm.com>
> Acked-by: Tom Lendacky <thomas.lendacky at amd.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose at arm.com>
> ---
> include/linux/dma-direct.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Reviewed-by: Gavin Shan <gshan at redhat.com>
More information about the linux-arm-kernel
mailing list