Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-11 Thread Oded Gabbay
On Fri, Oct 11, 2019 at 12:26 PM Christoph Hellwig wrote: > > On Fri, Oct 11, 2019 at 12:19:36PM +0300, Oded Gabbay wrote: > > We first allocate, using vmalloc_user, a certain memory block that > > will be used by the ASIC and the user (ASIC is producer, user is > > consumer). > > After we use vma

Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-11 Thread Christoph Hellwig
On Fri, Oct 11, 2019 at 12:19:36PM +0300, Oded Gabbay wrote: > We first allocate, using vmalloc_user, a certain memory block that > will be used by the ASIC and the user (ASIC is producer, user is > consumer). > After we use vmalloc_user, we map the *kernel* pointer we got from the > vmalloc_user()

Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-11 Thread Oded Gabbay
On Fri, Oct 11, 2019 at 11:10 AM Christoph Hellwig wrote: > > On Thu, Oct 10, 2019 at 07:54:07PM +, Omer Shpigelman wrote: > > The is_vmalloc_addr checks are for user pointers and for memory which was > > allocated by the driver with vmalloc_user. > > This does not make any sense whatsoever.

Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-11 Thread Christoph Hellwig
On Thu, Oct 10, 2019 at 07:54:07PM +, Omer Shpigelman wrote: > The is_vmalloc_addr checks are for user pointers and for memory which was > allocated by the driver with vmalloc_user. This does not make any sense whatsoever. vmalloc_user returns a kernel address, it just does a GFP_USER instea

RE: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-10 Thread Omer Shpigelman
On Thu, Oct 10, 2019 at 5:10 PM Christoph Hellwig wrote: > On Thu, Oct 10, 2019 at 02:06:22PM +, Omer Shpigelman wrote: > > This patch adds support in mapping of vmalloc memory. > > In contrary to user memory, vmalloc memory is already pinned and has > > no vm_area structure. Therefore a new

Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-10 Thread Christoph Hellwig
On Thu, Oct 10, 2019 at 02:06:22PM +, Omer Shpigelman wrote: > This patch adds support in mapping of vmalloc memory. > In contrary to user memory, vmalloc memory is already pinned and has no > vm_area structure. Therefore a new capability was needed in order to map > this memory. Unless I am m

[PATCH 1/2] habanalabs: support vmalloc memory mapping

2019-10-10 Thread Omer Shpigelman
This patch adds support in mapping of vmalloc memory. In contrary to user memory, vmalloc memory is already pinned and has no vm_area structure. Therefore a new capability was needed in order to map this memory. Mapping vmalloc memory is needed for Gaudi ASIC. Signed-off-by: Omer Shpigelman ---