From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Steven Rostedt <rostedt@goodmis.org>,
Brian Gerst <brgerst@gmail.com>, Juergen Gross <jgross@suse.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Arnd Bergmann <arnd@arndb.de>
Subject: [patch 4/8] x86/entry: Move irq tracing on syscall entry to C-code
Date: Tue, 25 Feb 2020 23:08:05 +0100 [thread overview]
Message-ID: <20200225221305.605144982@linutronix.de> (raw)
In-Reply-To: 20200225220801.571835584@linutronix.de
Now that the C entry points are safe, move the irq flags tracing code into
the entry helper.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/entry/common.c | 5 +++++
arch/x86/entry/entry_32.S | 12 ------------
arch/x86/entry/entry_64.S | 2 --
arch/x86/entry/entry_64_compat.S | 18 ------------------
4 files changed, 5 insertions(+), 32 deletions(-)
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -57,6 +57,11 @@ static inline void enter_from_user_mode(
*/
static __always_inline void syscall_entry_fixups(void)
{
+ /*
+ * Usermode is traced as interrupts enabled, but the syscall entry
+ * mechanisms disable interrupts. Tell the tracer.
+ */
+ trace_hardirqs_off();
enter_from_user_mode();
local_irq_enable();
}
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -960,12 +960,6 @@ SYM_FUNC_START(entry_SYSENTER_32)
jnz .Lsysenter_fix_flags
.Lsysenter_flags_fixed:
- /*
- * User mode is traced as though IRQs are on, and SYSENTER
- * turned them off.
- */
- TRACE_IRQS_OFF
-
movl %esp, %eax
call do_fast_syscall_32
/* XEN PV guests always use IRET path */
@@ -1075,12 +1069,6 @@ SYM_FUNC_START(entry_INT80_32)
SAVE_ALL pt_regs_ax=$-ENOSYS switch_stacks=1 /* save rest */
- /*
- * User mode is traced as though IRQs are on, and the interrupt gate
- * turned them off.
- */
- TRACE_IRQS_OFF
-
movl %esp, %eax
call do_int80_syscall_32
.Lsyscall_32_done:
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -167,8 +167,6 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_h
PUSH_AND_CLEAR_REGS rax=$-ENOSYS
- TRACE_IRQS_OFF
-
/* IRQs are off. */
movq %rax, %rdi
movq %rsp, %rsi
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -129,12 +129,6 @@ SYM_FUNC_START(entry_SYSENTER_compat)
jnz .Lsysenter_fix_flags
.Lsysenter_flags_fixed:
- /*
- * User mode is traced as though IRQs are on, and SYSENTER
- * turned them off.
- */
- TRACE_IRQS_OFF
-
movq %rsp, %rdi
call do_fast_syscall_32
/* XEN PV guests always use IRET path */
@@ -247,12 +241,6 @@ SYM_INNER_LABEL(entry_SYSCALL_compat_aft
pushq $0 /* pt_regs->r15 = 0 */
xorl %r15d, %r15d /* nospec r15 */
- /*
- * User mode is traced as though IRQs are on, and SYSENTER
- * turned them off.
- */
- TRACE_IRQS_OFF
-
movq %rsp, %rdi
call do_fast_syscall_32
/* XEN PV guests always use IRET path */
@@ -403,12 +391,6 @@ SYM_CODE_START(entry_INT80_compat)
xorl %r15d, %r15d /* nospec r15 */
cld
- /*
- * User mode is traced as though IRQs are on, and the interrupt
- * gate turned them off.
- */
- TRACE_IRQS_OFF
-
movq %rsp, %rdi
call do_int80_syscall_32
.Lsyscall_32_done:
next prev parent reply other threads:[~2020-02-25 23:30 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 22:08 [patch 0/8] x86/entry: Consolidation - Part II Thomas Gleixner
2020-02-25 22:08 ` [patch 1/8] x86/entry/64: Trace irqflags unconditionally on when returing to user space Thomas Gleixner
2020-02-27 19:49 ` Borislav Petkov
2020-02-27 22:45 ` Frederic Weisbecker
2020-02-28 8:58 ` Alexandre Chartre
2020-02-25 22:08 ` [patch 2/8] x86/entry/common: Consolidate syscall entry code Thomas Gleixner
2020-02-27 19:57 ` Borislav Petkov
2020-02-27 22:52 ` Frederic Weisbecker
2020-02-28 8:59 ` Alexandre Chartre
2020-02-25 22:08 ` [patch 3/8] x86/entry/common: Mark syscall entry points notrace/nokprobe Thomas Gleixner
2020-02-27 23:15 ` Frederic Weisbecker
2020-02-28 8:59 ` Alexandre Chartre
2020-02-25 22:08 ` Thomas Gleixner [this message]
2020-02-26 5:43 ` [patch 4/8] x86/entry: Move irq tracing on syscall entry to C-code Andy Lutomirski
2020-02-26 8:17 ` Peter Zijlstra
2020-02-26 11:20 ` Andy Lutomirski
2020-02-26 19:51 ` Thomas Gleixner
2020-02-29 14:44 ` Thomas Gleixner
2020-02-29 19:25 ` Andy Lutomirski
2020-02-29 23:58 ` Steven Rostedt
2020-03-01 10:16 ` Thomas Gleixner
2020-03-01 14:37 ` Andy Lutomirski
2020-03-01 15:21 ` Thomas Gleixner
2020-03-01 16:00 ` Andy Lutomirski
2020-03-01 18:12 ` Thomas Gleixner
2020-03-01 18:26 ` Paul E. McKenney
2020-03-01 18:54 ` Andy Lutomirski
2020-03-01 19:30 ` Paul E. McKenney
2020-03-01 19:39 ` Andy Lutomirski
2020-03-01 20:18 ` Paul E. McKenney
2020-03-02 0:35 ` Steven Rostedt
2020-03-02 6:47 ` Masami Hiramatsu
2020-03-02 1:10 ` Joel Fernandes
2020-03-02 2:18 ` Andy Lutomirski
2020-03-02 2:36 ` Joel Fernandes
2020-03-02 5:40 ` Andy Lutomirski
2020-03-02 8:10 ` Thomas Gleixner
2020-03-01 18:23 ` Steven Rostedt
2020-03-01 18:20 ` Steven Rostedt
2020-02-27 23:11 ` Frederic Weisbecker
2020-02-28 9:00 ` Alexandre Chartre
2020-02-25 22:08 ` [patch 5/8] x86/entry/common: Provide trace/kprobe safe exit to user space functions Thomas Gleixner
2020-02-26 5:45 ` Andy Lutomirski
2020-02-26 8:15 ` Peter Zijlstra
2020-02-27 15:43 ` Alexandre Chartre
2020-02-27 15:53 ` Thomas Gleixner
2020-02-25 22:08 ` [patch 6/8] x86/entry: Move irq tracing to syscall_slow_exit_work Thomas Gleixner
2020-02-26 5:47 ` Andy Lutomirski
2020-02-27 16:12 ` Alexandre Chartre
2020-02-25 22:08 ` [patch 7/8] x86/entry: Move irq tracing to prepare_exit_to_user_mode() Thomas Gleixner
2020-02-26 5:50 ` Andy Lutomirski
2020-02-26 19:53 ` Thomas Gleixner
2020-02-26 20:07 ` Andy Lutomirski
2020-02-25 22:08 ` [patch 8/8] x86/entry: Move irqflags tracing to do_int80_syscall_32() Thomas Gleixner
2020-02-27 16:46 ` Alexandre Chartre
2020-02-28 13:49 ` Thomas Gleixner
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=20200225221305.605144982@linutronix.de \
--to=tglx@linutronix.de \
--cc=arnd@arndb.de \
--cc=brgerst@gmail.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rostedt@goodmis.org \
--cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).