LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Brice Goglin <Brice.Goglin@ens-lyon.org>
To: Nikolaus Rath <Nikolaus@rath.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: virt_to_page for userspace pointers
Date: Sat, 05 Feb 2011 22:36:22 +0100	[thread overview]
Message-ID: <4D4DC2D6.8030905@ens-lyon.org> (raw)
In-Reply-To: <878vxuxkfr.fsf@inspiron.ap.columbia.edu>

Le 05/02/2011 22:04, Nikolaus Rath a écrit :
> Nikolaus Rath <Nikolaus@rath.org> writes:
>   
>> Is there a way that my own kernel module can "reverse" this mmap call?
>> I.e. given the userspace pointer, how do I get access to the physical
>> location of the memory that has been mapped?
>>     
> Ok, after some studying I think I can ask the question in a better way:
>
> Is there an equivalent function to virt_to_page (and virt_to_phys) that
> works with userspace pointers? Or do I have to manually walk through the
> page tables? In the later case, are there any examples of this kind of
> search that I could use as a basis?
>   

You probably want get_user_pages() (or get_user_pages_fast()).

Brice


  reply	other threads:[~2011-02-05 21:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 20:50 Reversing a memory mapping? Nikolaus Rath
2011-02-05 21:04 ` virt_to_page for userspace pointers (was: Reversing a memory mapping?) Nikolaus Rath
2011-02-05 21:36   ` Brice Goglin [this message]
2011-02-13 20:24     ` virt_to_page for userspace pointers Nikolaus Rath
2011-02-13 20:37       ` Brice Goglin
2011-02-13 21:56         ` Nikolaus Rath
2011-02-13 22:06           ` Alan Cox
2011-02-13 22:11             ` Nikolaus Rath
2011-02-14 22:46       ` Nikolaus Rath
2011-07-26 12:03         ` Alexey Skidanov

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=4D4DC2D6.8030905@ens-lyon.org \
    --to=brice.goglin@ens-lyon.org \
    --cc=Nikolaus@rath.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: virt_to_page for userspace pointers' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).