[PATCH 1/2] arm: mm: Ignore memory banks which are in front of the kernel when HIGHMEM is ON

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Feb 13 09:52:08 EST 2013


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 at 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".



More information about the linux-arm-kernel mailing list