Re: [patch for-5.8 1/4] dma-direct: always align allocation size in dma_direct_alloc_pages()

2020-06-15 Thread Christoph Hellwig
On Thu, Jun 11, 2020 at 12:20:28PM -0700, David Rientjes wrote: > dma_alloc_contiguous() does size >> PAGE_SHIFT and set_memory_decrypted() > works at page granularity. It's necessary to page align the allocation > size in dma_direct_alloc_pages() for consistent behavior. > > This also fixes an

[patch for-5.8 1/4] dma-direct: always align allocation size in dma_direct_alloc_pages()

2020-06-11 Thread David Rientjes via iommu
dma_alloc_contiguous() does size >> PAGE_SHIFT and set_memory_decrypted() works at page granularity. It's necessary to page align the allocation size in dma_direct_alloc_pages() for consistent behavior. This also fixes an issue when arch_dma_prep_coherent() is called on an unaligned allocation