Commit 4efd417f authored by Vasily Gorbik's avatar Vasily Gorbik
Browse files

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: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 432b1cc7
Loading
Loading
Loading
Loading
+2 −66
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@ config S390
	select ARCH_WANT_IPC_PARSE_VERSION
	select BUILDTIME_TABLE_SORT
	select CLONE_BACKWARDS2
	select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
	select DMA_OPS if PCI
	select DYNAMIC_FTRACE if FUNCTION_TRACER
	select GENERIC_ALLOCATOR
@@ -230,20 +229,8 @@ source "kernel/livepatch/Kconfig"

menu "Processor type and features"

config HAVE_MARCH_Z900_FEATURES
	def_bool n

config HAVE_MARCH_Z990_FEATURES
	def_bool n
	select HAVE_MARCH_Z900_FEATURES

config HAVE_MARCH_Z9_109_FEATURES
	def_bool n
	select HAVE_MARCH_Z990_FEATURES

config HAVE_MARCH_Z10_FEATURES
	def_bool n
	select HAVE_MARCH_Z9_109_FEATURES

config HAVE_MARCH_Z196_FEATURES
	def_bool n
@@ -269,41 +256,13 @@ choice
	prompt "Processor type"
	default MARCH_Z196

config MARCH_Z900
	bool "IBM zSeries model z800 and z900"
	select HAVE_MARCH_Z900_FEATURES
	depends on $(cc-option,-march=z900)
	help
	  Select this to enable optimizations for model z800/z900 (2064 and
	  2066 series). This will enable some optimizations that are not
	  available on older ESA/390 (31 Bit) only CPUs.

config MARCH_Z990
	bool "IBM zSeries model z890 and z990"
	select HAVE_MARCH_Z990_FEATURES
	depends on $(cc-option,-march=z990)
	help
	  Select this to enable optimizations for model z890/z990 (2084 and
	  2086 series). The kernel will be slightly faster but will not work
	  on older machines.

config MARCH_Z9_109
	bool "IBM System z9"
	select HAVE_MARCH_Z9_109_FEATURES
	depends on $(cc-option,-march=z9-109)
	help
	  Select this to enable optimizations for IBM System z9 (2094 and
	  2096 series). The kernel will be slightly faster but will not work
	  on older machines.

config MARCH_Z10
	bool "IBM System z10"
	select HAVE_MARCH_Z10_FEATURES
	depends on $(cc-option,-march=z10)
	help
	  Select this to enable optimizations for IBM System z10 (2097 and
	  2098 series). The kernel will be slightly faster but will not work
	  on older machines.
	  Select this to enable optimizations for IBM System z10 (2097 and 2098
	  series). This is the oldest machine generation currently supported.

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

endchoice

config MARCH_Z900_TUNE
	def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT

config MARCH_Z990_TUNE
	def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT

config MARCH_Z9_109_TUNE
	def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT

config MARCH_Z10_TUNE
	def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT

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

config TUNE_Z900
	bool "IBM zSeries model z800 and z900"
	depends on $(cc-option,-mtune=z900)

config TUNE_Z990
	bool "IBM zSeries model z890 and z990"
	depends on $(cc-option,-mtune=z990)

config TUNE_Z9_109
	bool "IBM System z9"
	depends on $(cc-option,-mtune=z9-109)

config TUNE_Z10
	bool "IBM System z10"
	depends on $(cc-option,-mtune=z10)

config TUNE_Z196
	bool "IBM zEnterprise 114 and 196"
@@ -599,7 +536,6 @@ config EXPOLINE
config EXPOLINE_EXTERN
	def_bool n
	depends on EXPOLINE
	depends on HAVE_MARCH_Z10_FEATURES
	depends on CC_IS_GCC && GCC_VERSION >= 110200
	depends on $(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
	prompt "Generate expolines as extern functions."
+0 −6
Original line number Diff line number Diff line
@@ -36,9 +36,6 @@ CHECKFLAGS += -D__s390__ -D__s390x__

export LD_BFD

mflags-$(CONFIG_MARCH_Z900)   := -march=z900
mflags-$(CONFIG_MARCH_Z990)   := -march=z990
mflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109
mflags-$(CONFIG_MARCH_Z10)    := -march=z10
mflags-$(CONFIG_MARCH_Z196)   := -march=z196
mflags-$(CONFIG_MARCH_ZEC12)  := -march=zEC12
@@ -51,9 +48,6 @@ export CC_FLAGS_MARCH := $(mflags-y)
aflags-y += $(mflags-y)
cflags-y += $(mflags-y)

cflags-$(CONFIG_MARCH_Z900_TUNE)	+= -mtune=z900
cflags-$(CONFIG_MARCH_Z990_TUNE)	+= -mtune=z990
cflags-$(CONFIG_MARCH_Z9_109_TUNE)	+= -mtune=z9-109
cflags-$(CONFIG_MARCH_Z10_TUNE)		+= -mtune=z10
cflags-$(CONFIG_MARCH_Z196_TUNE)	+= -mtune=z196
cflags-$(CONFIG_MARCH_ZEC12_TUNE)	+= -mtune=zEC12
+0 −12
Original line number Diff line number Diff line
@@ -256,8 +256,6 @@ static inline bool test_bit_inv(unsigned long nr,
	return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);
}

#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES

/**
 * __flogr - find leftmost one
 * @word - The word to search
@@ -376,16 +374,6 @@ static inline int fls(unsigned int word)
	return fls64(word);
}

#else /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */

#include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/fls64.h>

#endif /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */

#include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/sched.h>
+3 −5
Original line number Diff line number Diff line
@@ -163,11 +163,9 @@ struct lowcore {
	__u64	gmap;				/* 0x03d0 */
	__u8	pad_0x03d8[0x0400-0x03d8];	/* 0x03d8 */

	/* br %r1 trampoline */
	__u16	br_r1_trampoline;		/* 0x0400 */
	__u32	return_lpswe;			/* 0x0402 */
	__u32	return_mcck_lpswe;		/* 0x0406 */
	__u8	pad_0x040a[0x0e00-0x040a];	/* 0x040a */
	__u32	return_lpswe;			/* 0x0400 */
	__u32	return_mcck_lpswe;		/* 0x0404 */
	__u8	pad_0x040a[0x0e00-0x0408];	/* 0x0408 */

	/*
	 * 0xe00 contains the address of the IPL Parameter Information
+0 −34
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@

#ifdef CC_USING_EXPOLINE

_LC_BR_R1 = __LC_BR_R1

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

#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
	.macro __THUNK_PROLOG_BR r1,r2
	__THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
	.endm
@@ -55,23 +52,6 @@ _LC_BR_R1 = __LC_BR_R1
	.macro __THUNK_BRASL r1,r2,r3
	brasl	\r1,__s390_indirect_jump_r\r2
	.endm
#else
	.macro __THUNK_PROLOG_BR r1,r2
	__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
	.endm

	.macro __THUNK_EPILOG_BR r1,r2
	__THUNK_EPILOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
	.endm

	.macro __THUNK_BR r1,r2
	jg	__s390_indirect_jump_r\r2\()use_r\r1
	.endm

	.macro __THUNK_BRASL r1,r2,r3
	brasl	\r1,__s390_indirect_jump_r\r3\()use_r\r2
	.endm
#endif

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

	.macro __THUNK_EX_BR reg,ruse
	# Be very careful when adding instructions to this macro!
	# The ALTERNATIVE replacement code has a .+10 which targets
	# the "br \reg" after the code has been patched.
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
	exrl	0,555f
	j	.
#else
	.ifc \reg,%r1
	ALTERNATIVE "ex %r0,_LC_BR_R1", ".insn ril,0xc60000000000,0,.+10", 35
	j	.
	.else
	larl	\ruse,555f
	ex	0,0(\ruse)
	j	.
	.endif
#endif
555:	br	\reg
	.endm

Loading