arm64: mm: Reclaim unused vmemmap region for vmalloc use
authorArd Biesheuvel <ardb@kernel.org>
Wed, 13 Dec 2023 08:40:31 +0000 (09:40 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 9 Feb 2024 10:56:12 +0000 (10:56 +0000)
commitd432b8d57c0c41873f1b8743203776baeb5778b6
treeae0d590e05a73ee43a81d3683144de6fe807a685
parent32697ff38287bb9f6c7ee1b04656a677b62496a6
arm64: mm: Reclaim unused vmemmap region for vmalloc use

The vmemmap array is statically sized based on the maximum supported
size of the virtual address space, but it is located inside the upper VA
region, which is statically sized based on the *minimum* supported size
of the VA space. This doesn't matter much when using 64k pages, which is
the only configuration that currently supports 52-bit virtual
addressing.

However, upcoming LPA2 support will change this picture somewhat, as in
that case, the vmemmap array will take up more than 25% of the upper VA
region when using 4k pages. Given that most of this space is never used
when running on a system that does not support 52-bit virtual
addressing, let's reclaim the unused vmemmap area in that case.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20231213084024.2367360-15-ardb@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
arch/arm64/include/asm/pgtable.h