[PATCH 2/2] x86/mm/kaiser: Don't map the IRQ stack in user space

From: Josh Poimboeuf
Date: Mon Nov 27 2017 - 23:10:39 EST


The '.data..percpu..first' section, which contains the IRQ software
stack, is included in the percpu user-mapped data area.

The IRQ stack is a software stack which is switched to *after* the CR3
switch, so it doesn't make sense to map it in user space.

Unmap it, and make sure the user-mapped area is page-aligned so it can
be mapped cleanly.

Fixes: 7d1b4c99a605 ("x86/mm/kaiser: Introduce user-mapped per-CPU areas")
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
include/asm-generic/vmlinux.lds.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 386f8846d9e9..45d2fbb081c6 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -826,9 +826,9 @@
*/
#define PERCPU_INPUT(cacheline) \
VMLINUX_SYMBOL(__per_cpu_start) = .; \
- VMLINUX_SYMBOL(__per_cpu_user_mapped_start) = .; \
*(.data..percpu..first) \
- . = ALIGN(cacheline); \
+ . = ALIGN(PAGE_SIZE); \
+ VMLINUX_SYMBOL(__per_cpu_user_mapped_start) = .; \
*(.data..percpu..user_mapped) \
*(.data..percpu..user_mapped..shared_aligned) \
VMLINUX_SYMBOL(__per_cpu_user_mapped_end) = .; \
--
2.13.6