On 3/5/07, Maxime Bizon <mbizon@xxxxxxxxxx> wrote:
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 accounted.
I think you missed PAGE_OFFSET meaning... PAGE_OFFSET is the start of the kernel virtual address space and before this patchset pa(PAGE_OFFSET) was always 0. In your case, you said: PAGE_OFFSET = 0x80000000 PHYS_OFFSET = 0x10000000 this means that the first kernel virtual address is 0x80000000 and the corresponding physical address is 0x10000000. If you load your kernel at 0x9000xxxx, it will be loaded in physical memory located at 0x2000xxxx which is obviously not what you want. So to fix this you have 2 possibilities: - load your kernel at 0x8000xxxx addresses, - set PAGE_OFFSET to 0x90000000. You said that you already tried the second solution but it fails. I don't see why though...
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 ?
well maybe some sanity checkings are missing here. Sorry for responding lately but life sometimes triggers NMIs ;) -- Franck