Commit b6be1bb7 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32: Set user/kernel boundary at TASK_SIZE instead of PAGE_OFFSET

User space stops at TASK_SIZE. At the moment, kernel space starts
at PAGE_OFFSET.

In order to use space between TASK_SIZE and PAGE_OFFSET for modules,
make TASK_SIZE the limit between user and kernel space.

Note that fault.c already considers TASK_SIZE as the boundary between
user and kernel space.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b38b52cd8dabbb56fbd6f9219d6f3cdccbb43b44.1593428200.git.christophe.leroy@csgroup.eu
parent c4964331
...@@ -255,8 +255,10 @@ static inline bool pfn_valid(unsigned long pfn) ...@@ -255,8 +255,10 @@ static inline bool pfn_valid(unsigned long pfn)
*/ */
#ifdef CONFIG_PPC_BOOK3E_64 #ifdef CONFIG_PPC_BOOK3E_64
#define is_kernel_addr(x) ((x) >= 0x8000000000000000ul) #define is_kernel_addr(x) ((x) >= 0x8000000000000000ul)
#else #elif defined(CONFIG_PPC_BOOK3S_64)
#define is_kernel_addr(x) ((x) >= PAGE_OFFSET) #define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
#else
#define is_kernel_addr(x) ((x) >= TASK_SIZE)
#endif #endif
#ifndef CONFIG_PPC_BOOK3S_64 #ifndef CONFIG_PPC_BOOK3S_64
......
...@@ -348,7 +348,11 @@ static void populate_markers(void) ...@@ -348,7 +348,11 @@ static void populate_markers(void)
{ {
int i = 0; int i = 0;
#ifdef CONFIG_PPC64
address_markers[i++].start_address = PAGE_OFFSET; address_markers[i++].start_address = PAGE_OFFSET;
#else
address_markers[i++].start_address = TASK_SIZE;
#endif
address_markers[i++].start_address = VMALLOC_START; address_markers[i++].start_address = VMALLOC_START;
address_markers[i++].start_address = VMALLOC_END; address_markers[i++].start_address = VMALLOC_END;
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
...@@ -385,7 +389,7 @@ static int ptdump_show(struct seq_file *m, void *v) ...@@ -385,7 +389,7 @@ static int ptdump_show(struct seq_file *m, void *v)
struct pg_state st = { struct pg_state st = {
.seq = m, .seq = m,
.marker = address_markers, .marker = address_markers,
.start_address = PAGE_OFFSET, .start_address = IS_ENABLED(CONFIG_PPC64) ? PAGE_OFFSET : TASK_SIZE,
}; };
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
...@@ -429,7 +433,7 @@ void ptdump_check_wx(void) ...@@ -429,7 +433,7 @@ void ptdump_check_wx(void)
.seq = NULL, .seq = NULL,
.marker = address_markers, .marker = address_markers,
.check_wx = true, .check_wx = true,
.start_address = PAGE_OFFSET, .start_address = IS_ENABLED(CONFIG_PPC64) ? PAGE_OFFSET : TASK_SIZE,
}; };
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment