linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: Add config to limit user space to 47bits
@ 2016-07-13 15:42 Alexander Graf
  2016-07-13 15:59 ` Ard Biesheuvel
  2016-07-13 16:10 ` Mark Rutland
  0 siblings, 2 replies; 12+ messages in thread
From: Alexander Graf @ 2016-07-13 15:42 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Mark Rutland, mbrugger

Some user space applications are known to break with 48 bits virtual
address space. As interim step until the world is healed and everyone
embraces correct code, this patch allows to only expose 47 bits of
virtual address space to user space.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/arm64/Kconfig              | 9 +++++++++
 arch/arm64/include/asm/memory.h | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5a0a691..9ff5a74 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -538,6 +538,15 @@ config ARM64_VA_BITS
 	default 47 if ARM64_VA_BITS_47
 	default 48 if ARM64_VA_BITS_48
 
+config ARM64_USER_VA_BITS_47
+	bool "Limit user space to 47 bits address space"
+	depends on ARM64_VA_BITS_48
+	help
+	  Some user space applications are known to break with 48 bits virtual
+	  address space. As interim step until the world is healed and everyone
+	  embraces correct code, this option allows to only expose 47 bits of
+	  virtual address space to user space. If unsure say N here.
+
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
        help
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index 31b7322..ef268c6 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -74,7 +74,11 @@
 #define PCI_IO_END		(VMEMMAP_START - SZ_2M)
 #define PCI_IO_START		(PCI_IO_END - PCI_IO_SIZE)
 #define FIXADDR_TOP		(PCI_IO_START - SZ_2M)
+#ifdef CONFIG_ARM64_USER_VA_BITS_47
+#define TASK_SIZE_64		(UL(1) << (VA_BITS - 1))
+#else
 #define TASK_SIZE_64		(UL(1) << VA_BITS)
+#endif
 
 #ifdef CONFIG_COMPAT
 #define TASK_SIZE_32		UL(0x100000000)
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-14 18:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 15:42 [PATCH] arm64: Add config to limit user space to 47bits Alexander Graf
2016-07-13 15:59 ` Ard Biesheuvel
2016-07-13 16:14   ` Alexander Graf
2016-07-14  1:08     ` Steve Capper
2016-07-14  6:38       ` Alexander Graf
2016-07-14  7:03         ` Zheng Xu
2016-07-14  7:14           ` Alexander Graf
2016-07-14  7:49             ` Zheng Xu
2016-07-14  8:01               ` Alexander Graf
2016-07-14 18:07             ` Jeremy Linton
2016-07-14 15:17     ` Ard Biesheuvel
2016-07-13 16:10 ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).