Re: having problems with remap_page_range() and virt_to_phys()

From: Chris Friesen
Date: Fri Sep 10 2004 - 10:15:23 EST


Hugh Dickins wrote:
On Thu, 9 Sep 2004, Chris Friesen wrote:

You will need to SetPageReserved(pg) for remap_page_range to map it.
And no, remembering your earlier pleas, the MM system doesn't clean
up for you, you'll need to ClearPageReserved and free the page when
it's all done with (if ever).

Right. I actually did call SetPageReserved(pg), I just forgot to include it in the code snippet--my test machine is on the other side of the country and I managed to hose it nicely last night.

virt_to_phys applies to the kernel virtual address (what you name "virt"
above), it won't work on a user virtual address, that's something else.

Aha. That may be part of my problem, at least on the verification side.

But there are plenty
of examples of using remap_page_range in the kernel source tree, maybe
not all of them quite correct, but I'd have thought you could work out
what you need from those examples.

So did I...the code finishes without errors, but the assembly language part doesn't work properly. (And it does work with another method of getting memory, but that method breaks as soon as you go highmem...)

Chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/