Skip to contentSkip to conversation

arm64: fix build for MAX_USER_VA_BITS

PATCH In review Qian Cai 2 participants 2 messages Dec 24, 2018 – Dec 28, 2018

Subsystems (2)
lore
Share & tools
lore

Qian Cai

author
#0 lore raw

PATCH 1/1 arm64: fix build for MAX_USER_VA_BITS

Some code in 9b31cf493ff was lost during merging into the -mmotm tree for some reasons,

In file included from ./arch/arm64/include/asm/processor.h:46,

                 from ./include/linux/rcupdate.h:43,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/pid.h:5,
                 from ./include/linux/sched.h:14,
		 from arch/arm64/kernel/asm-offsets.c:22:
./arch/arm64/include/asm/pgtable-hwdef.h:83:30: error:
'MAX_USER_VA_BITS' undeclared here (not in a function); did you mean
'MAX_USER_PRIO'?
 #define PTRS_PER_PGD  (1 << (MAX_USER_VA_BITS - PGDIR_SHIFT))
                              ^~~~~~~~~~~~~~~~
./arch/arm64/include/asm/pgtable.h:442:26: note: in expansion of macro
'PTRS_PER_PGD'
 extern pgd_t init_pg_dir[PTRS_PER_PGD];
                          ^~~~~~~~~~~~
---
 arch/arm64/include/asm/memory.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/include/asm/memory.h +6 -0
index 1df0bb19117f..e1ec947e7c0c 100644
@@ -67,6 +67,12 @@
 #define KERNEL_START      _text
 #define KERNEL_END        _end
 
+#ifdef CONFIG_ARM64_USER_VA_BITS_52
+#define MAX_USER_VA_BITS	52
+#else
+#define MAX_USER_VA_BITS	VA_BITS
+#endif
+
 /*
  * Generic and tag-based KASAN require 1/8th and 1/16th of the kernel virtual
  * address space for the shadow region respectively. They can bloat the stack
Signature · 1 line
2.17.2 (Apple Git-113)
maintainer
#1 lore raw
Quoted 25 lines · On Mon, 24 Dec 2018 16:03:12 -0500 Qian Cai <[email protected]> wrote:

Some code in 9b31cf493ff was lost during merging into the -mmotm tree for some reasons,

In file included from ./arch/arm64/include/asm/processor.h:46,

                 from ./include/linux/rcupdate.h:43,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/pid.h:5,
                 from ./include/linux/sched.h:14,
		 from arch/arm64/kernel/asm-offsets.c:22:
./arch/arm64/include/asm/pgtable-hwdef.h:83:30: error:
'MAX_USER_VA_BITS' undeclared here (not in a function); did you mean
'MAX_USER_PRIO'?
 #define PTRS_PER_PGD  (1 << (MAX_USER_VA_BITS - PGDIR_SHIFT))
                              ^~~~~~~~~~~~~~~~

./arch/arm64/include/asm/pgtable.h:442:26: note: in expansion of macro 'PTRS_PER_PGD'
extern pgd_t init_pg_dir[PTRS_PER_PGD];

...

arch/arm64/include/asm/memory.h +0 -0
@@ -67,6 +67,12 @@
 #define KERNEL_START      _text
 #define KERNEL_END        _end

arch/arm64/include/asm/memory.h line 78

Quoted 10 lines
arch/arm64/include/asm/memory.h +6 -0
 
+#ifdef CONFIG_ARM64_USER_VA_BITS_52
+#define MAX_USER_VA_BITS	52
+#else
+#define MAX_USER_VA_BITS	VA_BITS
+#endif
+
 /*
  * Generic and tag-based KASAN require 1/8th and 1/16th of the kernel virtual
  * address space for the shadow region respectively. They can bloat the stack

hm, that was presumably me getting lost in a maze of rejects. It seems OK now.