diff mbox series

[3/4] MIPS: define virtual address size in Kconfig

Message ID 20190224071355.14488-4-wangxuerui@qiniu.com (mailing list archive)
State Changes Requested
Headers show
Series MIPS: support 47-bit userland VM space | expand

Commit Message

Wang Xuerui Feb. 24, 2019, 7:13 a.m. UTC
To ease addition of new VA sizes, punt the constant in processor.h
to Kconfig.

Signed-off-by: Wang Xuerui <wangxuerui@qiniu.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Alex Belits <alex.belits@cavium.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/Kconfig                 | 5 +++++
 arch/mips/include/asm/processor.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b0068a1e1e33..a1ab9e7924a0 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2191,6 +2191,11 @@  endchoice
 config MIPS_LARGE_VA
 	bool
 
+config MIPS_VA_BITS
+	int
+	default 48 if MIPS_VA_BITS_48
+	default 40
+
 choice
 	prompt "Kernel page size"
 	default PAGE_SIZE_4KB
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index 226cf46cc89c..9119e9a44d9c 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -63,7 +63,7 @@  extern unsigned int vced_count, vcei_count;
  */
 #define TASK_SIZE32	0x7fff8000UL
 #ifdef CONFIG_MIPS_LARGE_VA
-#define TASK_SIZE64     (0x1UL << min(cpu_data[0].vmbits, 48))
+#define TASK_SIZE64     (0x1UL << min(cpu_data[0].vmbits, CONFIG_MIPS_VA_BITS))
 #else
 #define TASK_SIZE64     0x10000000000UL
 #endif