> powerpc: Mark helpers called from noinstr code notrace
TL;DR:
- Nit: modified declarations still use __inline__ instead of inline, as
requested on v3
- Question: is notrace on unused poll_pending() needed, since it still hits
hcall tracepoints?
> diff --git a/arch/powerpc/include/asm/atomic.h
> b/arch/powerpc/include/asm/atomic.h
> index d1ea554c33ed..60af4f955d99 100644
> --- a/arch/powerpc/include/asm/atomic.h
> +++ b/arch/powerpc/include/asm/atomic.h
> @@ -24,7 +24,7 @@
> #define __atomic_release_fence() \
> __asm__ __volatile__(PPC_RELEASE_BARRIER "" : : : "memory")
>
> -static __inline__ int arch_atomic_read(const atomic_t *v)
> +static __inline__ notrace int arch_atomic_read(const atomic_t *v)
> {
> int t;
>
Christophe Leroy pointed out on v3 that include/linux/compiler_types.h says
"New kernel code should only use the inline spelling", and asked for
__inline__ to be changed to inline on all the lines this patch modifies.
Could the modified declarations here, such as arch_atomic_read() and
arch_atomic_set(), switch from __inline__ to inline?
[ ... ]
> diff --git a/arch/powerpc/include/asm/plpar_wrappers.h
> b/arch/powerpc/include/asm/plpar_wrappers.h
> index f2b6cc4341bb..dd45f632272d 100644
> --- a/arch/powerpc/include/asm/plpar_wrappers.h
> +++ b/arch/powerpc/include/asm/plpar_wrappers.h
> @@ -13,12 +13,12 @@
> #include <asm/lppaca.h>
> #include <asm/page.h>
>
> -static inline long poll_pending(void)
> +static inline notrace long poll_pending(void)
> {
> return plpar_hcall_norets(H_POLL_PENDING);
> }
This isn't a bug, but is the notrace on poll_pending() needed? It has no
callers in the tree, and the plpar_hcall_norets() it calls still goes
through the hcall tracepoints.
By contrast, cede_processor() just below uses plpar_hcall_norets_notrace()
because tracepoints cannot run inside RCU idle regions, so notrace on
poll_pending() may suggest it is safe to call from such regions.
[ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46748297297