Re: [rfc 5/6] dma-direct: atomic allocations must come from unencrypted pools
From: Christoph Hellwig
Date: Tue Mar 10 2020 - 14:47:47 EST
On Fri, Mar 06, 2020 at 04:36:07PM -0800, David Rientjes wrote:
> As a preliminary change to this series, I could move the atomic pools and
> coherent_pool command line to a new kernel/dma/atomic_pools.c file with a
> new CONFIG_DMA_ATOMIC_POOLS that would get "select"ed by CONFIG_DMA_REMAP
> and CONFIG_AMD_MEM_ENCRYPT and call into dma_common_contiguous_remap() if
> we have CONFIG_DMA_DIRECT_REMAP when adding pages to the pool.
Yes. Although I'd just name it kernel/dma/pool.c and
CONFIG_DMA_COHERENT_POOL or so, as I plan to reuse the code for
architectures that just preallocate all coherent memory at boot time
as well.
> I think that's what you mean by splitting the pool from remapping,
> otherwise we still have a full CONFIG_DMA_REMAP dependency here. If you
> had something else in mind, please let me know. Thanks!
Yes, that is exactly what I meant.