From: Adam Nielsen <a.nielsen@shikadi.net>
To: David VomLehn <dvomlehn@cisco.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Setting the physical RAM map
Date: Sun, 20 Dec 2009 19:07:39 +1000 [thread overview]
Message-ID: <4B2DE95B.20305@shikadi.net> (raw)
In-Reply-To: <20091130190036.GA24581@dvomlehn-lnx2.corp.sa.net>
Hi all,
I've done some more debugging and tracked down the problem a little further.
I've also fixed up (I think) the memory mappings, from looking at the setup
code from some of the other MIPS machines:
Determined physical RAM map:
memory: 01800000 @ 00000000 (usable)
memory: 00040000 @ 1fc00000 (ROM data)
>> TLB refill exception PC = 40024094 address = 7FFFF000
>
> This is not too surprising since the kernel is executing at an address
> must have a TLB entry to be accessible.
The boot loader refuses to execute the ELF image unless the load address is
set to 0x40020000 ("Load address out of range"), so it appears the kernel is
being executed at this address. The problem seems to be that there is nothing
mapped at 0x7FFFF000.
I've tracked the code that accesses this memory address to the
init_bootmem_core() function in mm/bootmem.c line ~109:
memset(bdata->node_bootmem_map, 0xff, mapsize);
This is being executed as:
memset(0x7ffff000, 0xff, 768);
Which is where the problem is coming from. Working backwards, I have narrowed
it down to arch/mips/kernel/setup.c line ~293. This is a loop which does some
calculations with memory (not sure exactly what) but the "mapstart" variable
is initialised to ~0UL, and it never gets updated before being passed through
to eventually the memset() line above.
The problem seems to be inside the loop. These lines:
if (end <= reserved_end)
continue;
Cause the loop to break out *before* setting mapstart, and since there is only
one RAM element in the array the loop does not run again. It seems that the
end of the kernel (reserved_end) is so big (it'll be 0x40020000 + size of
kernel) that it sits way after the end of the RAM mapping (0x01800000).
I'm not sure how to solve this issue, and I'm still a bit confused about MIPS
memory mapping (does the TLB mean that 0x40020000 could be mapped anywhere in
memory? Will this break things when Linux starts reprogramming it? Or does
Linux leave the TLB alone?) I've tried changing the memory from appearing at
offset 0 to offset 0x40020000 but it didn't change anything (just a message
about 8MB wasted on tracking unused pages.)
Any pointers would be greatly appreciated!
Many thanks,
Adam.
next prev parent reply other threads:[~2009-12-20 9:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-28 14:38 Setting the physical RAM map Adam Nielsen
2009-11-30 19:00 ` David VomLehn
2009-11-30 19:25 ` Geert Uytterhoeven
2009-11-30 22:35 ` Adam Nielsen
2009-12-20 9:07 ` Adam Nielsen [this message]
2009-11-30 21:41 ` Ralf Baechle
2009-11-30 22:38 ` Adam Nielsen
2009-12-01 0:49 ` Ralf Baechle
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=4B2DE95B.20305@shikadi.net \
--to=a.nielsen@shikadi.net \
--cc=dvomlehn@cisco.com \
--cc=linux-mips@linux-mips.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.