Re: [patch part-II V2 06/13] x86/entry/common: Mark syscall entry points notrace and NOKPROBE

From: Frederic Weisbecker
Date: Fri Mar 13 2020 - 11:12:18 EST


On Sun, Mar 08, 2020 at 11:24:05PM +0100, Thomas Gleixner wrote:
> The entry code has some limitations for instrumentation. Anything before
> invoking enter_from_user_mode() cannot be probed because kprobes depend on
> RCU and with NOHZ_FULL user mode can be accounted similar to idle from a
> RCU point of view. enter_from_user_mode() calls into context tracking which
> adjusts the RCU state.
>
> A similar problem exists vs. function tracing. The function entry/exit
> points can be used by BPF which again is not safe before CONTEXT_KERNEL has
> been reached.
>
> Mark the C-entry points for the various syscalls with notrace and
> NOKPROBE_SYMBOL().
>
> Note, that this still leaves the ASM invocations of trace_hardirqs_off()
> unprotected. While this is safe vs. RCU at least from the ftrace POV, these
> are trace points which can be utilized by BPF... This will be addressed in
> later patches.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Reviewed-by: Alexandre Chartre <alexandre.chartre@xxxxxxxxxx>
> ---
> V2: Amend changelog

Thanks for the detailed explanations!

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>