]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390: Use MARCH_HAS_*_FEATURES defines
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 4 Sep 2024 09:39:26 +0000 (11:39 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Sat, 7 Sep 2024 15:12:42 +0000 (17:12 +0200)
Replace CONFIG_HAVE_MARCH_*_FEATURES with MARCH_HAS_*_FEATURES
everywhere so code gets compiled correctly depending on if the
target is the kernel or the decompressor.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/arch_hweight.h
arch/s390/include/asm/atomic_ops.h
arch/s390/include/asm/barrier.h
arch/s390/include/asm/percpu.h
arch/s390/include/asm/preempt.h
arch/s390/kernel/mcount.S

index 50e23ce854e5c394cb37e126e1ee576eb2837ccd..aca08b0acbc1de8b9f438adab32fd250f376840f 100644 (file)
@@ -4,6 +4,7 @@
 #define _ASM_S390_ARCH_HWEIGHT_H
 
 #include <linux/types.h>
+#include <asm/march.h>
 
 static __always_inline unsigned long popcnt_z196(unsigned long w)
 {
@@ -29,9 +30,9 @@ static __always_inline unsigned long popcnt_z15(unsigned long w)
 
 static __always_inline unsigned long __arch_hweight64(__u64 w)
 {
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
+       if (__is_defined(MARCH_HAS_Z15_FEATURES))
                return popcnt_z15(w);
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
+       if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
                w = popcnt_z196(w);
                w += w >> 32;
                w += w >> 16;
@@ -43,9 +44,9 @@ static __always_inline unsigned long __arch_hweight64(__u64 w)
 
 static __always_inline unsigned int __arch_hweight32(unsigned int w)
 {
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
+       if (__is_defined(MARCH_HAS_Z15_FEATURES))
                return popcnt_z15(w);
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
+       if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
                w = popcnt_z196(w);
                w += w >> 16;
                w += w >> 8;
@@ -56,9 +57,9 @@ static __always_inline unsigned int __arch_hweight32(unsigned int w)
 
 static __always_inline unsigned int __arch_hweight16(unsigned int w)
 {
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
+       if (__is_defined(MARCH_HAS_Z15_FEATURES))
                return popcnt_z15((unsigned short)w);
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
+       if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
                w = popcnt_z196(w);
                w += w >> 8;
                return w & 0xff;
@@ -68,7 +69,7 @@ static __always_inline unsigned int __arch_hweight16(unsigned int w)
 
 static __always_inline unsigned int __arch_hweight8(unsigned int w)
 {
-       if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES))
+       if (__is_defined(MARCH_HAS_Z196_FEATURES))
                return popcnt_z196((unsigned char)w);
        return __sw_hweight8(w);
 }
index 742c7919cbcdc193b497b1fe90d7f0eeaeecd0d0..65380da9e75f3ee8f57aefa1b0dade98172957fd 100644 (file)
@@ -9,6 +9,7 @@
 #define __ARCH_S390_ATOMIC_OPS__
 
 #include <linux/limits.h>
+#include <asm/march.h>
 
 static __always_inline int __atomic_read(const atomic_t *v)
 {
@@ -56,7 +57,7 @@ static __always_inline void __atomic64_set(atomic64_t *v, s64 i)
        }
 }
 
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifdef MARCH_HAS_Z196_FEATURES
 
 #define __ATOMIC_OP(op_name, op_type, op_string, op_barrier)           \
 static __always_inline op_type op_name(op_type val, op_type *ptr)      \
@@ -107,7 +108,7 @@ __ATOMIC_CONST_OPS(__atomic64_add_const, long, "agsi")
 #undef __ATOMIC_CONST_OPS
 #undef __ATOMIC_CONST_OP
 
-#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#else /* MARCH_HAS_Z196_FEATURES */
 
 #define __ATOMIC_OP(op_name, op_string)                                        \
 static __always_inline int op_name(int val, int *ptr)                  \
@@ -166,7 +167,7 @@ __ATOMIC64_OPS(__atomic64_xor, "xgr")
 #define __atomic64_add_const(val, ptr)         __atomic64_add(val, ptr)
 #define __atomic64_add_const_barrier(val, ptr) __atomic64_add(val, ptr)
 
-#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#endif /* MARCH_HAS_Z196_FEATURES */
 
 static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new)
 {
index 82de2a7c41605fca221c4d0c86553b56362c850e..d82130d7f2b6d842e50dc3ae9abad72e9dc4a8fe 100644 (file)
@@ -8,13 +8,15 @@
 #ifndef __ASM_BARRIER_H
 #define __ASM_BARRIER_H
 
+#include <asm/march.h>
+
 /*
  * Force strict CPU ordering.
  * And yes, this is required on UP too when we're talking
  * to devices.
  */
 
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifdef MARCH_HAS_Z196_FEATURES
 /* Fast-BCR without checkpoint synchronization */
 #define __ASM_BCR_SERIALIZE "bcr 14,0\n"
 #else
index 89a28740b6ab85abee1be876cf1e4104046a7ed4..84f6b8357b453419b88548d6c695838544eb1daf 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/preempt.h>
 #include <asm/cmpxchg.h>
+#include <asm/march.h>
 
 /*
  * s390 uses its own implementation for per cpu data, the offset of
@@ -50,7 +51,7 @@
 #define this_cpu_or_1(pcp, val)                arch_this_cpu_to_op_simple(pcp, val, |)
 #define this_cpu_or_2(pcp, val)                arch_this_cpu_to_op_simple(pcp, val, |)
 
-#ifndef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifndef MARCH_HAS_Z196_FEATURES
 
 #define this_cpu_add_4(pcp, val)       arch_this_cpu_to_op_simple(pcp, val, +)
 #define this_cpu_add_8(pcp, val)       arch_this_cpu_to_op_simple(pcp, val, +)
@@ -61,7 +62,7 @@
 #define this_cpu_or_4(pcp, val)                arch_this_cpu_to_op_simple(pcp, val, |)
 #define this_cpu_or_8(pcp, val)                arch_this_cpu_to_op_simple(pcp, val, |)
 
-#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#else /* MARCH_HAS_Z196_FEATURES */
 
 #define arch_this_cpu_add(pcp, val, op1, op2, szcast)                  \
 {                                                                      \
 #define this_cpu_or_4(pcp, val)                arch_this_cpu_to_op(pcp, val, "lao")
 #define this_cpu_or_8(pcp, val)                arch_this_cpu_to_op(pcp, val, "laog")
 
-#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#endif /* MARCH_HAS_Z196_FEATURES */
 
 #define arch_this_cpu_cmpxchg(pcp, oval, nval)                         \
 ({                                                                     \
index 3ae5f31c665d1f7e424b1391d45260149058573b..deca3f221836ed1ec4dfcea7f56d3d6e51510601 100644 (file)
@@ -5,8 +5,9 @@
 #include <asm/current.h>
 #include <linux/thread_info.h>
 #include <asm/atomic_ops.h>
+#include <asm/march.h>
 
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifdef MARCH_HAS_Z196_FEATURES
 
 /* We use the MSB mostly because its available */
 #define PREEMPT_NEED_RESCHED   0x80000000
@@ -75,7 +76,7 @@ static __always_inline bool should_resched(int preempt_offset)
                        preempt_offset);
 }
 
-#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#else /* MARCH_HAS_Z196_FEATURES */
 
 #define PREEMPT_ENABLED        (0)
 
@@ -123,7 +124,7 @@ static __always_inline bool should_resched(int preempt_offset)
                        tif_need_resched());
 }
 
-#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
+#endif /* MARCH_HAS_Z196_FEATURES */
 
 #define init_task_preempt_count(p)     do { } while (0)
 /* Deferred to CPU bringup time */
index ae4d4fd9afcd1c4068b64a77018aa4cd059c7e41..7e267ef63a7fefab167763a6768f616786c0a6f0 100644 (file)
@@ -9,6 +9,7 @@
 #include <asm/ftrace.h>
 #include <asm/nospec-insn.h>
 #include <asm/ptrace.h>
+#include <asm/march.h>
 
 #define STACK_FRAME_SIZE_PTREGS                (STACK_FRAME_OVERHEAD + __PT_SIZE)
 #define STACK_PTREGS                   (STACK_FRAME_OVERHEAD)
@@ -88,7 +89,7 @@ SYM_CODE_START(ftrace_caller)
 SYM_CODE_END(ftrace_caller)
 
 SYM_CODE_START(ftrace_common)
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifdef MARCH_HAS_Z196_FEATURES
        aghik   %r2,%r0,-MCOUNT_INSN_SIZE
        lgrl    %r4,function_trace_op
        lgrl    %r1,ftrace_func
@@ -115,7 +116,7 @@ SYM_INNER_LABEL(ftrace_graph_caller, SYM_L_GLOBAL)
 .Lftrace_graph_caller_end:
 #endif
        lg      %r0,(STACK_FREGS_PTREGS_PSW+8)(%r15)
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+#ifdef MARCH_HAS_Z196_FEATURES
        ltg     %r1,STACK_FREGS_PTREGS_ORIG_GPR2(%r15)
        locgrz  %r1,%r0
 #else