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

s390: Use MARCH_HAS_*_FEATURES defines

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>

+26 -19
+8 -7
arch/s390/include/asm/arch_hweight.h
··· 4 4 #define _ASM_S390_ARCH_HWEIGHT_H 5 5 6 6 #include <linux/types.h> 7 + #include <asm/march.h> 7 8 8 9 static __always_inline unsigned long popcnt_z196(unsigned long w) 9 10 { ··· 30 29 31 30 static __always_inline unsigned long __arch_hweight64(__u64 w) 32 31 { 33 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES)) 32 + if (__is_defined(MARCH_HAS_Z15_FEATURES)) 34 33 return popcnt_z15(w); 35 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) { 34 + if (__is_defined(MARCH_HAS_Z196_FEATURES)) { 36 35 w = popcnt_z196(w); 37 36 w += w >> 32; 38 37 w += w >> 16; ··· 44 43 45 44 static __always_inline unsigned int __arch_hweight32(unsigned int w) 46 45 { 47 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES)) 46 + if (__is_defined(MARCH_HAS_Z15_FEATURES)) 48 47 return popcnt_z15(w); 49 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) { 48 + if (__is_defined(MARCH_HAS_Z196_FEATURES)) { 50 49 w = popcnt_z196(w); 51 50 w += w >> 16; 52 51 w += w >> 8; ··· 57 56 58 57 static __always_inline unsigned int __arch_hweight16(unsigned int w) 59 58 { 60 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES)) 59 + if (__is_defined(MARCH_HAS_Z15_FEATURES)) 61 60 return popcnt_z15((unsigned short)w); 62 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) { 61 + if (__is_defined(MARCH_HAS_Z196_FEATURES)) { 63 62 w = popcnt_z196(w); 64 63 w += w >> 8; 65 64 return w & 0xff; ··· 69 68 70 69 static __always_inline unsigned int __arch_hweight8(unsigned int w) 71 70 { 72 - if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) 71 + if (__is_defined(MARCH_HAS_Z196_FEATURES)) 73 72 return popcnt_z196((unsigned char)w); 74 73 return __sw_hweight8(w); 75 74 }
+4 -3
arch/s390/include/asm/atomic_ops.h
··· 9 9 #define __ARCH_S390_ATOMIC_OPS__ 10 10 11 11 #include <linux/limits.h> 12 + #include <asm/march.h> 12 13 13 14 static __always_inline int __atomic_read(const atomic_t *v) 14 15 { ··· 57 56 } 58 57 } 59 58 60 - #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 59 + #ifdef MARCH_HAS_Z196_FEATURES 61 60 62 61 #define __ATOMIC_OP(op_name, op_type, op_string, op_barrier) \ 63 62 static __always_inline op_type op_name(op_type val, op_type *ptr) \ ··· 108 107 #undef __ATOMIC_CONST_OPS 109 108 #undef __ATOMIC_CONST_OP 110 109 111 - #else /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 110 + #else /* MARCH_HAS_Z196_FEATURES */ 112 111 113 112 #define __ATOMIC_OP(op_name, op_string) \ 114 113 static __always_inline int op_name(int val, int *ptr) \ ··· 167 166 #define __atomic64_add_const(val, ptr) __atomic64_add(val, ptr) 168 167 #define __atomic64_add_const_barrier(val, ptr) __atomic64_add(val, ptr) 169 168 170 - #endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 169 + #endif /* MARCH_HAS_Z196_FEATURES */ 171 170 172 171 static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new) 173 172 {
+3 -1
arch/s390/include/asm/barrier.h
··· 8 8 #ifndef __ASM_BARRIER_H 9 9 #define __ASM_BARRIER_H 10 10 11 + #include <asm/march.h> 12 + 11 13 /* 12 14 * Force strict CPU ordering. 13 15 * And yes, this is required on UP too when we're talking 14 16 * to devices. 15 17 */ 16 18 17 - #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 19 + #ifdef MARCH_HAS_Z196_FEATURES 18 20 /* Fast-BCR without checkpoint synchronization */ 19 21 #define __ASM_BCR_SERIALIZE "bcr 14,0\n" 20 22 #else
+4 -3
arch/s390/include/asm/percpu.h
··· 4 4 5 5 #include <linux/preempt.h> 6 6 #include <asm/cmpxchg.h> 7 + #include <asm/march.h> 7 8 8 9 /* 9 10 * s390 uses its own implementation for per cpu data, the offset of ··· 51 50 #define this_cpu_or_1(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |) 52 51 #define this_cpu_or_2(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |) 53 52 54 - #ifndef CONFIG_HAVE_MARCH_Z196_FEATURES 53 + #ifndef MARCH_HAS_Z196_FEATURES 55 54 56 55 #define this_cpu_add_4(pcp, val) arch_this_cpu_to_op_simple(pcp, val, +) 57 56 #define this_cpu_add_8(pcp, val) arch_this_cpu_to_op_simple(pcp, val, +) ··· 62 61 #define this_cpu_or_4(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |) 63 62 #define this_cpu_or_8(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |) 64 63 65 - #else /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 64 + #else /* MARCH_HAS_Z196_FEATURES */ 66 65 67 66 #define arch_this_cpu_add(pcp, val, op1, op2, szcast) \ 68 67 { \ ··· 130 129 #define this_cpu_or_4(pcp, val) arch_this_cpu_to_op(pcp, val, "lao") 131 130 #define this_cpu_or_8(pcp, val) arch_this_cpu_to_op(pcp, val, "laog") 132 131 133 - #endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 132 + #endif /* MARCH_HAS_Z196_FEATURES */ 134 133 135 134 #define arch_this_cpu_cmpxchg(pcp, oval, nval) \ 136 135 ({ \
+4 -3
arch/s390/include/asm/preempt.h
··· 5 5 #include <asm/current.h> 6 6 #include <linux/thread_info.h> 7 7 #include <asm/atomic_ops.h> 8 + #include <asm/march.h> 8 9 9 - #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 10 + #ifdef MARCH_HAS_Z196_FEATURES 10 11 11 12 /* We use the MSB mostly because its available */ 12 13 #define PREEMPT_NEED_RESCHED 0x80000000 ··· 76 75 preempt_offset); 77 76 } 78 77 79 - #else /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 78 + #else /* MARCH_HAS_Z196_FEATURES */ 80 79 81 80 #define PREEMPT_ENABLED (0) 82 81 ··· 124 123 tif_need_resched()); 125 124 } 126 125 127 - #endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */ 126 + #endif /* MARCH_HAS_Z196_FEATURES */ 128 127 129 128 #define init_task_preempt_count(p) do { } while (0) 130 129 /* Deferred to CPU bringup time */
+3 -2
arch/s390/kernel/mcount.S
··· 9 9 #include <asm/ftrace.h> 10 10 #include <asm/nospec-insn.h> 11 11 #include <asm/ptrace.h> 12 + #include <asm/march.h> 12 13 13 14 #define STACK_FRAME_SIZE_PTREGS (STACK_FRAME_OVERHEAD + __PT_SIZE) 14 15 #define STACK_PTREGS (STACK_FRAME_OVERHEAD) ··· 89 88 SYM_CODE_END(ftrace_caller) 90 89 91 90 SYM_CODE_START(ftrace_common) 92 - #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 91 + #ifdef MARCH_HAS_Z196_FEATURES 93 92 aghik %r2,%r0,-MCOUNT_INSN_SIZE 94 93 lgrl %r4,function_trace_op 95 94 lgrl %r1,ftrace_func ··· 116 115 .Lftrace_graph_caller_end: 117 116 #endif 118 117 lg %r0,(STACK_FREGS_PTREGS_PSW+8)(%r15) 119 - #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 118 + #ifdef MARCH_HAS_Z196_FEATURES 120 119 ltg %r1,STACK_FREGS_PTREGS_ORIG_GPR2(%r15) 121 120 locgrz %r1,%r0 122 121 #else