diff mbox series

[4/4] MIPS: support 47-bit userland VM space

Message ID 20190224071355.14488-5-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
The infrastructure is now ready, so just add the necessary Kconfig
logic. The equivalent logic has been tested on Loongson 3A2000 and
3A3000 for more than 2 years, no breakage so far.

Signed-off-by: Wang Xuerui <wangxuerui@qiniu.com>
Tested-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 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a1ab9e7924a0..104de85ef6ed 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2171,6 +2171,31 @@  config MIPS_VA_BITS_DEFAULT
 
 	  If unsure, say Y.
 
+config MIPS_VA_BITS_47
+	bool "47 bits virtual memory"
+	depends on 64BIT
+	select MIPS_LARGE_VA
+	help
+	  This is a temporary option to support 47 bits of application virtual
+	  memory, as is the case with x86_64.
+
+	  Some applications and libraries assume the userland address space is
+	  47-bit or less, due to the prevalence of x86_64 platforms where this
+	  restriction is present.  Hence, turning on 48-bit userland addresses
+	  may cause these applications to stop working.  For example,
+	  SpiderMonkey re-uses the higher 17 bits of pointers as tags, which
+	  breaks GJS and thus whole GNOME if 48-bit is enabled.  This option
+	  retains compatibility with those (broken for now) apps, while
+	  providing larger address space to userland.
+
+	  However, the option is only here as a stop-gap measure; the
+	  applications should be fixed to not depend on unused bits in
+	  pointers, as those bits will eventually become unavailable.  Also
+	  note that the caveats of 48-bit virtual memory also apply, because
+	  the implementation is shared.
+
+	  If unsure, say N.
+
 config MIPS_VA_BITS_48
 	bool "48 bits virtual memory"
 	depends on 64BIT
@@ -2193,6 +2218,7 @@  config MIPS_LARGE_VA
 
 config MIPS_VA_BITS
 	int
+	default 47 if MIPS_VA_BITS_47
 	default 48 if MIPS_VA_BITS_48
 	default 40