lkml.org 
[lkml]   [2022]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/7] x86: Always inline on_thread_stack() and current_top_of_stack()
On Thu, May 26, 2022 at 12:52PM +0200, Peter Zijlstra wrote:
> Becaues GCC clearly lost it's marbles again...
>

This must have been with some of the big sanitizers though, right?

> vmlinux.o: warning: objtool: enter_from_user_mode+0x4e: call to on_thread_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x53: call to on_thread_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x4e: call to on_thread_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x4e: call to on_thread_stack() leaves .noinstr.text section
>
> vmlinux.o: warning: objtool: enter_from_user_mode+0x4e: call to current_top_of_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x53: call to current_top_of_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x4e: call to current_top_of_stack() leaves .noinstr.text section
> vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x4e: call to current_top_of_stack() leaves .noinstr.text section
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Acked-by: Marco Elver <elver@google.com>

> ---
> arch/x86/include/asm/processor.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -559,7 +559,7 @@ static __always_inline void native_swapg
> #endif
> }
>
> -static inline unsigned long current_top_of_stack(void)
> +static __always_inline unsigned long current_top_of_stack(void)
> {
> /*
> * We can't read directly from tss.sp0: sp0 on x86_32 is special in
> @@ -569,7 +569,7 @@ static inline unsigned long current_top_
> return this_cpu_read_stable(cpu_current_top_of_stack);
> }
>
> -static inline bool on_thread_stack(void)
> +static __always_inline bool on_thread_stack(void)
> {
> return (unsigned long)(current_top_of_stack() -
> current_stack_pointer) < THREAD_SIZE;
>
>

\
 
 \ /
  Last update: 2022-05-30 15:22    [W:0.098 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site