lkml.org 
[lkml]   [2020]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmotm 2020-05-13-20-30 uploaded (objtool warnings)
On Fri, May 29, 2020 at 11:05:14AM -0500, Josh Poimboeuf wrote:

> It looks to me like GCC is doing the right thing. That likely()
> translates to:
>
> # define likely(x) (__branch_check__(x, 1, __builtin_constant_p(x)))
>
> which becomes:
>
> #define __branch_check__(x, expect, is_constant) ({ \
> long ______r; \
> static struct ftrace_likely_data \
> __aligned(4) \
> __section(_ftrace_annotated_branch) \
> ______f = { \
> .data.func = __func__, \
> .data.file = __FILE__, \
> .data.line = __LINE__, \
> }; \
> ______r = __builtin_expect(!!(x), expect); \
> ftrace_likely_update(&______f, ______r, \
> expect, is_constant); \
> ______r; \
> })
>
> Here 'x' is the call to user_access_begin(). It evaluates 'x' -- and
> thus calls user_access_begin() -- before the call to
> ftrace_likely_update().
>
> So it's working as designed, right? The likely() just needs to be
> changed to likely_notrace().

But if !x (ie we fail user_access_begin()), we should not pass STAC() on
the way to out_err. OTOH if x, we should not be jumping to out_err.

I'm most confused... must not stare at asm for a while.

\
 
 \ /
  Last update: 2020-05-29 18:18    [W:0.056 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site