[email protected] writes:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
> to consider:
> - [High] dma-pool: cc_make_shared() runs after arch_dma_prep_coherent()
> --
>
> commit daae4fcc15a00bc83c4081ef4b27786a7f224537
> Author: Aneesh Kumar K.V (Arm) <[email protected]>
>
> dma-pool: Allocate CoCo atomic pools using CoCo shared memory allocator
>
> This commit updates atomic_pool_expand() to allocate confidential computing
> shared atomic DMA pools using the cc_shared layout and transition helpers
> (cc_shared_calc_layout(), cc_make_shared(), and cc_make_private()), enforcing
> shared granule size alignment and minimum allocation order.
>
>> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
>> index 70b7f64b17ab5..da487c3f9dc61 100644
>> --- a/kernel/dma/pool.c
>> +++ b/kernel/dma/pool.c
>
> [ ... ]
>
>> @@ -126,8 +142,7 @@ static int atomic_pool_expand(struct dma_gen_pool 
>> *dma_pool, size_t pool_size,
>>       * shrink so no re-encryption occurs in dma_direct_free().
>>       */
>>      if (dma_pool->cc_shared) {
>> -            ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>> -                                       1 << order);
>> +            ret = cc_make_shared(page_to_virt(page), pool_size);
>
> [Severity: High]
> Does calling cc_make_shared(page_to_virt(page), pool_size) after
> arch_dma_prep_coherent() and dma_common_contiguous_remap() leave dirty cache
> lines on the cacheable linear mapping alias when CONFIG_DMA_DIRECT_REMAP is
> enabled?
>

This is getting fixed by 

https://lore.kernel.org/all/[email protected]

-aneesh

Reply via email to