All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Linux kernel <linux-kernel@vger.kernel.org>
Cc: Hugh Dickins <hugh@veritas.com>
Subject: problems with remap_page_range() and virt_to_phys() -- solved
Date: Fri, 10 Sep 2004 15:01:19 -0600	[thread overview]
Message-ID: <4142161F.1060904@nortelnetworks.com> (raw)
In-Reply-To: <4140EEDA.2040909@nortelnetworks.com>

Friesen, Christopher [CAR:VC21:EXCH] wrote:


> The problem that I'm having is that after the call to remap_page_range, 
> the result of
> 
> virt_to_phys(map_addr)
> 
> is not equal to "phys", and I assume it should be since its supposed to 
> be pointing to the same physical page as "virt".

I seem to have found my problem.  There were two things involved:

1) virt_to_phys() doesn't work on user addresses, so you basically have to walk 
the page tables.  For ppc, iopa() seems to do this although there is a comment 
about it not working on pmac (which it seems to).

2) to setup the vma for unmapped areas I was using mmap with MAP_PRIVATE.  On 
the first write by userspace, the mapping was changed and the user page was no 
longer mapped to the desired kernel page.  Changing this to MAP_SHARED fixed it.

Chris

      parent reply	other threads:[~2004-09-10 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10  0:01 having problems with remap_page_range() and virt_to_phys() Chris Friesen
2004-09-10 14:15 ` Hugh Dickins
2004-09-10 15:13   ` Chris Friesen
2004-09-10 17:52     ` Chris Friesen
2004-09-10 21:38   ` Chris Friesen
2004-09-10 21:01 ` Chris Friesen [this message]

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=4142161F.1060904@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.