Much of the powerpc code that must not be traced uses plain inline
helpers from headers: the atomic, bitops and barrier helpers, the
irqflags and hard irq helpers in <asm/hw_irq.h>, the interrupt entry
and exit helpers in <asm/entry-common.h>, and the MMIO accessors.
noinstr code calls them at points where tracing is not safe, for
example:

 - The context tracking code updates its state with
   arch_atomic_add_return_relaxed() while RCU is not watching.

 - ct_idle_exit(), cpu_idle_poll(), snooze_loop() and the cede loops
   call the irqflags and hard irq helpers, test_thread_local_flags()
   and cede_processor() while RCU is not watching.

 - DEFINE_INTERRUPT_HANDLER() and its variants call
   arch_interrupt_enter_prepare() before irqentry_enter(). On entry
   from user mode, irqentry_enter() calls arch_enter_from_user_mode(),
   which uses regs_is_unrecoverable(), trap_is_syscall(), isync() and
   irq_soft_mask_regs_set_state(), before user_exit_irqoff().

 - get_pseries_errorlog(), which runs in real mode, calls the RTAS
   error log helpers, and xive_teardown_cpu() calls out_8() on a CPU
   that is going offline.

 - soft_nmi_interrupt() calls wd_smp_lock().

With clang, a ppc64le_defconfig build has out-of-line copies of many of
these helpers, called from the functions above. The copies are
untraced only because inline implies notrace.

Mark them notrace explicitly, like the irq_soft_mask_*() helpers in
<asm/hw_irq.h> already are. On x86, arm64 and riscv, the atomic, bitops
and irqflags helpers are __always_inline. No functional change.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <[email protected]>
---
 arch/powerpc/include/asm/atomic.h         | 38 ++++++-------
 arch/powerpc/include/asm/bitops.h         | 29 +++++-----
 arch/powerpc/include/asm/cmpxchg.h        |  2 +-
 arch/powerpc/include/asm/entry-common.h   | 32 +++++------
 arch/powerpc/include/asm/hw_irq.h         | 68 +++++++++++------------
 arch/powerpc/include/asm/interrupt.h      |  2 +-
 arch/powerpc/include/asm/io.h             | 16 +++---
 arch/powerpc/include/asm/plpar_wrappers.h |  4 +-
 arch/powerpc/include/asm/ptrace.h         | 14 ++---
 arch/powerpc/include/asm/rtas.h           | 10 ++--
 arch/powerpc/include/asm/synch.h          |  6 +-
 arch/powerpc/include/asm/thread_info.h    |  4 +-
 arch/powerpc/kernel/watchdog.c            |  4 +-
 13 files changed, 115 insertions(+), 114 deletions(-)

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;
 
@@ -37,7 +37,7 @@ static __inline__ int arch_atomic_read(const atomic_t *v)
        return t;
 }
 
-static __inline__ void arch_atomic_set(atomic_t *v, int i)
+static __inline__ notrace void arch_atomic_set(atomic_t *v, int i)
 {
        /* -mprefixed can generate offsets beyond range, fall back hack */
        if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED))
@@ -47,7 +47,7 @@ static __inline__ void arch_atomic_set(atomic_t *v, int i)
 }
 
 #define ATOMIC_OP(op, asm_op, suffix, sign, ...)                       \
-static __inline__ void arch_atomic_##op(int a, atomic_t *v)            \
+static __inline__ notrace void arch_atomic_##op(int a, atomic_t *v)    \
 {                                                                      \
        int t;                                                          \
                                                                        \
@@ -62,7 +62,7 @@ static __inline__ void arch_atomic_##op(int a, atomic_t *v)   
        \
 }                                                                      \
 
 #define ATOMIC_OP_RETURN_RELAXED(op, asm_op, suffix, sign, ...)                
\
-static inline int arch_atomic_##op##_return_relaxed(int a, atomic_t *v)        
\
+static inline notrace int arch_atomic_##op##_return_relaxed(int a, atomic_t 
*v)        \
 {                                                                      \
        int t;                                                          \
                                                                        \
@@ -79,7 +79,7 @@ static inline int arch_atomic_##op##_return_relaxed(int a, 
atomic_t *v)       \
 }
 
 #define ATOMIC_FETCH_OP_RELAXED(op, asm_op, suffix, sign, ...)         \
-static inline int arch_atomic_fetch_##op##_relaxed(int a, atomic_t *v) \
+static inline notrace int arch_atomic_fetch_##op##_relaxed(int a, atomic_t *v) 
\
 {                                                                      \
        int res, t;                                                     \
                                                                        \
@@ -136,7 +136,7 @@ ATOMIC_OPS(xor, xor, "", K)
  * Atomically adds @a to @v, so long as it was not @u.
  * Returns the old value of @v.
  */
-static __inline__ int arch_atomic_fetch_add_unless(atomic_t *v, int a, int u)
+static __inline__ notrace int arch_atomic_fetch_add_unless(atomic_t *v, int a, 
int u)
 {
        int t;
 
@@ -164,7 +164,7 @@ static __inline__ int arch_atomic_fetch_add_unless(atomic_t 
*v, int a, int u)
  * The function returns the old value of *v minus 1, even if
  * the atomic variable, v, was not decremented.
  */
-static __inline__ int arch_atomic_dec_if_positive(atomic_t *v)
+static __inline__ notrace int arch_atomic_dec_if_positive(atomic_t *v)
 {
        int t;
 
@@ -190,7 +190,7 @@ static __inline__ int arch_atomic_dec_if_positive(atomic_t 
*v)
 
 #define ATOMIC64_INIT(i)       { (i) }
 
-static __inline__ s64 arch_atomic64_read(const atomic64_t *v)
+static __inline__ notrace s64 arch_atomic64_read(const atomic64_t *v)
 {
        s64 t;
 
@@ -203,7 +203,7 @@ static __inline__ s64 arch_atomic64_read(const atomic64_t 
*v)
        return t;
 }
 
-static __inline__ void arch_atomic64_set(atomic64_t *v, s64 i)
+static __inline__ notrace void arch_atomic64_set(atomic64_t *v, s64 i)
 {
        /* -mprefixed can generate offsets beyond range, fall back hack */
        if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED))
@@ -213,7 +213,7 @@ static __inline__ void arch_atomic64_set(atomic64_t *v, s64 
i)
 }
 
 #define ATOMIC64_OP(op, asm_op)                                                
\
-static __inline__ void arch_atomic64_##op(s64 a, atomic64_t *v)                
\
+static __inline__ notrace void arch_atomic64_##op(s64 a, atomic64_t *v)        
\
 {                                                                      \
        s64 t;                                                          \
                                                                        \
@@ -228,7 +228,7 @@ static __inline__ void arch_atomic64_##op(s64 a, atomic64_t 
*v)             \
 }
 
 #define ATOMIC64_OP_RETURN_RELAXED(op, asm_op)                         \
-static inline s64                                                      \
+static inline notrace s64                                              \
 arch_atomic64_##op##_return_relaxed(s64 a, atomic64_t *v)              \
 {                                                                      \
        s64 t;                                                          \
@@ -246,7 +246,7 @@ arch_atomic64_##op##_return_relaxed(s64 a, atomic64_t *v)   
        \
 }
 
 #define ATOMIC64_FETCH_OP_RELAXED(op, asm_op)                          \
-static inline s64                                                      \
+static inline notrace s64                                              \
 arch_atomic64_fetch_##op##_relaxed(s64 a, atomic64_t *v)               \
 {                                                                      \
        s64 res, t;                                                     \
@@ -295,7 +295,7 @@ ATOMIC64_OPS(xor, xor)
 #undef ATOMIC64_OP_RETURN_RELAXED
 #undef ATOMIC64_OP
 
-static __inline__ void arch_atomic64_inc(atomic64_t *v)
+static __inline__ notrace void arch_atomic64_inc(atomic64_t *v)
 {
        s64 t;
 
@@ -310,7 +310,7 @@ static __inline__ void arch_atomic64_inc(atomic64_t *v)
 }
 #define arch_atomic64_inc arch_atomic64_inc
 
-static __inline__ s64 arch_atomic64_inc_return_relaxed(atomic64_t *v)
+static __inline__ notrace s64 arch_atomic64_inc_return_relaxed(atomic64_t *v)
 {
        s64 t;
 
@@ -326,7 +326,7 @@ static __inline__ s64 
arch_atomic64_inc_return_relaxed(atomic64_t *v)
        return t;
 }
 
-static __inline__ void arch_atomic64_dec(atomic64_t *v)
+static __inline__ notrace void arch_atomic64_dec(atomic64_t *v)
 {
        s64 t;
 
@@ -341,7 +341,7 @@ static __inline__ void arch_atomic64_dec(atomic64_t *v)
 }
 #define arch_atomic64_dec arch_atomic64_dec
 
-static __inline__ s64 arch_atomic64_dec_return_relaxed(atomic64_t *v)
+static __inline__ notrace s64 arch_atomic64_dec_return_relaxed(atomic64_t *v)
 {
        s64 t;
 
@@ -364,7 +364,7 @@ static __inline__ s64 
arch_atomic64_dec_return_relaxed(atomic64_t *v)
  * Atomically test *v and decrement if it is greater than 0.
  * The function returns the old value of *v minus 1.
  */
-static __inline__ s64 arch_atomic64_dec_if_positive(atomic64_t *v)
+static __inline__ notrace s64 arch_atomic64_dec_if_positive(atomic64_t *v)
 {
        s64 t;
 
@@ -394,7 +394,7 @@ static __inline__ s64 
arch_atomic64_dec_if_positive(atomic64_t *v)
  * Atomically adds @a to @v, so long as it was not @u.
  * Returns the old value of @v.
  */
-static __inline__ s64 arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 
u)
+static __inline__ notrace s64 arch_atomic64_fetch_add_unless(atomic64_t *v, 
s64 a, s64 u)
 {
        s64 t;
 
@@ -424,7 +424,7 @@ static __inline__ s64 
arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u
  * Atomically increments @v by 1, so long as @v is non-zero.
  * Returns non-zero if @v was non-zero, and zero otherwise.
  */
-static __inline__ int arch_atomic64_inc_not_zero(atomic64_t *v)
+static __inline__ notrace int arch_atomic64_inc_not_zero(atomic64_t *v)
 {
        s64 t1, t2;
 
diff --git a/arch/powerpc/include/asm/bitops.h 
b/arch/powerpc/include/asm/bitops.h
index 0d0470cd5ac3..f2123a148dbb 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -63,7 +63,7 @@
 
 /* Macro for generating the ***_bits() functions */
 #define DEFINE_BITOP(fn, op, prefix)           \
-static inline void fn(unsigned long mask,      \
+static inline notrace void fn(unsigned long mask,      \
                volatile unsigned long *_p)     \
 {                                              \
        unsigned long old;                      \
@@ -94,7 +94,7 @@ static __always_inline bool is_rlwinm_mask_valid(unsigned 
long x)
 }
 
 #define DEFINE_CLROP(fn, prefix)                                       \
-static inline void fn(unsigned long mask, volatile unsigned long *_p)  \
+static inline notrace void fn(unsigned long mask, volatile unsigned long *_p)  
\
 {                                                                      \
        unsigned long old;                                              \
        unsigned long *p = (unsigned long *)_p;                         \
@@ -126,22 +126,22 @@ static inline void fn(unsigned long mask, volatile 
unsigned long *_p)     \
 DEFINE_CLROP(clear_bits, "")
 DEFINE_CLROP(clear_bits_unlock, PPC_RELEASE_BARRIER)
 
-static inline void arch_set_bit(int nr, volatile unsigned long *addr)
+static inline notrace void arch_set_bit(int nr, volatile unsigned long *addr)
 {
        set_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
 }
 
-static inline void arch_clear_bit(int nr, volatile unsigned long *addr)
+static inline notrace void arch_clear_bit(int nr, volatile unsigned long *addr)
 {
        clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
 }
 
-static inline void arch_clear_bit_unlock(int nr, volatile unsigned long *addr)
+static inline notrace void arch_clear_bit_unlock(int nr, volatile unsigned 
long *addr)
 {
        clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr));
 }
 
-static inline void arch_change_bit(int nr, volatile unsigned long *addr)
+static inline notrace void arch_change_bit(int nr, volatile unsigned long 
*addr)
 {
        change_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
 }
@@ -149,7 +149,7 @@ static inline void arch_change_bit(int nr, volatile 
unsigned long *addr)
 /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
  * operands. */
 #define DEFINE_TESTOP(fn, op, prefix, postfix, eh)     \
-static inline unsigned long fn(                        \
+static inline notrace unsigned long fn(                \
                unsigned long mask,                     \
                volatile unsigned long *_p)             \
 {                                                      \
@@ -175,7 +175,8 @@ DEFINE_TESTOP(test_and_set_bits_lock, or, "",
 DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
              PPC_ATOMIC_EXIT_BARRIER, 0)
 
-static inline unsigned long test_and_clear_bits(unsigned long mask, volatile 
unsigned long *_p)
+static inline notrace unsigned long
+test_and_clear_bits(unsigned long mask, volatile unsigned long *_p)
 {
        unsigned long old, t;
        unsigned long *p = (unsigned long *)_p;
@@ -208,32 +209,32 @@ static inline unsigned long test_and_clear_bits(unsigned 
long mask, volatile uns
        return (old & mask);
 }
 
-static inline int arch_test_and_set_bit(unsigned long nr,
+static inline notrace int arch_test_and_set_bit(unsigned long nr,
                                        volatile unsigned long *addr)
 {
        return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
 }
 
-static inline int arch_test_and_set_bit_lock(unsigned long nr,
+static inline notrace int arch_test_and_set_bit_lock(unsigned long nr,
                                             volatile unsigned long *addr)
 {
        return test_and_set_bits_lock(BIT_MASK(nr),
                                addr + BIT_WORD(nr)) != 0;
 }
 
-static inline int arch_test_and_clear_bit(unsigned long nr,
+static inline notrace int arch_test_and_clear_bit(unsigned long nr,
                                          volatile unsigned long *addr)
 {
        return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
 }
 
-static inline int arch_test_and_change_bit(unsigned long nr,
+static inline notrace int arch_test_and_change_bit(unsigned long nr,
                                           volatile unsigned long *addr)
 {
        return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
 }
 
-static inline bool arch_xor_unlock_is_negative_byte(unsigned long mask,
+static inline notrace bool arch_xor_unlock_is_negative_byte(unsigned long mask,
                volatile unsigned long *p)
 {
        unsigned long old, t;
@@ -254,7 +255,7 @@ static inline bool 
arch_xor_unlock_is_negative_byte(unsigned long mask,
 
 #include <asm-generic/bitops/non-atomic.h>
 
-static inline void arch___clear_bit_unlock(int nr, volatile unsigned long 
*addr)
+static inline notrace void arch___clear_bit_unlock(int nr, volatile unsigned 
long *addr)
 {
        __asm__ __volatile__(PPC_RELEASE_BARRIER "" ::: "memory");
        __clear_bit(nr, addr);
diff --git a/arch/powerpc/include/asm/cmpxchg.h 
b/arch/powerpc/include/asm/cmpxchg.h
index dbb50c06f0bf..fe298147f024 100644
--- a/arch/powerpc/include/asm/cmpxchg.h
+++ b/arch/powerpc/include/asm/cmpxchg.h
@@ -14,7 +14,7 @@
 #endif
 
 #define XCHG_GEN(type, sfx, cl)                                \
-static inline u32 __xchg_##type##sfx(volatile void *p, u32 val)        \
+static inline notrace u32 __xchg_##type##sfx(volatile void *p, u32 val)        
\
 {                                                              \
        unsigned int prev, prev_mask, tmp, bitoff, off;         \
                                                                \
diff --git a/arch/powerpc/include/asm/entry-common.h 
b/arch/powerpc/include/asm/entry-common.h
index 8e91489fdf2b..c487636dba78 100644
--- a/arch/powerpc/include/asm/entry-common.h
+++ b/arch/powerpc/include/asm/entry-common.h
@@ -31,7 +31,7 @@ unsigned long search_kernel_restart_table(unsigned long addr);
 
 DECLARE_STATIC_KEY_FALSE(interrupt_exit_not_reentrant);
 
-static inline bool is_implicit_soft_masked(struct pt_regs *regs)
+static inline notrace bool is_implicit_soft_masked(struct pt_regs *regs)
 {
        if (user_mode(regs))
                return false;
@@ -42,28 +42,28 @@ static inline bool is_implicit_soft_masked(struct pt_regs 
*regs)
        return search_kernel_soft_mask_table(regs->nip);
 }
 
-static inline void srr_regs_clobbered(void)
+static inline notrace void srr_regs_clobbered(void)
 {
        local_paca->srr_valid = 0;
        local_paca->hsrr_valid = 0;
 }
 #else
-static inline unsigned long search_kernel_restart_table(unsigned long addr)
+static inline notrace unsigned long search_kernel_restart_table(unsigned long 
addr)
 {
        return 0;
 }
 
-static inline bool is_implicit_soft_masked(struct pt_regs *regs)
+static inline notrace bool is_implicit_soft_masked(struct pt_regs *regs)
 {
        return false;
 }
 
-static inline void srr_regs_clobbered(void)
+static inline notrace void srr_regs_clobbered(void)
 {
 }
 #endif
 
-static inline void nap_adjust_return(struct pt_regs *regs)
+static inline notrace void nap_adjust_return(struct pt_regs *regs)
 {
 #ifdef CONFIG_PPC_970_NAP
        /*
@@ -103,7 +103,7 @@ static __always_inline void booke_load_dbcr0(void)
 #endif
 }
 
-static inline void booke_restore_dbcr0(void)
+static inline notrace void booke_restore_dbcr0(void)
 {
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
        unsigned long dbcr0 = current->thread.debug.dbcr0;
@@ -115,7 +115,7 @@ static inline void booke_restore_dbcr0(void)
 #endif
 }
 
-static inline void check_return_regs_valid(struct pt_regs *regs)
+static inline notrace void check_return_regs_valid(struct pt_regs *regs)
 {
 #ifdef CONFIG_PPC_BOOK3S_64
        unsigned long trap, srr0, srr1;
@@ -195,7 +195,7 @@ static inline void check_return_regs_valid(struct pt_regs 
*regs)
 #endif
 }
 
-static inline void arch_interrupt_enter_prepare(struct pt_regs *regs)
+static inline notrace void arch_interrupt_enter_prepare(struct pt_regs *regs)
 {
 #ifdef CONFIG_PPC64
        irq_soft_mask_set(IRQS_ALL_DISABLED);
@@ -255,7 +255,7 @@ static inline void arch_interrupt_enter_prepare(struct 
pt_regs *regs)
  * However arch_interrupt_nmi_exit_prepare does return directly to regs, 
because
  * NMIs do not do "exit work" or replay soft-masked interrupts.
  */
-static inline void arch_interrupt_exit_prepare(struct pt_regs *regs)
+static inline notrace void arch_interrupt_exit_prepare(struct pt_regs *regs)
 {
        if (user_mode(regs)) {
                BUG_ON(regs_is_unrecoverable(regs));
@@ -271,7 +271,7 @@ static inline void arch_interrupt_exit_prepare(struct 
pt_regs *regs)
        hard_irq_disable();
 }
 
-static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs)
+static inline notrace void arch_interrupt_async_enter_prepare(struct pt_regs 
*regs)
 {
 #ifdef CONFIG_PPC64
        /* Ensure arch_interrupt_enter_prepare does not enable MSR[EE] */
@@ -289,7 +289,7 @@ static inline void 
arch_interrupt_async_enter_prepare(struct pt_regs *regs)
 #endif
 }
 
-static inline void arch_interrupt_async_exit_prepare(struct pt_regs *regs)
+static inline notrace void arch_interrupt_async_exit_prepare(struct pt_regs 
*regs)
 {
        arch_interrupt_exit_prepare(regs);
 }
@@ -303,7 +303,7 @@ struct interrupt_nmi_state {
 #endif
 };
 
-static inline bool nmi_disables_ftrace(struct pt_regs *regs)
+static inline notrace bool nmi_disables_ftrace(struct pt_regs *regs)
 {
        /* Allow DEC and PMI to be traced when they are soft-NMI */
        if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) {
@@ -320,7 +320,7 @@ static inline bool nmi_disables_ftrace(struct pt_regs *regs)
        return true;
 }
 
-static inline void arch_interrupt_nmi_enter_prepare(struct pt_regs *regs,
+static inline notrace void arch_interrupt_nmi_enter_prepare(struct pt_regs 
*regs,
                                                    struct interrupt_nmi_state 
*state)
 {
 #ifdef CONFIG_PPC64
@@ -358,7 +358,7 @@ static inline void arch_interrupt_nmi_enter_prepare(struct 
pt_regs *regs,
 #endif
 }
 
-static inline void arch_interrupt_nmi_exit_prepare(struct pt_regs *regs,
+static inline notrace void arch_interrupt_nmi_exit_prepare(struct pt_regs 
*regs,
                                                   struct interrupt_nmi_state 
*state)
 {
        /*
@@ -480,7 +480,7 @@ static __always_inline void 
arch_enter_from_user_mode(struct pt_regs *regs)
 
 #define arch_enter_from_user_mode arch_enter_from_user_mode
 
-static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
+static inline notrace void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
                                                  unsigned long ti_work)
 {
        unsigned long mathflags;
diff --git a/arch/powerpc/include/asm/hw_irq.h 
b/arch/powerpc/include/asm/hw_irq.h
index ddb850e62abd..3d076f5de73e 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -61,7 +61,7 @@
 
 #ifndef __ASSEMBLER__
 
-static inline void __hard_irq_enable(void)
+static inline notrace void __hard_irq_enable(void)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                wrtee(MSR_EE);
@@ -73,7 +73,7 @@ static inline void __hard_irq_enable(void)
                mtmsr(mfmsr() | MSR_EE);
 }
 
-static inline void __hard_irq_disable(void)
+static inline notrace void __hard_irq_disable(void)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                wrtee(0);
@@ -85,7 +85,7 @@ static inline void __hard_irq_disable(void)
                mtmsr(mfmsr() & ~MSR_EE);
 }
 
-static inline void __hard_EE_RI_disable(void)
+static inline notrace void __hard_EE_RI_disable(void)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                wrtee(0);
@@ -97,7 +97,7 @@ static inline void __hard_EE_RI_disable(void)
                mtmsr(mfmsr() & ~(MSR_EE | MSR_RI));
 }
 
-static inline void __hard_RI_enable(void)
+static inline notrace void __hard_RI_enable(void)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                return;
@@ -184,39 +184,39 @@ static inline notrace unsigned long 
irq_soft_mask_andc_return(unsigned long mask
        return flags;
 }
 
-static inline unsigned long arch_local_save_flags(void)
+static inline notrace unsigned long arch_local_save_flags(void)
 {
        return irq_soft_mask_return();
 }
 
-static inline void arch_local_irq_disable(void)
+static inline notrace void arch_local_irq_disable(void)
 {
        irq_soft_mask_set(IRQS_DISABLED);
 }
 
 extern void arch_local_irq_restore(unsigned long);
 
-static inline void arch_local_irq_enable(void)
+static inline notrace void arch_local_irq_enable(void)
 {
        arch_local_irq_restore(IRQS_ENABLED);
 }
 
-static inline unsigned long arch_local_irq_save(void)
+static inline notrace unsigned long arch_local_irq_save(void)
 {
        return irq_soft_mask_or_return(IRQS_DISABLED);
 }
 
-static inline bool arch_irqs_disabled_flags(unsigned long flags)
+static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
 {
        return flags & IRQS_DISABLED;
 }
 
-static inline bool arch_irqs_disabled(void)
+static inline notrace bool arch_irqs_disabled(void)
 {
        return arch_irqs_disabled_flags(arch_local_save_flags());
 }
 
-static inline void set_pmi_irq_pending(void)
+static inline notrace void set_pmi_irq_pending(void)
 {
        /*
         * Invoked from PMU callback functions to set PMI bit in the paca.
@@ -228,7 +228,7 @@ static inline void set_pmi_irq_pending(void)
        get_paca()->irq_happened |= PACA_IRQ_PMI;
 }
 
-static inline void clear_pmi_irq_pending(void)
+static inline notrace void clear_pmi_irq_pending(void)
 {
        /*
         * Invoked from PMU callback functions to clear the pending PMI bit
@@ -240,7 +240,7 @@ static inline void clear_pmi_irq_pending(void)
        get_paca()->irq_happened &= ~PACA_IRQ_PMI;
 }
 
-static inline bool pmi_irq_pending(void)
+static inline notrace bool pmi_irq_pending(void)
 {
        /*
         * Invoked from PMU callback functions to check if there is a pending
@@ -310,7 +310,7 @@ static inline bool pmi_irq_pending(void)
        }                                                               \
 } while(0)
 
-static inline bool __lazy_irq_pending(u8 irq_happened)
+static inline notrace bool __lazy_irq_pending(u8 irq_happened)
 {
        return !!(irq_happened & ~PACA_IRQ_HARD_DIS);
 }
@@ -318,7 +318,7 @@ static inline bool __lazy_irq_pending(u8 irq_happened)
 /*
  * Check if a lazy IRQ is pending. Should be called with IRQs hard disabled.
  */
-static inline bool lazy_irq_pending(void)
+static inline notrace bool lazy_irq_pending(void)
 {
        return __lazy_irq_pending(get_paca()->irq_happened);
 }
@@ -328,7 +328,7 @@ static inline bool lazy_irq_pending(void)
  * Should be called with IRQs hard disabled.
  * For use in RI disabled code or other constrained situations.
  */
-static inline bool lazy_irq_pending_nocheck(void)
+static inline notrace bool lazy_irq_pending_nocheck(void)
 {
        return __lazy_irq_pending(local_paca->irq_happened);
 }
@@ -342,7 +342,7 @@ bool power_pmu_wants_prompt_pmi(void);
  * is a different soft-masked interrupt pending that requires hard
  * masking.
  */
-static inline bool should_hard_irq_enable(struct pt_regs *regs)
+static inline notrace bool should_hard_irq_enable(struct pt_regs *regs)
 {
        if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) {
                WARN_ON(irq_soft_mask_return() != IRQS_ALL_DISABLED);
@@ -381,7 +381,7 @@ static inline bool should_hard_irq_enable(struct pt_regs 
*regs)
  * Do the hard enabling, only call this if should_hard_irq_enable is true.
  * This allows PMI interrupts to profile irq handlers.
  */
-static inline void do_hard_irq_enable(void)
+static inline notrace void do_hard_irq_enable(void)
 {
        /*
         * Asynch interrupts come in with IRQS_ALL_DISABLED,
@@ -393,7 +393,7 @@ static inline void do_hard_irq_enable(void)
        __hard_irq_enable();
 }
 
-static inline bool regs_irqs_disabled(struct pt_regs *regs)
+static inline notrace bool regs_irqs_disabled(struct pt_regs *regs)
 {
        return (regs->softe & IRQS_DISABLED);
 }
@@ -406,7 +406,7 @@ extern void irq_set_pending_from_srr1(unsigned long srr1);
 
 extern void force_external_irq_replay(void);
 
-static inline void irq_soft_mask_regs_set_state(struct pt_regs *regs, unsigned 
long val)
+static inline notrace void irq_soft_mask_regs_set_state(struct pt_regs *regs, 
unsigned long val)
 {
        regs->softe = val;
 }
@@ -417,12 +417,12 @@ static inline notrace unsigned long 
irq_soft_mask_return(void)
        return 0;
 }
 
-static inline unsigned long arch_local_save_flags(void)
+static inline notrace unsigned long arch_local_save_flags(void)
 {
        return mfmsr();
 }
 
-static inline void arch_local_irq_restore(unsigned long flags)
+static inline notrace void arch_local_irq_restore(unsigned long flags)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                wrtee(flags);
@@ -430,7 +430,7 @@ static inline void arch_local_irq_restore(unsigned long 
flags)
                mtmsr(flags);
 }
 
-static inline unsigned long arch_local_irq_save(void)
+static inline notrace unsigned long arch_local_irq_save(void)
 {
        unsigned long flags = arch_local_save_flags();
 
@@ -444,29 +444,29 @@ static inline unsigned long arch_local_irq_save(void)
        return flags;
 }
 
-static inline void arch_local_irq_disable(void)
+static inline notrace void arch_local_irq_disable(void)
 {
        __hard_irq_disable();
 }
 
-static inline void arch_local_irq_enable(void)
+static inline notrace void arch_local_irq_enable(void)
 {
        __hard_irq_enable();
 }
 
-static inline bool arch_irqs_disabled_flags(unsigned long flags)
+static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
 {
        return (flags & MSR_EE) == 0;
 }
 
-static inline bool arch_irqs_disabled(void)
+static inline notrace bool arch_irqs_disabled(void)
 {
        return arch_irqs_disabled_flags(arch_local_save_flags());
 }
 
 #define hard_irq_disable()             local_irq_disable()
 
-static inline bool regs_irqs_disabled(struct pt_regs *regs)
+static inline notrace bool regs_irqs_disabled(struct pt_regs *regs)
 {
        return !(regs->msr & MSR_EE);
 }
@@ -476,21 +476,21 @@ static __always_inline bool should_hard_irq_enable(struct 
pt_regs *regs)
        return false;
 }
 
-static inline void do_hard_irq_enable(void)
+static inline notrace void do_hard_irq_enable(void)
 {
        BUILD_BUG();
 }
 
-static inline void clear_pmi_irq_pending(void) { }
-static inline void set_pmi_irq_pending(void) { }
-static inline bool pmi_irq_pending(void) { return false; }
+static inline notrace void clear_pmi_irq_pending(void) { }
+static inline notrace void set_pmi_irq_pending(void) { }
+static inline notrace bool pmi_irq_pending(void) { return false; }
 
-static inline void irq_soft_mask_regs_set_state(struct pt_regs *regs, unsigned 
long val)
+static inline notrace void irq_soft_mask_regs_set_state(struct pt_regs *regs, 
unsigned long val)
 {
 }
 #endif /* CONFIG_PPC64 */
 
-static inline unsigned long mtmsr_isync_irqsafe(unsigned long msr)
+static inline notrace unsigned long mtmsr_isync_irqsafe(unsigned long msr)
 {
 #ifdef CONFIG_PPC64
        if (arch_irqs_disabled()) {
diff --git a/arch/powerpc/include/asm/interrupt.h 
b/arch/powerpc/include/asm/interrupt.h
index c7d0e71eac83..f358ea26e57b 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -397,7 +397,7 @@ void __noreturn unrecoverable_exception(struct pt_regs 
*regs);
 void replay_system_reset(void);
 void replay_soft_interrupts(void);
 
-static inline void interrupt_cond_local_irq_enable(struct pt_regs *regs)
+static inline notrace void interrupt_cond_local_irq_enable(struct pt_regs 
*regs)
 {
        if (!regs_irqs_disabled(regs))
                local_irq_enable();
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 7a89754842d6..3295964f7bce 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -91,7 +91,7 @@ extern bool isa_io_special;
 /* -mprefixed can generate offsets beyond range, fall back hack */
 #ifdef CONFIG_PPC_KERNEL_PREFIXED
 #define DEF_MMIO_IN_X(name, size, insn)                                \
-static inline u##size name(const volatile u##size __iomem *addr)       \
+static inline notrace u##size name(const volatile u##size __iomem *addr)       
\
 {                                                                      \
        u##size ret;                                                    \
        __asm__ __volatile__("sync;"#insn" %0,0,%1;twi 0,%0,0;isync"    \
@@ -100,7 +100,7 @@ static inline u##size name(const volatile u##size __iomem 
*addr)    \
 }
 
 #define DEF_MMIO_OUT_X(name, size, insn)                               \
-static inline void name(volatile u##size __iomem *addr, u##size val)   \
+static inline notrace void name(volatile u##size __iomem *addr, u##size val)   
\
 {                                                                      \
        __asm__ __volatile__("sync;"#insn" %1,0,%0"                     \
                : : "r" (addr), "r" (val) : "memory");                  \
@@ -108,7 +108,7 @@ static inline void name(volatile u##size __iomem *addr, 
u##size val)        \
 }
 
 #define DEF_MMIO_IN_D(name, size, insn)                                \
-static inline u##size name(const volatile u##size __iomem *addr)       \
+static inline notrace u##size name(const volatile u##size __iomem *addr)       
\
 {                                                                      \
        u##size ret;                                                    \
        __asm__ __volatile__("sync;"#insn" %0,0(%1);twi 0,%0,0;isync"\
@@ -117,7 +117,7 @@ static inline u##size name(const volatile u##size __iomem 
*addr)    \
 }
 
 #define DEF_MMIO_OUT_D(name, size, insn)                               \
-static inline void name(volatile u##size __iomem *addr, u##size val)   \
+static inline notrace void name(volatile u##size __iomem *addr, u##size val)   
\
 {                                                                      \
        __asm__ __volatile__("sync;"#insn" %1,0(%0)"                    \
                : : "b" (addr), "r" (val) : "memory");  \
@@ -125,7 +125,7 @@ static inline void name(volatile u##size __iomem *addr, 
u##size val)        \
 }
 #else
 #define DEF_MMIO_IN_X(name, size, insn)                                \
-static inline u##size name(const volatile u##size __iomem *addr)       \
+static inline notrace u##size name(const volatile u##size __iomem *addr)       
\
 {                                                                      \
        u##size ret;                                                    \
        __asm__ __volatile__("sync;"#insn" %0,%y1;twi 0,%0,0;isync"     \
@@ -134,7 +134,7 @@ static inline u##size name(const volatile u##size __iomem 
*addr)    \
 }
 
 #define DEF_MMIO_OUT_X(name, size, insn)                               \
-static inline void name(volatile u##size __iomem *addr, u##size val)   \
+static inline notrace void name(volatile u##size __iomem *addr, u##size val)   
\
 {                                                                      \
        __asm__ __volatile__("sync;"#insn" %1,%y0"                      \
                : "=Z" (*addr) : "r" (val) : "memory");                 \
@@ -142,7 +142,7 @@ static inline void name(volatile u##size __iomem *addr, 
u##size val)        \
 }
 
 #define DEF_MMIO_IN_D(name, size, insn)                                \
-static inline u##size name(const volatile u##size __iomem *addr)       \
+static inline notrace u##size name(const volatile u##size __iomem *addr)       
\
 {                                                                      \
        u##size ret;                                                    \
        __asm__ __volatile__("sync;"#insn"%U1%X1 %0,%1;twi 0,%0,0;isync"\
@@ -151,7 +151,7 @@ static inline u##size name(const volatile u##size __iomem 
*addr)    \
 }
 
 #define DEF_MMIO_OUT_D(name, size, insn)                               \
-static inline void name(volatile u##size __iomem *addr, u##size val)   \
+static inline notrace void name(volatile u##size __iomem *addr, u##size val)   
\
 {                                                                      \
        __asm__ __volatile__("sync;"#insn"%U0%X0 %1,%0"                 \
                : "=m<>" (*addr) : "r" (val) : "memory");       \
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);
 }
 
-static inline long cede_processor(void)
+static inline notrace long cede_processor(void)
 {
        /*
         * We cannot call tracepoints inside RCU idle regions which
diff --git a/arch/powerpc/include/asm/ptrace.h 
b/arch/powerpc/include/asm/ptrace.h
index d53c4dd4d8b6..7e8f89d4b8f4 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -255,17 +255,17 @@ static __always_inline void set_trap(struct pt_regs 
*regs, unsigned long val)
        regs->trap = (regs->trap & TRAP_FLAGS_MASK) | (val & ~TRAP_FLAGS_MASK);
 }
 
-static inline bool trap_is_scv(struct pt_regs *regs)
+static inline notrace bool trap_is_scv(struct pt_regs *regs)
 {
        return (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && TRAP(regs) == 0x3000);
 }
 
-static inline bool trap_is_unsupported_scv(struct pt_regs *regs)
+static inline notrace bool trap_is_unsupported_scv(struct pt_regs *regs)
 {
        return IS_ENABLED(CONFIG_PPC_BOOK3S_64) && TRAP(regs) == 0x7ff0;
 }
 
-static inline bool trap_is_syscall(struct pt_regs *regs)
+static inline notrace bool trap_is_syscall(struct pt_regs *regs)
 {
        return (trap_is_scv(regs) || TRAP(regs) == 0xc00);
 }
@@ -305,23 +305,23 @@ static inline void regs_set_return_value(struct pt_regs 
*regs, unsigned long rc)
        regs->gpr[3] = rc;
 }
 
-static inline bool cpu_has_msr_ri(void)
+static inline notrace bool cpu_has_msr_ri(void)
 {
        return !IS_ENABLED(CONFIG_BOOKE);
 }
 
-static inline bool regs_is_unrecoverable(struct pt_regs *regs)
+static inline notrace bool regs_is_unrecoverable(struct pt_regs *regs)
 {
        return unlikely(cpu_has_msr_ri() && !(regs->msr & MSR_RI));
 }
 
-static inline void regs_set_recoverable(struct pt_regs *regs)
+static inline notrace void regs_set_recoverable(struct pt_regs *regs)
 {
        if (cpu_has_msr_ri())
                regs_set_return_msr(regs, regs->msr | MSR_RI);
 }
 
-static inline void regs_set_unrecoverable(struct pt_regs *regs)
+static inline notrace void regs_set_unrecoverable(struct pt_regs *regs)
 {
        if (cpu_has_msr_ri())
                regs_set_return_msr(regs, regs->msr & ~MSR_RI);
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index d046bbd5017d..7c3431c272e0 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -343,7 +343,7 @@ static inline uint8_t rtas_error_initiator(const struct 
rtas_error_log *elog)
 
 #define rtas_error_type(x)     ((x)->byte3)
 
-static inline
+static inline notrace
 uint32_t rtas_error_extended_log_length(const struct rtas_error_log *elog)
 {
        return be32_to_cpu(elog->extended_log_length);
@@ -354,13 +354,13 @@ uint32_t rtas_error_extended_log_length(const struct 
rtas_error_log *elog)
 #define RTAS_V6EXT_COMPANY_ID_IBM      (('I' << 24) | ('B' << 16) | ('M' << 8))
 
 static
-inline uint8_t rtas_ext_event_log_format(struct rtas_ext_event_log_v6 *ext_log)
+inline notrace uint8_t rtas_ext_event_log_format(struct rtas_ext_event_log_v6 
*ext_log)
 {
        return ext_log->byte2 & 0x0F;
 }
 
 static
-inline uint32_t rtas_ext_event_company_id(struct rtas_ext_event_log_v6 
*ext_log)
+inline notrace uint32_t rtas_ext_event_company_id(struct rtas_ext_event_log_v6 
*ext_log)
 {
        return be32_to_cpu(ext_log->company_id);
 }
@@ -389,13 +389,13 @@ inline uint32_t rtas_ext_event_company_id(struct 
rtas_ext_event_log_v6 *ext_log)
 #define PSERIES_ELOG_SECT_ID_MCE               (('M' << 8) | 'C')
 
 static
-inline uint16_t pseries_errorlog_id(struct pseries_errorlog *sect)
+inline notrace uint16_t pseries_errorlog_id(struct pseries_errorlog *sect)
 {
        return be16_to_cpu(sect->id);
 }
 
 static
-inline uint16_t pseries_errorlog_length(struct pseries_errorlog *sect)
+inline notrace uint16_t pseries_errorlog_length(struct pseries_errorlog *sect)
 {
        return be16_to_cpu(sect->length);
 }
diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
index d0e9765dee28..178fe45c8927 100644
--- a/arch/powerpc/include/asm/synch.h
+++ b/arch/powerpc/include/asm/synch.h
@@ -12,7 +12,7 @@ extern unsigned int __start___lwsync_fixup, 
__stop___lwsync_fixup;
 extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
                             void *fixup_end);
 
-static inline void eieio(void)
+static inline notrace void eieio(void)
 {
        if (IS_ENABLED(CONFIG_BOOKE))
                __asm__ __volatile__ ("mbar" : : : "memory");
@@ -20,12 +20,12 @@ static inline void eieio(void)
                __asm__ __volatile__ ("eieio" : : : "memory");
 }
 
-static inline void isync(void)
+static inline notrace void isync(void)
 {
        __asm__ __volatile__ ("isync" : : : "memory");
 }
 
-static inline void ppc_after_tlbiel_barrier(void)
+static inline notrace void ppc_after_tlbiel_barrier(void)
 {
        asm volatile("ptesync": : :"memory");
        /*
diff --git a/arch/powerpc/include/asm/thread_info.h 
b/arch/powerpc/include/asm/thread_info.h
index 1e069a2e7ce8..04147dd91dfd 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -165,13 +165,13 @@ void arch_setup_new_exec(void);
 
 #ifndef __ASSEMBLER__
 
-static inline void clear_thread_local_flags(unsigned int flags)
+static inline notrace void clear_thread_local_flags(unsigned int flags)
 {
        struct thread_info *ti = current_thread_info();
        ti->local_flags &= ~flags;
 }
 
-static inline bool test_thread_local_flags(unsigned int flags)
+static inline notrace bool test_thread_local_flags(unsigned int flags)
 {
        struct thread_info *ti = current_thread_info();
        return (ti->local_flags & flags) != 0;
diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 44f178e07531..00f4712290b5 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -121,7 +121,7 @@ static void wd_end_reporting(void)
        WRITE_ONCE(__wd_reporting, 0);
 }
 
-static inline void wd_smp_lock(unsigned long *flags)
+static inline notrace void wd_smp_lock(unsigned long *flags)
 {
        /*
         * Avoid locking layers if possible.
@@ -138,7 +138,7 @@ static inline void wd_smp_lock(unsigned long *flags)
        }
 }
 
-static inline void wd_smp_unlock(unsigned long *flags)
+static inline notrace void wd_smp_unlock(unsigned long *flags)
 {
        clear_bit_unlock(0, &__wd_smp_lock);
        raw_local_irq_restore(*flags);
-- 
2.53.1-Meta


Reply via email to