Commit d710d370 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 updates from Vasily Gorbik:

 - Raise minimum supported machine generation to z10, which comes with
   various cleanups and code simplifications (usercopy/spectre
   mitigation/etc).

 - Rework extables and get rid of anonymous out-of-line fixups.

 - Page table helpers cleanup. Add set_pXd()/set_pte() helper functions.
   Covert pte_val()/pXd_val() macros to functions.

 - Optimize kretprobe handling by avoiding extra kprobe on
   __kretprobe_trampoline.

 - Add support for CEX8 crypto cards.

 - Allow to trigger AP bus rescan via writing to /sys/bus/ap/scans.

 - Add CONFIG_EXPOLINE_EXTERN option to build the kernel without COMDAT
   group sections which simplifies kpatch support.

 - Always use the packed stack layout and extend kernel unwinder tests.

 - Add sanity checks for ftrace code patching.

 - Add s390dbf debug log for the vfio_ap device driver.

 - Various virtual vs physical address confusion fixes.

 - Various small fixes and improvements all over the code.

* tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (69 commits)
  s390/test_unwind: add kretprobe tests
  s390/kprobes: Avoid additional kprobe in kretprobe handling
  s390: convert ".insn" encoding to instruction names
  s390: assume stckf is always present
  s390/nospec: move to single register thunks
  s390: raise minimum supported machine generation to z10
  s390/uaccess: Add copy_from/to_user_key functions
  s390/nospec: align and size extern thunks
  s390/nospec: add an option to use thunk-extern
  s390/nospec: generate single register thunks if possible
  s390/pci: make zpci_set_irq()/zpci_clear_irq() static
  s390: remove unused expoline to BC instructions
  s390/irq: use assignment instead of cast
  s390/traps: get rid of magic cast for per code
  s390/traps: get rid of magic cast for program interruption code
  s390/signal: fix typo in comments
  s390/asm-offsets: remove unused defines
  s390/test_unwind: avoid build warning with W=1
  s390: remove .fixup section
  s390/bpf: encode register within extable entry
  ...
parents 744465da c65f677b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -17019,9 +17019,7 @@ L: linux-s390@vger.kernel.org
S:	Supported
W:	http://www.ibm.com/developerworks/linux/linux390/
F:	Documentation/s390/vfio-ap.rst
F:	drivers/s390/crypto/vfio_ap_drv.c
F:	drivers/s390/crypto/vfio_ap_ops.c
F:	drivers/s390/crypto/vfio_ap_private.h
F:	drivers/s390/crypto/vfio_ap*
S390 VFIO-CCW DRIVER
M:	Eric Farman <farman@linux.ibm.com>
+17 −80
Original line number Diff line number Diff line
@@ -122,7 +122,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
@@ -157,7 +156,7 @@ config S390
	select HAVE_DYNAMIC_FTRACE_WITH_ARGS
	select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
	select HAVE_DYNAMIC_FTRACE_WITH_REGS
	select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
	select HAVE_EBPF_JIT if HAVE_MARCH_Z196_FEATURES
	select HAVE_EFFICIENT_UNALIGNED_ACCESS
	select HAVE_FAST_GUP
	select HAVE_FENTRY
@@ -232,20 +231,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
@@ -271,41 +258,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"
@@ -354,15 +313,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

@@ -398,21 +348,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"
@@ -587,6 +524,7 @@ config KERNEL_NOBP

config EXPOLINE
	def_bool n
	depends on $(cc-option,-mindirect-branch=thunk)
	prompt "Avoid speculative indirect branches in the kernel"
	help
	  Compile the kernel with the expoline compiler options to guard
@@ -597,6 +535,19 @@ config EXPOLINE

	  If unsure, say N.

config EXPOLINE_EXTERN
	def_bool n
	depends on EXPOLINE
	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."
	help
	  This option is required for some tooling like kpatch. The kernel is
	  compiled with -mindirect-branch=thunk-extern and requires a newer
	  compiler.

	  If unsure, say N.

choice
	prompt "Expoline default"
	depends on EXPOLINE
@@ -658,20 +609,6 @@ config MAX_PHYSMEM_BITS
	  Increasing the number of bits also increases the kernel image size.
	  By default 46 bits (64TB) are supported.

config PACK_STACK
	def_bool y
	prompt "Pack kernel stack"
	help
	  This option enables the compiler option -mkernel-backchain if it
	  is available. If the option is available the compiler supports
	  the new stack layout which dramatically reduces the minimum stack
	  frame size. With an old compiler a non-leaf function needs a
	  minimum of 96 bytes on 31 bit and 160 bytes on 64 bit. With
	  -mkernel-backchain the minimum size drops to 16 byte on 31 bit
	  and 24 byte on 64 bit.

	  Say Y if you are unsure.

config CHECK_STACK
	def_bool y
	depends on !VMAP_STACK
+11 −18
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ endif
aflags_dwarf	:= -Wa,-gdwarf-2
KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack
KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
@@ -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
@@ -68,11 +62,6 @@ cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
#
cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls

ifneq ($(call cc-option,-mpacked-stack -mbackchain -msoft-float),)
cflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
endif

KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y)
KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y)

@@ -86,15 +75,19 @@ ifneq ($(call cc-option,-mstack-size=8192 -mstack-guard=128),)
endif

ifdef CONFIG_EXPOLINE
  ifneq ($(call cc-option,$(CC_FLAGS_MARCH) -mindirect-branch=thunk),)
  ifdef CONFIG_EXPOLINE_EXTERN
    KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline.o
    CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern
    CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern
  else
    CC_FLAGS_EXPOLINE := -mindirect-branch=thunk
    CC_FLAGS_EXPOLINE += -mfunction-return=thunk
  endif
  CC_FLAGS_EXPOLINE += -mindirect-branch-table
  export CC_FLAGS_EXPOLINE
  cflags-y += $(CC_FLAGS_EXPOLINE) -DCC_USING_EXPOLINE
  aflags-y += -DCC_USING_EXPOLINE
endif
endif

ifdef CONFIG_FUNCTION_TRACER
  ifeq ($(call cc-option,-mfentry -mnop-mcount),)
@@ -111,7 +104,7 @@ endif
# Test CFI features of binutils
cfi := $(call as-instr,.cfi_startproc\n.cfi_val_offset 15$(comma)-160\n.cfi_endproc,-DCONFIG_AS_CFI_VAL_OFFSET=1)

KBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
KBUILD_CFLAGS	+= -mpacked-stack -mbackchain -msoft-float $(cflags-y)
KBUILD_CFLAGS	+= -pipe -Wno-sign-compare
KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables $(cfi)
KBUILD_AFLAGS	+= $(aflags-y) $(cfi)
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
 *    Author(s): Hartmut Penner <hp@de.ibm.com>
 *		 Martin Schwidefsky <schwidefsky@de.ibm.com>
 *		 Rob van der Heij <rvdhei@iae.nl>
 *		 Heiko Carstens <heiko.carstens@de.ibm.com>
 *
 * There are 5 different IPL methods
 *  1) load the image directly into ram at address 0 and do an PSW restart
+10 −10
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ ENTRY(chacha20_vx_4x)
	VPERM	XC0,XC0,XC0,BEPERM
	VPERM	XD0,XD0,XD0,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_4x

	VLM	XT0,XT3,0,INP,0
@@ -339,7 +339,7 @@ ENTRY(chacha20_vx_4x)
	VPERM	XC0,XC0,XC0,BEPERM
	VPERM	XD0,XD0,XD0,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_4x

	VLM	XT0,XT3,0,INP,0
@@ -366,7 +366,7 @@ ENTRY(chacha20_vx_4x)
	VPERM	XC0,XC0,XC0,BEPERM
	VPERM	XD0,XD0,XD0,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_4x

	VLM	XT0,XT3,0,INP,0
@@ -472,7 +472,7 @@ ENDPROC(chacha20_vx_4x)
#define T3		%v30

ENTRY(chacha20_vx)
	.insn	rilu,0xc20e00000000,LEN,256	# clgfi LEN,256
	clgfi	LEN,256
	jle	chacha20_vx_4x
	stmg	%r6,%r7,6*8(SP)

@@ -725,7 +725,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C0,C0,BEPERM
	VPERM	D0,D0,D0,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VAF	D2,D2,T2		# +K[3]+2
@@ -754,7 +754,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C1,C1,BEPERM
	VPERM	D0,D1,D1,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VLM	A1,D1,0,INP,0
@@ -780,7 +780,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C2,C2,BEPERM
	VPERM	D0,D2,D2,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VLM	A1,D1,0,INP,0
@@ -807,7 +807,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C3,C3,BEPERM
	VPERM	D0,D3,D3,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VAF	D3,D2,T1		# K[3]+4
@@ -837,7 +837,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C4,C4,BEPERM
	VPERM	D0,D4,D4,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VLM	A1,D1,0,INP,0
@@ -864,7 +864,7 @@ ENTRY(chacha20_vx)
	VPERM	C0,C5,C5,BEPERM
	VPERM	D0,D5,D5,BEPERM

	.insn	rilu,0xc20e00000000,LEN,0x40	# clgfi LEN,0x40
	clgfi	LEN,0x40
	jl	.Ltail_vx

	VLM	A1,D1,0,INP,0
Loading