diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-12-17 08:48:27 -0800 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-12-17 08:48:27 -0800 |
commit | d3d3a134d75d28034b950bc0b6682ba0be976f37 (patch) | |
tree | 71365703ae44c980a80f9b2c02d664cbc3ddd935 /arch/x86/kernel/entry_64.S | |
parent | a143f427f3e7c6d80bc1d288334706a1f8237f5f (diff) | |
parent | 8b20b3796da06d8ada347c4eaf289c3127da155f (diff) |
Merge branch 'v4.1/topic/rt' into linux-linaro-lsk-v4.1-rt
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 8a3445bdf6a7..db2a15c91a65 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1411,7 +1411,18 @@ END(error_exit) /* Runs on exception stack */ ENTRY(nmi) INTR_FRAME + /* + * 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. @@ -1463,9 +1474,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(kernel_stack), %rsp |