From: Christoph Hellwig <hch@infradead.org>
To: Oded Gabbay <oded.gabbay@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Omer Shpigelman <oshpigelman@habana.ai>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping
Date: Fri, 11 Oct 2019 02:26:22 -0700 [thread overview]
Message-ID: <20191011092622.GA19962@infradead.org> (raw)
In-Reply-To: <CAFCwf11hYWYNeROT8zpW+fcALijcTUuGVk-NoWvxzCORvd+dew@mail.gmail.com>
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() to the ASIC MMU. We reuse our driver's generic code
> path to map host memory to ASIC MMU and that's why we need the patch
> above. The user does NOT send us the pointer. He doesn't have this
> pointer. It is internal to the kernel driver. To do this reuse, we
> added a call to the is_vmalloc_addr(), so the function will know if it
> is called to work on user pointers, or on vmalloc *kernel* pointers.
But the function can't decided that. As I said before you can't just
take a value that possibly contains user pointers and call
is_vmalloc_addr on it, as kernel and user address can overlap on
various architectures.
You need to restructure your code to keep the kernel and user pointer
code paths entirely separate.
next prev parent reply other threads:[~2019-10-11 9:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 14:06 [PATCH 1/2] habanalabs: support vmalloc memory mapping Omer Shpigelman
2019-10-10 14:06 ` [PATCH 2/2] habanalabs: handle large memory on MMU Omer Shpigelman
2019-10-10 14:09 ` [PATCH 1/2] habanalabs: support vmalloc memory mapping Christoph Hellwig
2019-10-10 19:54 ` Omer Shpigelman
2019-10-11 8:10 ` Christoph Hellwig
2019-10-11 9:19 ` Oded Gabbay
2019-10-11 9:26 ` Christoph Hellwig [this message]
2019-10-11 9:27 ` Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011092622.GA19962@infradead.org \
--to=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oded.gabbay@gmail.com \
--cc=oshpigelman@habana.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.