From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew F. Davis" Subject: Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers Date: Tue, 19 Mar 2019 10:03:20 -0500 Message-ID: <9feaab47-f2c2-3b85-0c9c-05cd97609beb@ti.com> References: <1551819273-640-1-git-send-email-john.stultz@linaro.org> <1551819273-640-3-git-send-email-john.stultz@linaro.org> <20190315090646.GC4470@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190315090646.GC4470@infradead.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig , John Stultz Cc: lkml , Laura Abbott , Benjamin Gaignard , Greg KH , Sumit Semwal , Liam Mark , Brian Starkey , Chenbo Feng , Alistair Strachan , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 3/15/19 4:06 AM, Christoph Hellwig wrote: >> + ret = remap_pfn_range(vma, addr, page_to_pfn(page), len, >> + vma->vm_page_prot); > > So the same chunk could be mapped to userspace and vmap, and later on > also DMA mapped. Who is going to take care of cache aliasing as I > see nothing of that in this series? > We should only have one type of memory per heap so all mappings will have the same type. That should solve the ARM specific issues, but I'm guessing you are thinking of more tricky architectures where all mappings need to be tracked and cleaned/invalidated.. For that I think we will have to track each right? How do others handle that, we can't be the first to offer cached buffers to userspace.