From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm: mm: Ignore memory banks which are in front of the kernel when HIGHMEM is ON
Date: Wed, 13 Feb 2013 14:52:08 +0000 [thread overview]
Message-ID: <20130213145208.GC17833@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAHTX3dLy=t43+oNXMrsdz1_5AGf6==z=vG7K8V6dSG0tm6U4=g@mail.gmail.com>
On Wed, Feb 13, 2013 at 03:39:21PM +0100, Michal Simek wrote:
> ok. Can you describe me this configuration? Enough to tell me dts memory
> fragment and kernel load addr which match this case.
Anything which uses more than 1GB of memory and has PAGE_OFFSET set at
0xc0000000 (3GB). Simple maths will tell you that, and why it fails.
Look:
- if __va(bank->start) = PAGE_OFFSET, and PAGE_OFFSET is at 3GB.
- if bank->size = 1GB (which we _do_ have), then
__va(bank->start + bank->size) = 4GB. 4GB represented as a 32-bit
pointer is NULL. NULL < (void *)PAGE_OFFSET.
Therefore, your patch will cause systems with 1GB or more of memory in
one bank to ignore _all_ the memory passed in.
And if you look@the code:
if (__va(bank->start) >= vmalloc_min ||
__va(bank->start) < (void *)PAGE_OFFSET)
highmem = 1;
notice the facy that we're marking all memory starting with an apparant
virtual address outside of PAGE_OFFSET...vmalloc_min as highmem. This is
to catch cases exactly like this.
Memory for which __va(bank->start) < (void *)PAGE_OFFSET will also have
__va(bank->start + bank->size - 1) (in your patch) also below PAGE_OFFSET,
and your modification will cause the kernel to ignore this memory -
which is not acceptable.
I don't think there's much option for solutions to this; not with a common
kernel designed to run on multiple platforms. If a platform doesn't
conform to the Linux requirements for a common kernel, then it doesn't
conform and it can't use it.
In much the same way that we ended up saying "no" to people who wanted
to place two physical banks of memory in reverse order in the virtual
mapping, I think this is another case of "no, we can't permit this with
common cross-subarch kernels".
next prev parent reply other threads:[~2013-02-13 14:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 8:58 [PATCH 1/2] arm: mm: Ignore memory banks which are in front of the kernel when HIGHMEM is ON Michal Simek
2013-02-13 8:58 ` [PATCH 2/2] arm: mm: Add support for booting the kernel out of the first 16MB of memory Michal Simek
2013-02-13 9:03 ` [PATCH 1/2] arm: mm: Ignore memory banks which are in front of the kernel when HIGHMEM is ON Russell King - ARM Linux
2013-02-13 14:39 ` Michal Simek
2013-02-13 14:52 ` Russell King - ARM Linux [this message]
2013-02-13 15:52 ` Michal Simek
2013-02-13 15:56 ` Russell King - ARM Linux
2013-02-14 5:01 ` Nicolas Pitre
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=20130213145208.GC17833@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).