[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190906063203.GA25415@infradead.org>
Date: Thu, 5 Sep 2019 23:32:03 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Thomas Hellström (VMware)
<thomas_os@...pmail.org>
Cc: Christoph Hellwig <hch@...radead.org>,
linux-kernel@...r.kernel.org,
"pv-drivers@...are.com" <pv-drivers@...are.com>,
Thomas Hellstrom <thellstrom@...are.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Christian König <christian.koenig@....com>
Subject: Re: dma_mmap_fault discussion
On Thu, Sep 05, 2019 at 07:05:43PM +0200, Thomas Hellström (VMware) wrote:
> I took a quick look at the interfaces and have two questions:
>
> 1) dma_mmap_prepare(), would it be possible to drop the references to the
> actual coherent region? The thing is that TTM doesn't know at mmap time what
> memory will be backing the region. It can be VRAM, coherent memory or system
I guess we can shift the argument checking into the fault handler.
> 2) @cpu_addr and @dma_addr are the values pointing at the beginning of an
> allocated chunk, right?
Yes.
> The reason I'm asking is that TTM's coherent memory
> pool is sub-allocating from larger chunks into smaller PAGE_SIZE chunks,
> which means that a TTM buffer object may be randomly split across larger
> chunks, which means we have to store these values for each PAGE_SiZE chunk.
For implementations that remap non-contigous regions using vmap we need the
start cpu address passed, as that is used to find the vm_struct structure
for it. That being said I don't see a problem with you keeping track
of the original start and offset into in your suballocation helpers.
Powered by blists - more mailing lists