From: Brian Gerst <bgerst@didntduck.org>
To: mdaljeet@in.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: pte_page
Date: Wed, 30 May 2001 08:38:54 -0400 [thread overview]
Message-ID: <3B14E9DE.75A65F04@didntduck.org> (raw)
In-Reply-To: <CA256A5C.002E4CF0.00@d73mta01.au.ibm.com> <3B14E70F.F7E7D4BA@didntduck.org>
Brian Gerst wrote:
>
> mdaljeet@in.ibm.com wrote:
> >
> > I use the 'pgt_offset', 'pmd_offset', 'pte_offset' and 'pte_page' inside a
> > module to get the physical address of a user space virtual address. The
> > physical address returned by 'pte_page' is not page aligned whereas the
> > virtual address was page aligned. Can somebody tell me the reason?
> >
> > Also, can i use these functions to get the physical address of a kernel
> > virtual address using init_mm?
>
> pte_page() returns the struct page * for the page, not the page
> address. To get the physical address of a page use __pa(virtaddr), but
> this works if and only if the page is not highmem and not vmalloced.
Oops, I forgot that you said user page... __pa() only works for kernel
addresses. I don't see any other macros that can help you. Maybe one
of the VM gurus can add something here?
--
Brian Gerst
next prev parent reply other threads:[~2001-05-30 12:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-30 8:01 pte_page mdaljeet
2001-05-30 12:26 ` pte_page Brian Gerst
2001-05-30 12:38 ` Brian Gerst [this message]
2001-05-30 14:09 ` pte_page Ingo Molnar
2001-05-30 17:08 ` pte_page Pete Wyckoff
2001-05-30 17:39 ` pte_page Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2001-05-31 9:57 pte_page mdaljeet
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=3B14E9DE.75A65F04@didntduck.org \
--to=bgerst@didntduck.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdaljeet@in.ibm.com \
/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.