Skip to content

Commit 4efd417

Browse files
author
Vasily Gorbik
committed
s390: raise minimum supported machine generation to z10
Machine generations up to z9 (released in May 2006) have been officially out of service for several years now (z9 end of service - January 31, 2019). No distributions build kernels supporting those old machine generations anymore, except Debian, which seems to pick the oldest supported generation. The team supporting Debian on s390 has been notified about the change. Raising minimum supported machine generation to z10 helps to reduce maintenance cost and effectively remove code, which is not getting enough testing coverage due to lack of older hardware and distributions support. Besides that this unblocks some optimization opportunities and allows to use wider instruction set in asm files for future features implementation. Due to this change spectre mitigation and usercopy implementations could be drastically simplified and many newer instructions could be converted from ".insn" encoding to instruction names. Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 432b1cc commit 4efd417

23 files changed

Lines changed: 38 additions & 435 deletions

arch/s390/Kconfig

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ config S390
120120
select ARCH_WANT_IPC_PARSE_VERSION
121121
select BUILDTIME_TABLE_SORT
122122
select CLONE_BACKWARDS2
123-
select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
124123
select DMA_OPS if PCI
125124
select DYNAMIC_FTRACE if FUNCTION_TRACER
126125
select GENERIC_ALLOCATOR
@@ -230,20 +229,8 @@ source "kernel/livepatch/Kconfig"
230229

231230
menu "Processor type and features"
232231

233-
config HAVE_MARCH_Z900_FEATURES
234-
def_bool n
235-
236-
config HAVE_MARCH_Z990_FEATURES
237-
def_bool n
238-
select HAVE_MARCH_Z900_FEATURES
239-
240-
config HAVE_MARCH_Z9_109_FEATURES
241-
def_bool n
242-
select HAVE_MARCH_Z990_FEATURES
243-
244232
config HAVE_MARCH_Z10_FEATURES
245233
def_bool n
246-
select HAVE_MARCH_Z9_109_FEATURES
247234

248235
config HAVE_MARCH_Z196_FEATURES
249236
def_bool n
@@ -269,41 +256,13 @@ choice
269256
prompt "Processor type"
270257
default MARCH_Z196
271258

272-
config MARCH_Z900
273-
bool "IBM zSeries model z800 and z900"
274-
select HAVE_MARCH_Z900_FEATURES
275-
depends on $(cc-option,-march=z900)
276-
help
277-
Select this to enable optimizations for model z800/z900 (2064 and
278-
2066 series). This will enable some optimizations that are not
279-
available on older ESA/390 (31 Bit) only CPUs.
280-
281-
config MARCH_Z990
282-
bool "IBM zSeries model z890 and z990"
283-
select HAVE_MARCH_Z990_FEATURES
284-
depends on $(cc-option,-march=z990)
285-
help
286-
Select this to enable optimizations for model z890/z990 (2084 and
287-
2086 series). The kernel will be slightly faster but will not work
288-
on older machines.
289-
290-
config MARCH_Z9_109
291-
bool "IBM System z9"
292-
select HAVE_MARCH_Z9_109_FEATURES
293-
depends on $(cc-option,-march=z9-109)
294-
help
295-
Select this to enable optimizations for IBM System z9 (2094 and
296-
2096 series). The kernel will be slightly faster but will not work
297-
on older machines.
298-
299259
config MARCH_Z10
300260
bool "IBM System z10"
301261
select HAVE_MARCH_Z10_FEATURES
302262
depends on $(cc-option,-march=z10)
303263
help
304-
Select this to enable optimizations for IBM System z10 (2097 and
305-
2098 series). The kernel will be slightly faster but will not work
306-
on older machines.
264+
Select this to enable optimizations for IBM System z10 (2097 and 2098
265+
series). This is the oldest machine generation currently supported.
307266

308267
config MARCH_Z196
309268
bool "IBM zEnterprise 114 and 196"
@@ -352,15 +311,6 @@ config MARCH_Z15
352311

353312
endchoice
354313

355-
config MARCH_Z900_TUNE
356-
def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT
357-
358-
config MARCH_Z990_TUNE
359-
def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT
360-
361-
config MARCH_Z9_109_TUNE
362-
def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT
363-
364314
config MARCH_Z10_TUNE
365315
def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT
366316

@@ -396,21 +346,8 @@ config TUNE_DEFAULT
396346
Tune the generated code for the target processor for which the kernel
397347
will be compiled.
398348

399-
config TUNE_Z900
400-
bool "IBM zSeries model z800 and z900"
401-
depends on $(cc-option,-mtune=z900)
402-
403-
config TUNE_Z990
404-
bool "IBM zSeries model z890 and z990"
405-
depends on $(cc-option,-mtune=z990)
406-
407-
config TUNE_Z9_109
408-
bool "IBM System z9"
409-
depends on $(cc-option,-mtune=z9-109)
410-
411349
config TUNE_Z10
412350
bool "IBM System z10"
413-
depends on $(cc-option,-mtune=z10)
414351

415352
config TUNE_Z196
416353
bool "IBM zEnterprise 114 and 196"
@@ -599,7 +536,6 @@ config EXPOLINE
599536
config EXPOLINE_EXTERN
600537
def_bool n
601538
depends on EXPOLINE
602-
depends on HAVE_MARCH_Z10_FEATURES
603539
depends on CC_IS_GCC && GCC_VERSION >= 110200
604540
depends on $(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
605541
prompt "Generate expolines as extern functions."

arch/s390/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ CHECKFLAGS += -D__s390__ -D__s390x__
3636

3737
export LD_BFD
3838

39-
mflags-$(CONFIG_MARCH_Z900) := -march=z900
40-
mflags-$(CONFIG_MARCH_Z990) := -march=z990
41-
mflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109
4239
mflags-$(CONFIG_MARCH_Z10) := -march=z10
4340
mflags-$(CONFIG_MARCH_Z196) := -march=z196
4441
mflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12
@@ -51,9 +48,6 @@ export CC_FLAGS_MARCH := $(mflags-y)
5148
aflags-y += $(mflags-y)
5249
cflags-y += $(mflags-y)
5350

54-
cflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900
55-
cflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990
56-
cflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109
5751
cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10
5852
cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196
5953
cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12

arch/s390/include/asm/bitops.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ static inline bool test_bit_inv(unsigned long nr,
256256
return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);
257257
}
258258

259-
#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
260-
261259
/**
262260
* __flogr - find leftmost one
263261
* @word - The word to search
@@ -376,16 +374,6 @@ static inline int fls(unsigned int word)
376374
return fls64(word);
377375
}
378376

379-
#else /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */
380-
381-
#include <asm-generic/bitops/__ffs.h>
382-
#include <asm-generic/bitops/ffs.h>
383-
#include <asm-generic/bitops/__fls.h>
384-
#include <asm-generic/bitops/fls.h>
385-
#include <asm-generic/bitops/fls64.h>
386-
387-
#endif /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */
388-
389377
#include <asm-generic/bitops/ffz.h>
390378
#include <asm-generic/bitops/hweight.h>
391379
#include <asm-generic/bitops/sched.h>

arch/s390/include/asm/lowcore.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ struct lowcore {
163163
__u64 gmap; /* 0x03d0 */
164164
__u8 pad_0x03d8[0x0400-0x03d8]; /* 0x03d8 */
165165

166-
/* br %r1 trampoline */
167-
__u16 br_r1_trampoline; /* 0x0400 */
168-
__u32 return_lpswe; /* 0x0402 */
169-
__u32 return_mcck_lpswe; /* 0x0406 */
170-
__u8 pad_0x040a[0x0e00-0x040a]; /* 0x040a */
166+
__u32 return_lpswe; /* 0x0400 */
167+
__u32 return_mcck_lpswe; /* 0x0404 */
168+
__u8 pad_0x040a[0x0e00-0x0408]; /* 0x0408 */
171169

172170
/*
173171
* 0xe00 contains the address of the IPL Parameter Information

arch/s390/include/asm/nospec-insn.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#ifdef CC_USING_EXPOLINE
1212

13-
_LC_BR_R1 = __LC_BR_R1
14-
1513
/*
1614
* The expoline macros are used to create thunks in the same format
1715
* as gcc generates them. The 'comdat' section flag makes sure that
@@ -39,7 +37,6 @@ _LC_BR_R1 = __LC_BR_R1
3937
.popsection
4038
.endm
4139

42-
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
4340
.macro __THUNK_PROLOG_BR r1,r2
4441
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
4542
.endm
@@ -55,23 +52,6 @@ _LC_BR_R1 = __LC_BR_R1
5552
.macro __THUNK_BRASL r1,r2,r3
5653
brasl \r1,__s390_indirect_jump_r\r2
5754
.endm
58-
#else
59-
.macro __THUNK_PROLOG_BR r1,r2
60-
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
61-
.endm
62-
63-
.macro __THUNK_EPILOG_BR r1,r2
64-
__THUNK_EPILOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
65-
.endm
66-
67-
.macro __THUNK_BR r1,r2
68-
jg __s390_indirect_jump_r\r2\()use_r\r1
69-
.endm
70-
71-
.macro __THUNK_BRASL r1,r2,r3
72-
brasl \r1,__s390_indirect_jump_r\r3\()use_r\r2
73-
.endm
74-
#endif
7555

7656
.macro __DECODE_RR expand,reg,ruse
7757
.set __decode_fail,1
@@ -112,22 +92,8 @@ _LC_BR_R1 = __LC_BR_R1
11292
.endm
11393

11494
.macro __THUNK_EX_BR reg,ruse
115-
# Be very careful when adding instructions to this macro!
116-
# The ALTERNATIVE replacement code has a .+10 which targets
117-
# the "br \reg" after the code has been patched.
118-
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
11995
exrl 0,555f
12096
j .
121-
#else
122-
.ifc \reg,%r1
123-
ALTERNATIVE "ex %r0,_LC_BR_R1", ".insn ril,0xc60000000000,0,.+10", 35
124-
j .
125-
.else
126-
larl \ruse,555f
127-
ex 0,0(\ruse)
128-
j .
129-
.endif
130-
#endif
13197
555: br \reg
13298
.endm
13399

arch/s390/include/asm/timex.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,10 @@ static inline unsigned long get_tod_clock(void)
187187

188188
static inline unsigned long get_tod_clock_fast(void)
189189
{
190-
#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
191190
unsigned long clk;
192191

193192
asm volatile("stckf %0" : "=Q" (clk) : : "cc");
194193
return clk;
195-
#else
196-
return get_tod_clock();
197-
#endif
198194
}
199195

200196
static inline cycles_t get_cycles(void)

arch/s390/include/asm/uaccess.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ union oac {
9292
};
9393
};
9494

95-
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
96-
9795
#define __put_get_user_asm(to, from, size, oac_spec) \
9896
({ \
9997
int __rc; \
@@ -187,22 +185,6 @@ static __always_inline int __get_user_fn(void *x, const void __user *ptr, unsign
187185
return rc;
188186
}
189187

190-
#else /* CONFIG_HAVE_MARCH_Z10_FEATURES */
191-
192-
static inline int __put_user_fn(void *x, void __user *ptr, unsigned long size)
193-
{
194-
size = raw_copy_to_user(ptr, x, size);
195-
return size ? -EFAULT : 0;
196-
}
197-
198-
static inline int __get_user_fn(void *x, const void __user *ptr, unsigned long size)
199-
{
200-
size = raw_copy_from_user(x, ptr, size);
201-
return size ? -EFAULT : 0;
202-
}
203-
204-
#endif /* CONFIG_HAVE_MARCH_Z10_FEATURES */
205-
206188
/*
207189
* These are the main single-value transfer routines. They automatically
208190
* use the right size if we just have the right pointer type.

arch/s390/kernel/asm-offsets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ int main(void)
122122
OFFSET(__LC_LPP, lowcore, lpp);
123123
OFFSET(__LC_CURRENT_PID, lowcore, current_pid);
124124
OFFSET(__LC_GMAP, lowcore, gmap);
125-
OFFSET(__LC_BR_R1, lowcore, br_r1_trampoline);
126125
OFFSET(__LC_LAST_BREAK, lowcore, last_break);
127126
/* software defined ABI-relevant lowcore locations 0xe00 - 0xe20 */
128127
OFFSET(__LC_DUMP_REIPL, lowcore, ipib);

arch/s390/kernel/cache.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ void show_cacheinfo(struct seq_file *m)
7070
struct cacheinfo *cache;
7171
int idx;
7272

73-
if (!test_facility(34))
74-
return;
7573
this_cpu_ci = get_cpu_cacheinfo(cpumask_any(cpu_online_mask));
7674
for (idx = 0; idx < this_cpu_ci->num_leaves; idx++) {
7775
cache = this_cpu_ci->info_list + idx;
@@ -131,8 +129,6 @@ int init_cache_level(unsigned int cpu)
131129
union cache_topology ct;
132130
enum cache_type ctype;
133131

134-
if (!test_facility(34))
135-
return -EOPNOTSUPP;
136132
if (!this_cpu_ci)
137133
return -EINVAL;
138134
ct.raw = ecag(EXTRACT_TOPOLOGY, 0, 0);
@@ -156,8 +152,6 @@ int populate_cache_leaves(unsigned int cpu)
156152
union cache_topology ct;
157153
enum cache_type ctype;
158154

159-
if (!test_facility(34))
160-
return -EOPNOTSUPP;
161155
ct.raw = ecag(EXTRACT_TOPOLOGY, 0, 0);
162156
for (idx = 0, level = 0; level < this_cpu_ci->num_levels &&
163157
idx < this_cpu_ci->num_leaves; idx++, level++) {

arch/s390/kernel/ftrace.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ asm(
5858
);
5959

6060
#ifdef CONFIG_EXPOLINE
61-
asm(
62-
" .align 16\n"
63-
"ftrace_shared_hotpatch_trampoline_ex:\n"
64-
" lmg %r0,%r1,2(%r1)\n"
65-
" ex %r0," __stringify(__LC_BR_R1) "(%r0)\n"
66-
" j .\n"
67-
"ftrace_shared_hotpatch_trampoline_ex_end:\n"
68-
);
69-
7061
asm(
7162
" .align 16\n"
7263
"ftrace_shared_hotpatch_trampoline_exrl:\n"
@@ -90,12 +81,8 @@ static const char *ftrace_shared_hotpatch_trampoline(const char **end)
9081
tend = ftrace_shared_hotpatch_trampoline_br_end;
9182
#ifdef CONFIG_EXPOLINE
9283
if (!nospec_disable) {
93-
tstart = ftrace_shared_hotpatch_trampoline_ex;
94-
tend = ftrace_shared_hotpatch_trampoline_ex_end;
95-
if (test_facility(35)) { /* exrl */
96-
tstart = ftrace_shared_hotpatch_trampoline_exrl;
97-
tend = ftrace_shared_hotpatch_trampoline_exrl_end;
98-
}
84+
tstart = ftrace_shared_hotpatch_trampoline_exrl;
85+
tend = ftrace_shared_hotpatch_trampoline_exrl_end;
9986
}
10087
#endif /* CONFIG_EXPOLINE */
10188
if (end)

0 commit comments

Comments
 (0)