s390/processor: always inline cpu flag helper functions
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Feb 2023 13:49:41 +0000 (14:49 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 9 Feb 2023 19:11:22 +0000 (20:11 +0100)
arch_cpu_idle() is marked noinstr and therefore must only call functions
which are also not instrumented.

Make sure that cpu flag helper functions are always inlined to avoid that
the compiler generates an out-of-line function for e.g. the call within
arch_cpu_idle().

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/processor.h

index c907f74..53172b2 100644 (file)
 
 typedef long (*sys_call_ptr_t)(struct pt_regs *regs);
 
-static inline void set_cpu_flag(int flag)
+static __always_inline void set_cpu_flag(int flag)
 {
        S390_lowcore.cpu_flags |= (1UL << flag);
 }
 
-static inline void clear_cpu_flag(int flag)
+static __always_inline void clear_cpu_flag(int flag)
 {
        S390_lowcore.cpu_flags &= ~(1UL << flag);
 }
 
-static inline int test_cpu_flag(int flag)
+static __always_inline int test_cpu_flag(int flag)
 {
        return !!(S390_lowcore.cpu_flags & (1UL << flag));
 }
@@ -63,7 +63,7 @@ static inline int test_cpu_flag(int flag)
  * Test CIF flag of another CPU. The caller needs to ensure that
  * CPU hotplug can not happen, e.g. by disabling preemption.
  */
-static inline int test_cpu_flag_of(int flag, int cpu)
+static __always_inline int test_cpu_flag_of(int flag, int cpu)
 {
        struct lowcore *lc = lowcore_ptr[cpu];
        return !!(lc->cpu_flags & (1UL << flag));