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

From: Aneesh Kumar K . V

Date: Tue Jun 02 2026 - 02:10:32 EST


Michael Kelley <mhklinux@xxxxxxxxxxx> writes:

> From: Aneesh Kumar K.V (Arm) <aneesh.kumar@xxxxxxxxxx> 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@xxxxxxxxxx>
>> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@xxxxxxxxxx>

...

> 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