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

From: Aneesh Kumar K.V <[email-masked]>
Date: Tue, 02 Jun 2026 11:40:00 +0530

Michael Kelley <[email-masked]> writes:

> From: Aneesh Kumar K.V (Arm) <[email-masked]> 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 <[email-masked]>
>> Signed-off-by: Aneesh Kumar K.V (Arm) <[email-masked]>

...

> 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