summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-01-03 15:20:04 +0100
committerBen Hutchings <ben@decadent.org.uk>2018-01-09 00:35:20 +0000
commit8eb0a71f15bd4e5b798c3fbe2f9932a69318a437 (patch)
tree40b53636a396ad8f820c1c8d1ca7a0aa02a8a998
parent6ea3e97f1db2adeb219fcdc451ab6ec85f6eb0ad (diff)
kaiser: x86: Fix NMI handling
On Mon, 4 Dec 2017, Hugh Dickins wrote: > kaiser-3.18.72.tar Hi Hugh, this hunk from 0024-kaiser-merged-update.patch: - SWITCH_KERNEL_CR3_NO_STACK + /* + * percpu variables are mapped with user CR3, so no need + * to switch CR3 here. + */ cld movq %rsp, %rdx movq PER_CPU_VAR(kernel_stack), %rsp is problematic, as the patchset actually never user-maps kernel_stack percpu variable, and therefore crashes on NMIs. The patch below is needed to make NMIs work properly. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--arch/x86/kernel/cpu/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index f5232878632d..274f5a7b27e7 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1180,7 +1180,7 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
-DEFINE_PER_CPU(unsigned long, kernel_stack) =
+DEFINE_PER_CPU_USER_MAPPED(unsigned long, kernel_stack) =
(unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE;
EXPORT_PER_CPU_SYMBOL(kernel_stack);