mapping memory in 0xb space
David Gibson
david at gibson.dropbear.id.au
Tue Sep 28 10:44:54 EST 2004
On Mon, Sep 27, 2004 at 02:47:15PM -0500, Igor Grobman wrote:
> I would like to be able to remap memory into 0xb space with 2.4.21 kernel.
> I have code that works fine on power3 box, but fails miserably on my dual
> power4+ box. I am using btmalloc() from pmc.c with a modified range.
> Normal btmalloc() allocation works fine, but if I change the range to
> start with, e.g. 0xb00001FFFFF00000 (instead of 0xb00..), the kernel
> crashes when accessing the allocated page.
>
> For those of you unfamiliar with btmalloc() code, it finds a physical page
> using get_free_pages(), subtracts PAGE_OFFSET (i.e. 0xc00...) to form a
> physical address, then inserts the page into linux page tables, using the
> VSID calculated with get_kernel_vsid() and the physical address
> calculated above. It also inserts an HPTE into the hardware page table.
> It doesn't do anything with regards to allocating segments. I understand
> the segments should be faulted in. I looked at the code in head.S, and it
> appears that do_stab_bolted should be doing this. Yet, I am missing something,
> because the btmalloc() code does not in fact work for pages in the range I
> specified above.
>
> I am running this on 7029-6E3 (p615?) machine with two power4+ processors.
> I am using the kernel from Suse's 2.4.21-215 source package.
>
> Any ideas and attempts to un-confuse me are welcome.
Err... this seems likely to cause trouble. Recent kernels don't even
have VSIDs allocated for the 0xb... region. 2.4.21 will have some
kernel VSIDs there, but there will probably be a bunch of places that
assume addresses below 0xc... are user addresses and compute the vsids
accordingly. Differences in the code for segment table and SLB
machines are probably why it works (or seems to) on power3 but not
power4.
Also, unless you've created a new set, there are no Linux page tables
for the 0xb region - the only linux page tables for the kernel are for
the vmalloc (0xd) and ioremap (0xe) regions.
Why on earth do you want to do this?
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
More information about the Linuxppc64-dev
mailing list