]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: vmemmap: use virtual projection of linear region
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 26 Feb 2016 16:57:13 +0000 (17:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Mar 2016 23:34:52 +0000 (15:34 -0800)
commite75c4b65150f099789821cb5e3f0efc964c1db05
treed7c91bdd06497f1af1ec0b54d2378fd9142d8bd7
parent419a2cd1f5ab18a14026fc15a626d49f2df80fdc
arm64: vmemmap: use virtual projection of linear region

commit dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e upstream.

Commit dd006da21646 ("arm64: mm: increase VA range of identity map") made
some changes to the memory mapping code to allow physical memory to reside
at an offset that exceeds the size of the virtual mapping.

However, since the size of the vmemmap area is proportional to the size of
the VA area, but it is populated relative to the physical space, we may
end up with the struct page array being mapped outside of the vmemmap
region. For instance, on my Seattle A0 box, I can see the following output
in the dmesg log.

   vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000   (     8 GB maximum)
             0xffffffbfc0000000 - 0xffffffbfd0000000   (   256 MB actual)

We can fix this by deciding that the vmemmap region is not a projection of
the physical space, but of the virtual space above PAGE_OFFSET, i.e., the
linear region. This way, we are guaranteed that the vmemmap region is of
sufficient size, and we can even reduce the size by half.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/init.c