lkml.org 
[lkml]   [2020]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[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@linutronix.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
\
 
 \ /
  Last update: 2020-03-20 19:39    [W:0.252 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site