lkml.org 
[lkml]   [2019]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] virtio_ring: fix return code on DMA mapping fails
On Thu, Nov 28, 2019 at 08:05:38AM +0100, Christoph Hellwig wrote:
> On Thu, Nov 28, 2019 at 12:42:25AM +0000, Ashish Kalra wrote:
> > Why can't we leverage CMA instead of SWIOTLB for DMA when SEV is
> > enabled, CMA is well integerated with the DMA subsystem and handles
> > encrypted pages when force_dma_unencrypted() returns TRUE.
> >
> > Though, CMA might face the same issues as SWIOTLB bounce buffers, it's
> > size is similarly setup statically as SWIOTLB does or can be set as a
> > percentage of the available system memory.
>
> How is CMA integrated with SEV? CMA just gives a contiguous chunk
> of memory, which still needs to be remapped as unencrypted before
> returning it to the user.

Looking at the implementation, i see that CMA is accessible using
dma_alloc_coherent() and the buffer allocated by dma_alloc_coherent()
either using the CMA or the page allocator, will be marked/tagged as
unencrypted and returned to the user.

But for dma_map_xx() interfaces, the memory will need be remapped as
unencrypted memory (as you mentioned).

Thanks,
Ashish

\
 
 \ /
  Last update: 2019-11-29 02:59    [W:1.617 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site