[Top] [All Lists]

Re: [PATCH 0/2] FLATMEM: allow memory to start at pfn != 0 [take #2]

To: Franck Bui-Huu <>
Subject: Re: [PATCH 0/2] FLATMEM: allow memory to start at pfn != 0 [take #2]
From: Maxime Bizon <>
Date: Mon, 05 Mar 2007 17:33:53 +0100
Cc: linux-mips <>
In-reply-to: <>
Organization: Freebox
Original-recipient: rfc822;
References: <> <> <>
On Mon, 2007-03-05 at 15:15 +0100, Franck Bui-Huu wrote:

Thanks for caring Franck,

> Does your platform code do some address translation by using
> CPHYSADDR() macro or by using anything else than pa() ?

Not at all, I've reduced platform code to minimum for the test, it
basically registers a prom console, and do add_memory_region(0x10000000,
32 << 20), remaining is basic irq and time stuff.

> Just to be sure, is your PAGE_OFFSET equal to 0x80000000 ?

Yes, here is my spaces.h content:

#define PHYS_OFFSET             0x10000000

#define CAC_BASE                0x90000000
#define IO_BASE                 0xa0000000
#define UNCAC_BASE              0xa0000000
#define MAP_BASE                0xc0000000

#define PAGE_OFFSET             0x80000000UL

Note: The CAC_BASE value of 0x90000000 is for the linux exception code
to work as-is, since there is no RAM at 0x80000000 to put vector code.

I dug a little and found the following.

My kernel is loaded at 0x9012d000, '&_end' value is 0x901d4020. In
bootmem_init(), we try to compute reserved_end by using
__pa_symbol(&_end), which adds PHYS_OFFSET to it, though it was already

The loop in setup.c is thus unable to compute a correct 'map_start'
value since 'reserved_end' is way above all declared memory.

init_bootmem_node() is then called with a 'map_start' default value of
~0. Maybe that case should fall in the invalid memory map panic ?

I tried to set 'reserved_end' value manually and it went furter, but I
end up with the following message:

Bad page state in process 'swapper'
page:81000000 flags:0x00000000 mapping:00000000 mapcount:1 count:0
Trying to fix it up, but a reboot is needed
Call Trace:
[<90029f10>] dump_stack+0x8/0x34
[<9006ac58>] bad_page+0x68/0xa8
[<9006b0a4>] __free_pages_ok+0x358/0x37c
[<9013d374>] free_all_bootmem_core+0x24c/0x270
[<90134f30>] mem_init+0x40/0x19c
[<9012d828>] start_kernel+0x1d4/0x36c

Full dmesg with and without manual set of reserved_end attached.



Attachment: dotconfig
Description: Text document

Attachment: dmesg.txt
Description: Text document

Attachment: dmesg-manual-reserved_end.txt
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>