Skip to content

Commit d710d37

Browse files
committed
Merge tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
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 ...
2 parents 744465d + c65f677 commit d710d37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1831
-1426
lines changed

MAINTAINERS

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17019,9 +17019,7 @@ L: [email protected]
1701917019
S: Supported
1702017020
W: http://www.ibm.com/developerworks/linux/linux390/
1702117021
F: Documentation/s390/vfio-ap.rst
17022-
F: drivers/s390/crypto/vfio_ap_drv.c
17023-
F: drivers/s390/crypto/vfio_ap_ops.c
17024-
F: drivers/s390/crypto/vfio_ap_private.h
17022+
F: drivers/s390/crypto/vfio_ap*
1702517023

1702617024
S390 VFIO-CCW DRIVER
1702717025
M: Eric Farman <[email protected]>

arch/s390/Kconfig

Lines changed: 17 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ config S390
122122
select ARCH_WANT_IPC_PARSE_VERSION
123123
select BUILDTIME_TABLE_SORT
124124
select CLONE_BACKWARDS2
125-
select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
126125
select DMA_OPS if PCI
127126
select DYNAMIC_FTRACE if FUNCTION_TRACER
128127
select GENERIC_ALLOCATOR
@@ -157,7 +156,7 @@ config S390
157156
select HAVE_DYNAMIC_FTRACE_WITH_ARGS
158157
select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
159158
select HAVE_DYNAMIC_FTRACE_WITH_REGS
160-
select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
159+
select HAVE_EBPF_JIT if HAVE_MARCH_Z196_FEATURES
161160
select HAVE_EFFICIENT_UNALIGNED_ACCESS
162161
select HAVE_FAST_GUP
163162
select HAVE_FENTRY
@@ -232,20 +231,8 @@ source "kernel/livepatch/Kconfig"
232231

233232
menu "Processor type and features"
234233

235-
config HAVE_MARCH_Z900_FEATURES
236-
def_bool n
237-
238-
config HAVE_MARCH_Z990_FEATURES
239-
def_bool n
240-
select HAVE_MARCH_Z900_FEATURES
241-
242-
config HAVE_MARCH_Z9_109_FEATURES
243-
def_bool n
244-
select HAVE_MARCH_Z990_FEATURES
245-
246234
config HAVE_MARCH_Z10_FEATURES
247235
def_bool n
248-
select HAVE_MARCH_Z9_109_FEATURES
249236

250237
config HAVE_MARCH_Z196_FEATURES
251238
def_bool n
@@ -271,41 +258,13 @@ choice
271258
prompt "Processor type"
272259
default MARCH_Z196
273260

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

310269
config MARCH_Z196
311270
bool "IBM zEnterprise 114 and 196"
@@ -354,15 +313,6 @@ config MARCH_Z15
354313

355314
endchoice
356315

357-
config MARCH_Z900_TUNE
358-
def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT
359-
360-
config MARCH_Z990_TUNE
361-
def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT
362-
363-
config MARCH_Z9_109_TUNE
364-
def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT
365-
366316
config MARCH_Z10_TUNE
367317
def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT
368318

@@ -398,21 +348,8 @@ config TUNE_DEFAULT
398348
Tune the generated code for the target processor for which the kernel
399349
will be compiled.
400350

401-
config TUNE_Z900
402-
bool "IBM zSeries model z800 and z900"
403-
depends on $(cc-option,-mtune=z900)
404-
405-
config TUNE_Z990
406-
bool "IBM zSeries model z890 and z990"
407-
depends on $(cc-option,-mtune=z990)
408-
409-
config TUNE_Z9_109
410-
bool "IBM System z9"
411-
depends on $(cc-option,-mtune=z9-109)
412-
413351
config TUNE_Z10
414352
bool "IBM System z10"
415-
depends on $(cc-option,-mtune=z10)
416353

417354
config TUNE_Z196
418355
bool "IBM zEnterprise 114 and 196"
@@ -587,6 +524,7 @@ config KERNEL_NOBP
587524

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

598536
If unsure, say N.
599537

538+
config EXPOLINE_EXTERN
539+
def_bool n
540+
depends on EXPOLINE
541+
depends on CC_IS_GCC && GCC_VERSION >= 110200
542+
depends on $(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
543+
prompt "Generate expolines as extern functions."
544+
help
545+
This option is required for some tooling like kpatch. The kernel is
546+
compiled with -mindirect-branch=thunk-extern and requires a newer
547+
compiler.
548+
549+
If unsure, say N.
550+
600551
choice
601552
prompt "Expoline default"
602553
depends on EXPOLINE
@@ -658,20 +609,6 @@ config MAX_PHYSMEM_BITS
658609
Increasing the number of bits also increases the kernel image size.
659610
By default 46 bits (64TB) are supported.
660611

661-
config PACK_STACK
662-
def_bool y
663-
prompt "Pack kernel stack"
664-
help
665-
This option enables the compiler option -mkernel-backchain if it
666-
is available. If the option is available the compiler supports
667-
the new stack layout which dramatically reduces the minimum stack
668-
frame size. With an old compiler a non-leaf function needs a
669-
minimum of 96 bytes on 31 bit and 160 bytes on 64 bit. With
670-
-mkernel-backchain the minimum size drops to 16 byte on 31 bit
671-
and 24 byte on 64 bit.
672-
673-
Say Y if you are unsure.
674-
675612
config CHECK_STACK
676613
def_bool y
677614
depends on !VMAP_STACK

arch/s390/Makefile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endif
2121
aflags_dwarf := -Wa,-gdwarf-2
2222
KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
2323
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
24-
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2
24+
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack
2525
KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
2626
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
2727
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
@@ -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
@@ -68,11 +62,6 @@ cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
6862
#
6963
cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
7064

71-
ifneq ($(call cc-option,-mpacked-stack -mbackchain -msoft-float),)
72-
cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK
73-
aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
74-
endif
75-
7665
KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y)
7766
KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y)
7867

@@ -86,14 +75,18 @@ ifneq ($(call cc-option,-mstack-size=8192 -mstack-guard=128),)
8675
endif
8776

8877
ifdef CONFIG_EXPOLINE
89-
ifneq ($(call cc-option,$(CC_FLAGS_MARCH) -mindirect-branch=thunk),)
78+
ifdef CONFIG_EXPOLINE_EXTERN
79+
KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline.o
80+
CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern
81+
CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern
82+
else
9083
CC_FLAGS_EXPOLINE := -mindirect-branch=thunk
9184
CC_FLAGS_EXPOLINE += -mfunction-return=thunk
92-
CC_FLAGS_EXPOLINE += -mindirect-branch-table
93-
export CC_FLAGS_EXPOLINE
94-
cflags-y += $(CC_FLAGS_EXPOLINE) -DCC_USING_EXPOLINE
95-
aflags-y += -DCC_USING_EXPOLINE
9685
endif
86+
CC_FLAGS_EXPOLINE += -mindirect-branch-table
87+
export CC_FLAGS_EXPOLINE
88+
cflags-y += $(CC_FLAGS_EXPOLINE) -DCC_USING_EXPOLINE
89+
aflags-y += -DCC_USING_EXPOLINE
9790
endif
9891

9992
ifdef CONFIG_FUNCTION_TRACER
@@ -111,7 +104,7 @@ endif
111104
# Test CFI features of binutils
112105
cfi := $(call as-instr,.cfi_startproc\n.cfi_val_offset 15$(comma)-160\n.cfi_endproc,-DCONFIG_AS_CFI_VAL_OFFSET=1)
113106

114-
KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y)
107+
KBUILD_CFLAGS += -mpacked-stack -mbackchain -msoft-float $(cflags-y)
115108
KBUILD_CFLAGS += -pipe -Wno-sign-compare
116109
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables $(cfi)
117110
KBUILD_AFLAGS += $(aflags-y) $(cfi)

arch/s390/boot/head.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Author(s): Hartmut Penner <[email protected]>
66
* Martin Schwidefsky <[email protected]>
77
* Rob van der Heij <[email protected]>
8-
* Heiko Carstens <[email protected]>
98
*
109
* There are 5 different IPL methods
1110
* 1) load the image directly into ram at address 0 and do an PSW restart

arch/s390/crypto/chacha-s390.S

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ ENTRY(chacha20_vx_4x)
312312
VPERM XC0,XC0,XC0,BEPERM
313313
VPERM XD0,XD0,XD0,BEPERM
314314

315-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
315+
clgfi LEN,0x40
316316
jl .Ltail_4x
317317

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

342-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
342+
clgfi LEN,0x40
343343
jl .Ltail_4x
344344

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

369-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
369+
clgfi LEN,0x40
370370
jl .Ltail_4x
371371

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

474474
ENTRY(chacha20_vx)
475-
.insn rilu,0xc20e00000000,LEN,256 # clgfi LEN,256
475+
clgfi LEN,256
476476
jle chacha20_vx_4x
477477
stmg %r6,%r7,6*8(SP)
478478

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

728-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
728+
clgfi LEN,0x40
729729
jl .Ltail_vx
730730

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

757-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
757+
clgfi LEN,0x40
758758
jl .Ltail_vx
759759

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

783-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
783+
clgfi LEN,0x40
784784
jl .Ltail_vx
785785

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

810-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
810+
clgfi LEN,0x40
811811
jl .Ltail_vx
812812

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

840-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
840+
clgfi LEN,0x40
841841
jl .Ltail_vx
842842

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

867-
.insn rilu,0xc20e00000000,LEN,0x40 # clgfi LEN,0x40
867+
clgfi LEN,0x40
868868
jl .Ltail_vx
869869

870870
VLM A1,D1,0,INP,0

arch/s390/hypfs/hypfs_vm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/errno.h>
1111
#include <linux/string.h>
1212
#include <linux/vmalloc.h>
13+
#include <asm/extable.h>
1314
#include <asm/diag.h>
1415
#include <asm/ebcdic.h>
1516
#include <asm/timex.h>

arch/s390/include/asm/ap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define _ASM_S390_AP_H_
1414

1515
#include <linux/io.h>
16+
#include <asm/asm-extable.h>
1617

1718
/**
1819
* The ap_qid_t identifier of an ap queue.

0 commit comments

Comments
 (0)