Re: [RFC PATCH 9/9] arm64/debug: Mark debug exception helpers __always_inline

From: Nick Desaulniers

Date: Mon Jul 27 2026 - 15:26:24 EST


On Mon, Jul 27, 2026 at 5:25 AM Hongyan Xia <hongyan.xia@xxxxxxxxxxxxx> wrote:
>
> From: Hongyan Xia <hongyan.xia@xxxxxxxxxxxxx>
>
> Static inline should be enough to actually inline functions for most
> compilers, but my Clang-19 somehow thinks it's better to outline them.
> These tiny helpers then live in normal .text sections instead of
> .noinstr sections, violating noinstr.

Anything special about your build or config? For example, we've seen
a recent influx of bugs around AutoFDO not inlining functions (despite
constant propagating initdata constants into them) leading to modpost
errors.

Can you perhaps share your config so that someone else could repro and
take a look?

Happy to follow up in our issue tracker, too.
https://github.com/ClangBuiltLinux/linux/issues

>
> Mark them __always_inline so the compiler can never outline them.
>
> Signed-off-by: Hongyan Xia <hongyan.xia@xxxxxxxxxxxxx>
> ---
> arch/arm64/include/asm/esr.h | 2 +-
> arch/arm64/include/asm/percpu.h | 2 +-
> arch/arm64/include/asm/preempt.h | 4 ++--
> arch/arm64/include/asm/ptrace.h | 4 ++--
> arch/arm64/kernel/debug-monitors.c | 2 +-
> include/linux/kprobes.h | 8 ++++----

It might not be appropriate for the changes to kprobes.h to go through
the arm64 tree, but maybe it is?

--
Thanks,
~Nick Desaulniers