summaryrefslogtreecommitdiffstats
path: root/arch/x86/entry
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-10-06 10:56:54 +0200
committerIngo Molnar <mingo@kernel.org>2015-10-06 10:56:54 +0200
commit38a413cbc2b2834683b21823d964bc2d2f0abb82 (patch)
tree2c62753bef5068ca9a34f13beee142304d028ec0 /arch/x86/entry
parent55696b1f664e52b3036f21631f9c2247b667f587 (diff)
parent9ffecb10283508260936b96022d4ee43a7798b4c (diff)
downloadop-kernel-dev-38a413cbc2b2834683b21823d964bc2d2f0abb82.zip
op-kernel-dev-38a413cbc2b2834683b21823d964bc2d2f0abb82.tar.gz
Merge tag 'v4.3-rc3' into x86/mm, to pick up fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/entry')
-rw-r--r--arch/x86/entry/entry_64.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index d303318..055a01d 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1128,7 +1128,18 @@ END(error_exit)
/* Runs on exception stack */
ENTRY(nmi)
+ /*
+ * Fix up the exception frame if we're on Xen.
+ * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most
+ * one value to the stack on native, so it may clobber the rdx
+ * scratch slot, but it won't clobber any of the important
+ * slots past it.
+ *
+ * Xen is a different story, because the Xen frame itself overlaps
+ * the "NMI executing" variable.
+ */
PARAVIRT_ADJUST_EXCEPTION_FRAME
+
/*
* We allow breakpoints in NMIs. If a breakpoint occurs, then
* the iretq it performs will take us out of NMI context.
@@ -1179,9 +1190,12 @@ ENTRY(nmi)
* we don't want to enable interrupts, because then we'll end
* up in an awkward situation in which IRQs are on but NMIs
* are off.
+ *
+ * We also must not push anything to the stack before switching
+ * stacks lest we corrupt the "NMI executing" variable.
*/
- SWAPGS
+ SWAPGS_UNSAFE_STACK
cld
movq %rsp, %rdx
movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
OpenPOWER on IntegriCloud