Re: [RFC PATCH 05/20] context_tracking: Always inline the empty stubs called from noinstr code

From: Peter Zijlstra

Date: Wed Oct 28 2026 - 09:57:19 EST


On Wed, Oct 28, 2026 at 07:59:29AM -0400, Sasha Levin wrote:
> The !CONFIG_CONTEXT_TRACKING_USER versions of user_enter_irqoff() and
> user_exit_irqoff(), and the !CONFIG_CONTEXT_TRACKING_IDLE versions of
> ct_idle_enter() and ct_idle_exit(), are plain static inline functions,
> while their real counterparts are __always_inline (user_*_irqoff()) or
> noinstr (ct_idle_*()) functions. They are called from noinstr code, so
> when they aren't inlined that's a call leaving the noinstr section. This
> happens with code coverage instrumentation, which makes the compiler
> refuse to inline an instrumented function into a noinstr one:
>
> vmlinux.o: warning: objtool: do_syscall_64+0x81: call to user_exit_irqoff() leaves .noinstr.text section
>
> Make the stubs __always_inline as well.

Ah yes, nothing beats adding instrumentation to empty functions :-)