All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Linux kernel <linux-kernel@vger.kernel.org>
Subject: having problems with remap_page_range() and virt_to_phys()
Date: Thu, 09 Sep 2004 18:01:30 -0600	[thread overview]
Message-ID: <4140EEDA.2040909@nortelnetworks.com> (raw)

I'm trying to allocate a page of in-kernel memory and make it accessable to 
userspace and to late asm code where we don't have virtual memory enabled.

I'm running code essentially equivalent to the following, where "map_addr" is a 
virtual address passed in by userspace, and "vma" is the appropriate one for 
that address:


struct page *pg = alloc_page(GFP_KERNEL);
void *virt = page_address(pg);
unsigned long phys = virt_to_phys(virt)
remap_page_range(vma, map_addr, phys, PAGE_SIZE, vma->vm_page_prot)


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".

Anyone have any ideas?  I can't post the exact code right now since the machine 
is at work and hung (Oops.) but I could post it tomorrow if that is necessary.

I'm using 2.6.5 for ppc, if it makes any difference.

Thanks,

Chris

             reply	other threads:[~2004-09-10  0:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10  0:01 Chris Friesen [this message]
2004-09-10 14:15 ` having problems with remap_page_range() and virt_to_phys() 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 ` problems with remap_page_range() and virt_to_phys() -- solved Chris Friesen
     [not found] <972562878@toto.iv>
2004-09-10  4:00 ` having problems with remap_page_range() and virt_to_phys() Peter Chubb

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=4140EEDA.2040909@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.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.