lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 28 Jun 2019 21:59:25 +0530 From: Pankaj Suryawanshi <pankajssuryawanshi@...il.com> To: Christoph Hellwig <hch@...radead.org> Cc: linux-mm@...ck.org, Michal Hocko <mhocko@...nel.org>, linux-kernel@...r.kernel.org, Vlastimil Babka <vbabka@...e.cz>, iommu@...ts.linux-foundation.org Subject: Re: DMA-API attr - DMA_ATTR_NO_KERNEL_MAPPING On Wed, Jun 26, 2019 at 11:21 PM Christoph Hellwig <hch@...radead.org> wrote: > > On Wed, Jun 26, 2019 at 10:12:45PM +0530, Pankaj Suryawanshi wrote: > > [CC: linux kernel and Vlastimil Babka] > > The right list is the list for the DMA mapping subsystem, which is > iommu@...ts.linux-foundation.org. I've also added that. > > > > I am writing driver in which I used DMA_ATTR_NO_KERNEL_MAPPING attribute > > > for cma allocation using dma_alloc_attr(), as per kernel docs > > > https://www.kernel.org/doc/Documentation/DMA-attributes.txt buffers > > > allocated with this attribute can be only passed to user space by calling > > > dma_mmap_attrs(). > > > > > > how can I mapped in kernel space (after dma_alloc_attr with > > > DMA_ATTR_NO_KERNEL_MAPPING ) ? > > You can't. And that is the whole point of that API. 1. We can again mapped in kernel space using dma_remap() api , because when we are using DMA_ATTR_NO_KERNEL_MAPPING for dma_alloc_attr it returns the page as virtual address(in case of CMA) so we can mapped it again using dma_remap(). 2. We can mapped in kernel space using vmap() as used for ion-cma https://github.com/torvalds/linux/tree/master/drivers/staging/android/ion as used in function ion_heap_map_kernel(). Please let me know if i am missing anything.
Powered by blists - more mailing lists