[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200320180034.003248957@linutronix.de>
Date: Fri, 20 Mar 2020 19:00:12 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: x86@...nel.org, Paul McKenney <paulmck@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Brian Gerst <brgerst@...il.com>,
Juergen Gross <jgross@...e.com>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Peter Zijlstra <peterz@...radead.org>,
Tom Lendacky <thomas.lendacky@....com>,
Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org
Subject: [RESEND][patch V3 16/23] x86/entry/64: Mark
___preempt_schedule_notrace() thunk noinstr
Code calling this from noinstr sections, e.g. entry code, has interrupts
disabled, so the actual call into the scheduler code does not happen.
The objtool section check complains nevertheless, so mark the call "safe".
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
arch/x86/entry/thunk_64.S | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -49,7 +49,22 @@ SYM_FUNC_START_NOALIGN(\name)
movq 8(%rbp), %rdi
.endif
+ .if \check_if
+1:
+ .pushsection .discard.instr_begin
+ .long 1b - .
+ .popsection
+
+ call \func
+2:
+ .pushsection .discard.instr_end
+ .long 2b - .
+ .popsection
+
+ .else
call \func
+ .endif
+
jmp .L_restore
SYM_FUNC_END(\name)
_ASM_NOKPROBE(\name)
@@ -68,13 +83,16 @@ SYM_FUNC_END(\name)
THUNK ___preempt_schedule, preempt_schedule
EXPORT_SYMBOL(___preempt_schedule)
+.pushsection .noinstr.text, "ax"
THUNK ___preempt_schedule_notrace, preempt_schedule_notrace, check_if=1
+.popsection
EXPORT_SYMBOL(___preempt_schedule_notrace)
#endif
#if defined(CONFIG_TRACE_IRQFLAGS) \
|| defined(CONFIG_DEBUG_LOCK_ALLOC) \
|| defined(CONFIG_PREEMPTION)
+.section .noinstr.text, "ax"
SYM_CODE_START_LOCAL_NOALIGN(.L_restore)
popq %r11
popq %r10
Powered by blists - more mailing lists