diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-02-26 17:57:13 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-02-26 17:59:04 +0000 |
commit | dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e (patch) | |
tree | 60fcc5a02c202bbc59193cbd1c7a2e7755a5f934 /arch/arm64/mm/init.c | |
parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) | |
download | op-kernel-dev-dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e.zip op-kernel-dev-dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e.tar.gz |
arm64: vmemmap: use virtual projection of linear region
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.
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm/init.c')
-rw-r--r-- | arch/arm64/mm/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f3b061e..7802f21 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -319,8 +319,8 @@ void __init mem_init(void) #endif MLG(VMALLOC_START, VMALLOC_END), #ifdef CONFIG_SPARSEMEM_VMEMMAP - MLG((unsigned long)vmemmap, - (unsigned long)vmemmap + VMEMMAP_SIZE), + MLG(VMEMMAP_START, + VMEMMAP_START + VMEMMAP_SIZE), MLM((unsigned long)virt_to_page(PAGE_OFFSET), (unsigned long)virt_to_page(high_memory)), #endif |