Skip to content

Commit ebcc369

Browse files
committed
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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 697b373 commit ebcc369

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

arch/s390/include/asm/arch_hweight.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#define _ASM_S390_ARCH_HWEIGHT_H
55

66
#include <linux/types.h>
7+
#include <asm/march.h>
78

89
static __always_inline unsigned long popcnt_z196(unsigned long w)
910
{
@@ -29,9 +30,9 @@ static __always_inline unsigned long popcnt_z15(unsigned long w)
2930

3031
static __always_inline unsigned long __arch_hweight64(__u64 w)
3132
{
32-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
33+
if (__is_defined(MARCH_HAS_Z15_FEATURES))
3334
return popcnt_z15(w);
34-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
35+
if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
3536
w = popcnt_z196(w);
3637
w += w >> 32;
3738
w += w >> 16;
@@ -43,9 +44,9 @@ static __always_inline unsigned long __arch_hweight64(__u64 w)
4344

4445
static __always_inline unsigned int __arch_hweight32(unsigned int w)
4546
{
46-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
47+
if (__is_defined(MARCH_HAS_Z15_FEATURES))
4748
return popcnt_z15(w);
48-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
49+
if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
4950
w = popcnt_z196(w);
5051
w += w >> 16;
5152
w += w >> 8;
@@ -56,9 +57,9 @@ static __always_inline unsigned int __arch_hweight32(unsigned int w)
5657

5758
static __always_inline unsigned int __arch_hweight16(unsigned int w)
5859
{
59-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
60+
if (__is_defined(MARCH_HAS_Z15_FEATURES))
6061
return popcnt_z15((unsigned short)w);
61-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
62+
if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
6263
w = popcnt_z196(w);
6364
w += w >> 8;
6465
return w & 0xff;
@@ -68,7 +69,7 @@ static __always_inline unsigned int __arch_hweight16(unsigned int w)
6869

6970
static __always_inline unsigned int __arch_hweight8(unsigned int w)
7071
{
71-
if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES))
72+
if (__is_defined(MARCH_HAS_Z196_FEATURES))
7273
return popcnt_z196((unsigned char)w);
7374
return __sw_hweight8(w);
7475
}

arch/s390/include/asm/atomic_ops.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define __ARCH_S390_ATOMIC_OPS__
1010

1111
#include <linux/limits.h>
12+
#include <asm/march.h>
1213

1314
static __always_inline int __atomic_read(const atomic_t *v)
1415
{
@@ -56,7 +57,7 @@ static __always_inline void __atomic64_set(atomic64_t *v, s64 i)
5657
}
5758
}
5859

59-
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
60+
#ifdef MARCH_HAS_Z196_FEATURES
6061

6162
#define __ATOMIC_OP(op_name, op_type, op_string, op_barrier) \
6263
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")
107108
#undef __ATOMIC_CONST_OPS
108109
#undef __ATOMIC_CONST_OP
109110

110-
#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
111+
#else /* MARCH_HAS_Z196_FEATURES */
111112

112113
#define __ATOMIC_OP(op_name, op_string) \
113114
static __always_inline int op_name(int val, int *ptr) \
@@ -166,7 +167,7 @@ __ATOMIC64_OPS(__atomic64_xor, "xgr")
166167
#define __atomic64_add_const(val, ptr) __atomic64_add(val, ptr)
167168
#define __atomic64_add_const_barrier(val, ptr) __atomic64_add(val, ptr)
168169

169-
#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
170+
#endif /* MARCH_HAS_Z196_FEATURES */
170171

171172
static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new)
172173
{

arch/s390/include/asm/barrier.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
#ifndef __ASM_BARRIER_H
99
#define __ASM_BARRIER_H
1010

11+
#include <asm/march.h>
12+
1113
/*
1214
* Force strict CPU ordering.
1315
* And yes, this is required on UP too when we're talking
1416
* to devices.
1517
*/
1618

17-
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
19+
#ifdef MARCH_HAS_Z196_FEATURES
1820
/* Fast-BCR without checkpoint synchronization */
1921
#define __ASM_BCR_SERIALIZE "bcr 14,0\n"
2022
#else

arch/s390/include/asm/percpu.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <linux/preempt.h>
66
#include <asm/cmpxchg.h>
7+
#include <asm/march.h>
78

89
/*
910
* s390 uses its own implementation for per cpu data, the offset of
@@ -50,7 +51,7 @@
5051
#define this_cpu_or_1(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |)
5152
#define this_cpu_or_2(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |)
5253

53-
#ifndef CONFIG_HAVE_MARCH_Z196_FEATURES
54+
#ifndef MARCH_HAS_Z196_FEATURES
5455

5556
#define this_cpu_add_4(pcp, val) arch_this_cpu_to_op_simple(pcp, val, +)
5657
#define this_cpu_add_8(pcp, val) arch_this_cpu_to_op_simple(pcp, val, +)
@@ -61,7 +62,7 @@
6162
#define this_cpu_or_4(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |)
6263
#define this_cpu_or_8(pcp, val) arch_this_cpu_to_op_simple(pcp, val, |)
6364

64-
#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
65+
#else /* MARCH_HAS_Z196_FEATURES */
6566

6667
#define arch_this_cpu_add(pcp, val, op1, op2, szcast) \
6768
{ \
@@ -129,7 +130,7 @@
129130
#define this_cpu_or_4(pcp, val) arch_this_cpu_to_op(pcp, val, "lao")
130131
#define this_cpu_or_8(pcp, val) arch_this_cpu_to_op(pcp, val, "laog")
131132

132-
#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
133+
#endif /* MARCH_HAS_Z196_FEATURES */
133134

134135
#define arch_this_cpu_cmpxchg(pcp, oval, nval) \
135136
({ \

arch/s390/include/asm/preempt.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
#include <asm/current.h>
66
#include <linux/thread_info.h>
77
#include <asm/atomic_ops.h>
8+
#include <asm/march.h>
89

9-
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
10+
#ifdef MARCH_HAS_Z196_FEATURES
1011

1112
/* We use the MSB mostly because its available */
1213
#define PREEMPT_NEED_RESCHED 0x80000000
@@ -75,7 +76,7 @@ static __always_inline bool should_resched(int preempt_offset)
7576
preempt_offset);
7677
}
7778

78-
#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
79+
#else /* MARCH_HAS_Z196_FEATURES */
7980

8081
#define PREEMPT_ENABLED (0)
8182

@@ -123,7 +124,7 @@ static __always_inline bool should_resched(int preempt_offset)
123124
tif_need_resched());
124125
}
125126

126-
#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
127+
#endif /* MARCH_HAS_Z196_FEATURES */
127128

128129
#define init_task_preempt_count(p) do { } while (0)
129130
/* Deferred to CPU bringup time */

arch/s390/kernel/mcount.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/ftrace.h>
1010
#include <asm/nospec-insn.h>
1111
#include <asm/ptrace.h>
12+
#include <asm/march.h>
1213

1314
#define STACK_FRAME_SIZE_PTREGS (STACK_FRAME_OVERHEAD + __PT_SIZE)
1415
#define STACK_PTREGS (STACK_FRAME_OVERHEAD)
@@ -88,7 +89,7 @@ SYM_CODE_START(ftrace_caller)
8889
SYM_CODE_END(ftrace_caller)
8990

9091
SYM_CODE_START(ftrace_common)
91-
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
92+
#ifdef MARCH_HAS_Z196_FEATURES
9293
aghik %r2,%r0,-MCOUNT_INSN_SIZE
9394
lgrl %r4,function_trace_op
9495
lgrl %r1,ftrace_func
@@ -115,7 +116,7 @@ SYM_INNER_LABEL(ftrace_graph_caller, SYM_L_GLOBAL)
115116
.Lftrace_graph_caller_end:
116117
#endif
117118
lg %r0,(STACK_FREGS_PTREGS_PSW+8)(%r15)
118-
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
119+
#ifdef MARCH_HAS_Z196_FEATURES
119120
ltg %r1,STACK_FREGS_PTREGS_ORIG_GPR2(%r15)
120121
locgrz %r1,%r0
121122
#else

0 commit comments

Comments
 (0)