Re: Instrumentation and RCU

From: Peter Zijlstra
Date: Thu Mar 12 2020 - 09:53:59 EST


On Tue, Mar 10, 2020 at 12:43:27PM +0100, Thomas Gleixner wrote:
> That's why we want the sections and the annotation. If something calls
> out of a noinstr section into a regular text section and the call is not
> annotated at the call site, then objtool can complain and tell you. What
> Peter and I came up with looks like this:
>
> noinstr foo()
> do_protected(); <- Safe because in the noinstr section
>
> instr_begin(); <- Marks the begin of a safe region, ignored
> by objtool
>
> do_stuff(); <- All good
>
> instr_end(); <- End of the safe region. objtool starts
> looking again
>
> do_other_stuff(); <- Unsafe because do_other_stuff() is
> not protected
> and:
>
> noinstr do_protected()
> bar(); <- objtool will complain here
>
> See?

Find here:

https://lkml.kernel.org/r/20200312134107.700205216@xxxxxxxxxxxxx