From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andi Kleen <andi@firstfloor.org>
Subject: [RFC][PATCH 2/5 v2] x86: Document the NMI handler about not using paranoid_exit
Date: Tue, 13 Dec 2011 21:52:39 -0500 [thread overview]
Message-ID: <20111214025251.679787228@goodmis.org> (raw)
In-Reply-To: <20111214025237.457632996@goodmis.org>
[-- Attachment #1: 0002-x86-Document-the-NMI-handler-about-not-using-paranoi.patch --]
[-- Type: text/plain, Size: 1295 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Linus cleaned up the NMI handler but it still needs some comments to
explain why it uses save_paranoid but not paranoid_exit. Just to keep
others from adding that in the future, document why it's not used.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/x86/kernel/entry_64.S | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 3819ea9..d1d5434 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1480,9 +1480,16 @@ END(error_exit)
ENTRY(nmi)
INTR_FRAME
PARAVIRT_ADJUST_EXCEPTION_FRAME
- pushq_cfi $-1
+ pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
subq $ORIG_RAX-R15, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
+ /*
+ * Use save_paranoid to handle SWAPGS, but no need to use paranoid_exit
+ * as we should not be calling schedule in NMI context.
+ * Even with normal interrupts enabled. An NMI should not be
+ * setting NEED_RESCHED or anything that normal interrupts and
+ * exceptions might do.
+ */
call save_paranoid
DEFAULT_FRAME 0
/* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
--
1.7.7.3
next prev parent reply other threads:[~2011-12-14 2:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 2:52 [RFC][PATCH 0/5 v2] x86: Find a way to allow breakpoints in NMIs Steven Rostedt
2011-12-14 2:52 ` [RFC][PATCH 1/5 v2] x86: Do not schedule while still in NMI context Steven Rostedt
2011-12-14 2:52 ` Steven Rostedt [this message]
2011-12-14 2:52 ` [RFC][PATCH 3/5 v2] x86: Add workaround to NMI iret woes Steven Rostedt
2011-12-14 2:52 ` [RFC][PATCH 4/5 v2] x86: Keep current stack in NMI breakpoints Steven Rostedt
2011-12-14 13:43 ` Mathieu Desnoyers
2011-12-14 16:19 ` Steven Rostedt
2011-12-15 19:15 ` Steven Rostedt
2012-01-08 8:59 ` [tip:perf/core] x86: Add counter when debug stack is used with interrupts enabled tip-bot for Steven Rostedt
2011-12-14 2:52 ` [RFC][PATCH 5/5 v2] x86: Allow NMIs to hit breakpoints in i386 Steven Rostedt
2011-12-14 13:30 ` Mathieu Desnoyers
2011-12-14 13:40 ` Steven Rostedt
2011-12-14 13:44 ` Mathieu Desnoyers
2011-12-14 18:26 ` H. Peter Anvin
2011-12-14 19:33 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111214025251.679787228@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome