From: Arnd Bergmann <[email protected]>

Unlike x86 and powerpc, there is currently no option to use exactly 2GiB
of lowmem on Arm. Since 2GiB is still a relatively common configuration
on embedded systems, it makes sense to allow this to be used in
non-highmem builds.

Add the Kconfig option and make this the default for non-LPAE builds
with highmem enabled instead of CONFIG_VMSPLIT_2G.  LPAE still requires
the vmsplit to be on a gigabyte boundary, so this is only available for
classic pagetables at the moment, same as CONFIG_VMSPLIT_3G_OPT.
Keep ARCH_MMAP_RND_BITS_MAX at 15 for this.

Tested in qemu -M virt, both with and without HIGHMEM enabled.

Acked-by: Mike Rapoport (Microsoft) <[email protected]>
Acked-by: Lorenzo Stoakes (ARM) <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
---
v2: Change ARCH_MMAP_RND_BITS_MAX for PAGE_OFFSET=0x70000000 (Sashiko bot)
---
 arch/arm/Kconfig | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fc66d52d847e..270ae2b89407 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -333,8 +333,8 @@ config ARCH_MMAP_RND_BITS_MIN
        default 8
 
 config ARCH_MMAP_RND_BITS_MAX
-       default 14 if PAGE_OFFSET=0x40000000
-       default 15 if PAGE_OFFSET=0x80000000
+       default 14 if PAGE_OFFSET<=0x40000000
+       default 15 if PAGE_OFFSET<=0x80000000
        default 16
 
 config ARCH_MULTIPLATFORM
@@ -1039,6 +1039,9 @@ choice
                bool "3G/1G user/kernel split (for full 1G low memory)"
        config VMSPLIT_2G
                bool "2G/2G user/kernel split"
+       config VMSPLIT_2G_OPT
+               depends on !ARM_LPAE
+               bool "2G/2G user/kernel split (for full 2G low memory)"
        config VMSPLIT_1G
                bool "1G/3G user/kernel split"
 endchoice
@@ -1047,6 +1050,7 @@ config PAGE_OFFSET
        hex
        default PHYS_OFFSET if !MMU
        default 0x40000000 if VMSPLIT_1G
+       default 0x70000000 if VMSPLIT_2G_OPT
        default 0x80000000 if VMSPLIT_2G
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0xC0000000
@@ -1055,6 +1059,7 @@ config KASAN_SHADOW_OFFSET
        hex
        depends on KASAN
        default 0x1f000000 if PAGE_OFFSET=0x40000000
+       default 0x4f000000 if PAGE_OFFSET=0x70000000
        default 0x5f000000 if PAGE_OFFSET=0x80000000
        default 0x9f000000 if PAGE_OFFSET=0xC0000000
        default 0x8f000000 if PAGE_OFFSET=0xB0000000
-- 
2.53.0


Reply via email to