diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-07-15 13:29:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-07-17 06:50:13 -0400 |
commit | 36f1a77b3aa57c5c2eb1ae2d67d07c4350a78345 (patch) | |
tree | d948951c13d43bfd632922c8c17ca56add40431d | |
parent | 23a781e987f05029c4a99a5c145be3efa6eda9f3 (diff) |
x86/nmi/64: Make the "NMI executing" variable more consistent
Currently, "NMI executing" is one the first time an outermost
NMI hits repeat_nmi and zero thereafter. Change it to be zero
each time for consistency.
This is intended to help NMI handling fail harder if it's buggy.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/entry/entry_64.S | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 0fb52526e452..5422bd20bdf4 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S | |||
@@ -1441,8 +1441,8 @@ first_nmi: | |||
1441 | /* Restore rdx. */ | 1441 | /* Restore rdx. */ |
1442 | movq (%rsp), %rdx | 1442 | movq (%rsp), %rdx |
1443 | 1443 | ||
1444 | /* Set "NMI executing" on the stack. */ | 1444 | /* Make room for "NMI executing". */ |
1445 | pushq $1 | 1445 | pushq $0 |
1446 | 1446 | ||
1447 | /* Leave room for the "iret" frame */ | 1447 | /* Leave room for the "iret" frame */ |
1448 | subq $(5*8), %rsp | 1448 | subq $(5*8), %rsp |
@@ -1467,11 +1467,10 @@ repeat_nmi: | |||
1467 | * RSP is pointing to "outermost RIP". gsbase is unknown, but, if | 1467 | * RSP is pointing to "outermost RIP". gsbase is unknown, but, if |
1468 | * we're repeating an NMI, gsbase has the same value that it had on | 1468 | * we're repeating an NMI, gsbase has the same value that it had on |
1469 | * the first iteration. paranoid_entry will load the kernel | 1469 | * the first iteration. paranoid_entry will load the kernel |
1470 | * gsbase if needed before we call do_nmi. | 1470 | * gsbase if needed before we call do_nmi. "NMI executing" |
1471 | * | 1471 | * is zero. |
1472 | * Set "NMI executing" in case we came back here via IRET. | ||
1473 | */ | 1472 | */ |
1474 | movq $1, 10*8(%rsp) | 1473 | movq $1, 10*8(%rsp) /* Set "NMI executing". */ |
1475 | 1474 | ||
1476 | /* | 1475 | /* |
1477 | * Copy the "outermost" frame to the "iret" frame. NMIs that nest | 1476 | * Copy the "outermost" frame to the "iret" frame. NMIs that nest |