[PATCH v5 10/20] dma-direct: make dma_direct_map_phys() honor DMA_ATTR_CC_SHARED

Aneesh Kumar K.V aneesh.kumar at kernel.org
Mon Jun 1 23:10:00 PDT 2026


Michael Kelley <mhklinux at outlook.com> writes:

> From: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org> Sent: Thursday, May 21, 2026 9:28 PM
>> 
>> Teach dma_direct_map_phys() to select the DMA address encoding based on
>> DMA_ATTR_CC_SHARED.
>> 
>> Use phys_to_dma_unencrypted() for decrypted mappings and
>> phys_to_dma_encrypted() otherwise. If a device requires unencrypted DMA
>> but the source physical address is still encrypted, force the mapping
>> through swiotlb so the DMA address and backing memory attributes remain
>> consistent.
>> 
>> Update the arm64, x86, s390 and powerpc secure-guest setup to not use
>> swiotlb force option
>> 
>> Tested-by: Jiri Pirko <jiri at nvidia.com>
>> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>

...

> With this patch removing SWIOTLB_FORCE from four places in
> kernel code, there are no remaining places where it is set.
> The test of SWIOTLB_FORCE could be removed from
> swiotlb_init_remap(), and its definition could be deleted
> from include/linux/swiotlb.h.
>

Sure, I’ll add that as a separate patch in the series.

-aneesh



More information about the linux-arm-kernel mailing list