Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pseries: Always inline functions called from cpuidle

Code in the idle path is not allowed to be instrumented because RCU is
disabled, see commit 0e985e9d2286 ("cpuidle: Add comments about
noinstr/__cpuidle usage").

Force inlining of the inline functions called from cpuidle, to ensure
they are not emitted out-of-line and then available for tracing.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230406144535.3786008-4-mpe@ellerman.id.au

+6 -6
+6 -6
arch/powerpc/include/asm/idle.h
··· 9 9 DECLARE_PER_CPU(u64, idle_entry_purr_snap); 10 10 DECLARE_PER_CPU(u64, idle_entry_spurr_snap); 11 11 12 - static inline void snapshot_purr_idle_entry(void) 12 + static __always_inline void snapshot_purr_idle_entry(void) 13 13 { 14 14 *this_cpu_ptr(&idle_entry_purr_snap) = mfspr(SPRN_PURR); 15 15 } 16 16 17 - static inline void snapshot_spurr_idle_entry(void) 17 + static __always_inline void snapshot_spurr_idle_entry(void) 18 18 { 19 19 *this_cpu_ptr(&idle_entry_spurr_snap) = mfspr(SPRN_SPURR); 20 20 } 21 21 22 - static inline void update_idle_purr_accounting(void) 22 + static __always_inline void update_idle_purr_accounting(void) 23 23 { 24 24 u64 wait_cycles; 25 25 u64 in_purr = *this_cpu_ptr(&idle_entry_purr_snap); ··· 29 29 get_lppaca()->wait_state_cycles = cpu_to_be64(wait_cycles); 30 30 } 31 31 32 - static inline void update_idle_spurr_accounting(void) 32 + static __always_inline void update_idle_spurr_accounting(void) 33 33 { 34 34 u64 *idle_spurr_cycles_ptr = this_cpu_ptr(&idle_spurr_cycles); 35 35 u64 in_spurr = *this_cpu_ptr(&idle_entry_spurr_snap); ··· 37 37 *idle_spurr_cycles_ptr += mfspr(SPRN_SPURR) - in_spurr; 38 38 } 39 39 40 - static inline void pseries_idle_prolog(void) 40 + static __always_inline void pseries_idle_prolog(void) 41 41 { 42 42 ppc64_runlatch_off(); 43 43 snapshot_purr_idle_entry(); ··· 49 49 get_lppaca()->idle = 1; 50 50 } 51 51 52 - static inline void pseries_idle_epilog(void) 52 + static __always_inline void pseries_idle_epilog(void) 53 53 { 54 54 update_idle_purr_accounting(); 55 55 update_idle_spurr_accounting();