arm64: Introduce a kernel configuration option for VA_BITS
Subsystems (2)
PATCH v4 3/7 arm64: Introduce a kernel configuration option for VA_BITS
This patch adds a kernel configuration for VA_BITS.
It helps to prevent unnecessary #ifdef statements insertions for VA_BITS when implementing different page sizes and level of translation tables.
--- arch/arm64/Kconfig | 8 ++++++++ arch/arm64/include/asm/memory.h | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm64/Kconfig +8 -0
@@ -186,6 +186,14 @@ config ARM64_3_LEVELS endchoice +config ARM64_VA_BITS + int "Virtual address space size" + range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS + range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS + help + This feature is determined by a combination of page size and + level of translation tables. + config CPU_BIG_ENDIAN bool "Build big-endian kernel" help
arch/arm64/include/asm/memory.h +1 -5
@@ -41,11 +41,7 @@* The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 128MB of the kernel text. */ -#ifdef CONFIG_ARM64_64K_PAGES -#define VA_BITS (42) -#else -#define VA_BITS (39) -#endif +#define VA_BITS (CONFIG_ARM64_VA_BITS)#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1))#define MODULES_END (PAGE_OFFSET)#define MODULES_VADDR (MODULES_END - SZ_64M)
Signature · 1 line
1.7.10.4
Catalin Marinas
maintainerarch/arm64/Kconfig config ARM64_3_LEVELS · line 195
Quoted 7 lines · Jungseok Lee
arch/arm64/Kconfig +7
-0+config ARM64_VA_BITS + int "Virtual address space size" + range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS + range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS + help + This feature is determined by a combination of page size and + level of translation tables.
OK, so you are doing the VA bits selection already. But see my other email about setting only exposing this and hiding the number of levels (though number of levels can be mentioned in the help).
Signature · 1 line
Catalin
Quoted 12 lines · Catalin Marinas
arch/arm64/Kconfig config ARM64_3_LEVELS · line 195
Quoted 7 lines · Jungseok Lee
arch/arm64/Kconfig +7
-0+config ARM64_VA_BITS + int "Virtual address space size" + range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS + range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS + help + This feature is determined by a combination of page size and + level of translation tables.OK, so you are doing the VA bits selection already. But see my other email about setting only exposing this and hiding the number of levels (though number of levels can be mentioned in the help).
Okay. I will hide the number of levels.
Best Regards
Jungseok Lee