Skip to content

Commit 1ec6d09

Browse files
committed
Merge tag 's390-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik: - Optimize ftrace and kprobes code patching and avoid stop machine for kprobes if sequential instruction fetching facility is available - Add hiperdispatch feature to dynamically adjust CPU capacity in vertical polarization to improve scheduling efficiency and overall performance. Also add infrastructure for handling warning track interrupts (WTI), allowing for graceful CPU preemption - Rework crypto code pkey module and split it into separate, independent modules for sysfs, PCKMO, CCA, and EP11, allowing modules to load only when the relevant hardware is available - Add hardware acceleration for HMAC modes and the full AES-XTS cipher, utilizing message-security assist extensions (MSA) 10 and 11. It introduces new shash implementations for HMAC-SHA224/256/384/512 and registers the hardware-accelerated AES-XTS cipher as the preferred option. Also add clear key token support - Add MSA 10 and 11 processor activity instrumentation counters to perf and update PAI Extension 1 NNPA counters - Cleanup cpu sampling facility code and rework debug/WARN_ON_ONCE statements - Add support for SHA3 performance enhancements introduced with MSA 12 - Add support for the query authentication information feature of MSA 13 and introduce the KDSA CPACF instruction. Provide query and query authentication information in sysfs, enabling tools like cpacfinfo to present this data in a human-readable form - Update kernel disassembler instructions - Always enable EXPOLINE_EXTERN if supported by the compiler to ensure kpatch compatibility - Add missing warning handling and relocated lowcore support to the early program check handler - Optimize ftrace_return_address() and avoid calling unwinder - Make modules use kernel ftrace trampolines - Strip relocs from the final vmlinux ELF file to make it roughly 2 times smaller - Dump register contents and call trace for early crashes to the console - Generate ptdump address marker array dynamically - Fix rcu_sched stalls that might occur when adding or removing large amounts of pages at once to or from the CMM balloon - Fix deadlock caused by recursive lock of the AP bus scan mutex - Unify sync and async register save areas in entry code - Cleanup debug prints in crypto code - Various cleanup and sanitizing patches for the decompressor - Various small ftrace cleanups * tag 's390-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (84 commits) s390/crypto: Display Query and Query Authentication Information in sysfs s390/crypto: Add Support for Query Authentication Information s390/crypto: Rework RRE and RRF CPACF inline functions s390/crypto: Add KDSA CPACF Instruction s390/disassembler: Remove duplicate instruction format RSY_RDRU s390/boot: Move boot_printk() code to own file s390/boot: Use boot_printk() instead of sclp_early_printk() s390/boot: Rename decompressor_printk() to boot_printk() s390/boot: Compile all files with the same march flag s390: Use MARCH_HAS_*_FEATURES defines s390: Provide MARCH_HAS_*_FEATURES defines s390/facility: Disable compile time optimization for decompressor code s390/boot: Increase minimum architecture to z10 s390/als: Remove obsolete comment s390/sha3: Fix SHA3 selftests failures s390/pkey: Add AES xts and HMAC clear key token support s390/cpacf: Add MSA 10 and 11 new PCKMO functions s390/mm: Add cond_resched() to cmm_alloc/free_pages() s390/pai_ext: Update PAI extension 1 counters s390/pai_crypto: Add support for MSA 10 and 11 pai counters ...
2 parents 7856a56 + 9fed8d7 commit 1ec6d09

Some content is hidden

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

92 files changed

+6108
-3070
lines changed

arch/s390/Kconfig

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,26 @@ config SCHED_TOPOLOGY
514514
making when dealing with machines that have multi-threading,
515515
multiple cores or multiple books.
516516

517+
config SCHED_TOPOLOGY_VERTICAL
518+
def_bool y
519+
bool "Use vertical CPU polarization by default"
520+
depends on SCHED_TOPOLOGY
521+
help
522+
Use vertical CPU polarization by default if available.
523+
The default CPU polarization is horizontal.
524+
525+
config HIPERDISPATCH_ON
526+
def_bool y
527+
bool "Use hiperdispatch on vertical polarization by default"
528+
depends on SCHED_TOPOLOGY
529+
depends on PROC_SYSCTL
530+
help
531+
Hiperdispatch aims to improve the CPU scheduler's decision
532+
making when using vertical polarization by adjusting CPU
533+
capacities dynamically. Set this option to use hiperdispatch
534+
on vertical polarization by default. This can be overwritten
535+
by sysctl's s390.hiperdispatch attribute later on.
536+
517537
source "kernel/Kconfig.hz"
518538

519539
config CERT_STORE
@@ -558,17 +578,13 @@ config EXPOLINE
558578
If unsure, say N.
559579

560580
config EXPOLINE_EXTERN
561-
def_bool y if EXPOLINE
562-
depends on EXPOLINE
563-
depends on CC_IS_GCC && GCC_VERSION >= 110200
564-
depends on $(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
565-
prompt "Generate expolines as extern functions."
581+
def_bool EXPOLINE && CC_IS_GCC && GCC_VERSION >= 110200 && \
582+
$(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
566583
help
567-
This option is required for some tooling like kpatch. The kernel is
568-
compiled with -mindirect-branch=thunk-extern and requires a newer
569-
compiler.
570-
571-
If unsure, say N.
584+
Generate expolines as external functions if the compiler supports it.
585+
This option is required for some tooling like kpatch, if expolines
586+
are enabled. The kernel is compiled with
587+
-mindirect-branch=thunk-extern, which requires a newer compiler.
572588

573589
choice
574590
prompt "Expoline default"

arch/s390/Makefile.postlink

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# ===========================================================================
3+
# Post-link s390 pass
4+
# ===========================================================================
5+
#
6+
# 1. Separate relocations from vmlinux into relocs.S.
7+
# 2. Strip relocations from vmlinux.
8+
9+
PHONY := __archpost
10+
__archpost:
11+
12+
-include include/config/auto.conf
13+
include $(srctree)/scripts/Kbuild.include
14+
15+
CMD_RELOCS=arch/s390/tools/relocs
16+
OUT_RELOCS = arch/s390/boot
17+
quiet_cmd_relocs = RELOCS $(OUT_RELOCS)/relocs.S
18+
cmd_relocs = \
19+
mkdir -p $(OUT_RELOCS); \
20+
$(CMD_RELOCS) $@ > $(OUT_RELOCS)/relocs.S
21+
22+
quiet_cmd_strip_relocs = RSTRIP $@
23+
cmd_strip_relocs = \
24+
$(OBJCOPY) --remove-section='.rel.*' --remove-section='.rel__*' \
25+
--remove-section='.rela.*' --remove-section='.rela__*' $@
26+
27+
vmlinux: FORCE
28+
$(call cmd,relocs)
29+
$(call cmd,strip_relocs)
30+
31+
clean:
32+
@rm -f $(OUT_RELOCS)/relocs.S
33+
34+
PHONY += FORCE clean
35+
36+
FORCE:
37+
38+
.PHONY: $(PHONY)

arch/s390/boot/Makefile

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,23 @@ KASAN_SANITIZE := n
1111
KCSAN_SANITIZE := n
1212
KMSAN_SANITIZE := n
1313

14-
KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
15-
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
16-
1714
#
18-
# Use minimum architecture for als.c to be able to print an error
15+
# Use minimum architecture level so it is possible to print an error
1916
# message if the kernel is started on a machine which is too old
2017
#
21-
ifndef CONFIG_CC_IS_CLANG
22-
CC_FLAGS_MARCH_MINIMUM := -march=z900
23-
else
2418
CC_FLAGS_MARCH_MINIMUM := -march=z10
25-
endif
26-
27-
ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
28-
AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH)
29-
AFLAGS_head.o += $(CC_FLAGS_MARCH_MINIMUM)
30-
AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH)
31-
AFLAGS_mem.o += $(CC_FLAGS_MARCH_MINIMUM)
32-
CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH)
33-
CFLAGS_als.o += $(CC_FLAGS_MARCH_MINIMUM)
34-
CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
35-
CFLAGS_sclp_early_core.o += $(CC_FLAGS_MARCH_MINIMUM)
36-
endif
19+
20+
KBUILD_AFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_AFLAGS_DECOMPRESSOR))
21+
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_CFLAGS_DECOMPRESSOR))
22+
KBUILD_AFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
23+
KBUILD_CFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
3724

3825
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
3926

4027
obj-y := head.o als.o startup.o physmem_info.o ipl_parm.o ipl_report.o vmem.o
4128
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
42-
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o uv.o
29+
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o
30+
obj-y += uv.o printk.o
4331
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
4432
obj-y += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
4533
obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o
@@ -109,11 +97,9 @@ OBJCOPYFLAGS_vmlinux.bin := -O binary --remove-section=.comment --remove-section
10997
$(obj)/vmlinux.bin: vmlinux FORCE
11098
$(call if_changed,objcopy)
11199

112-
CMD_RELOCS=arch/s390/tools/relocs
113-
quiet_cmd_relocs = RELOCS $@
114-
cmd_relocs = $(CMD_RELOCS) $< > $@
115-
$(obj)/relocs.S: vmlinux FORCE
116-
$(call if_changed,relocs)
100+
# relocs.S is created by the vmlinux postlink step.
101+
$(obj)/relocs.S: vmlinux
102+
@true
117103

118104
suffix-$(CONFIG_KERNEL_GZIP) := .gz
119105
suffix-$(CONFIG_KERNEL_BZIP2) := .bz2

arch/s390/boot/als.c

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,8 @@
99
#include <asm/sclp.h>
1010
#include "boot.h"
1111

12-
/*
13-
* The code within this file will be called very early. It may _not_
14-
* access anything within the bss section, since that is not cleared
15-
* yet and may contain data (e.g. initrd) that must be saved by other
16-
* code.
17-
* For temporary objects the stack (16k) should be used.
18-
*/
19-
2012
static unsigned long als[] = { FACILITIES_ALS };
2113

22-
static void u16_to_hex(char *str, u16 val)
23-
{
24-
int i, num;
25-
26-
for (i = 1; i <= 4; i++) {
27-
num = (val >> (16 - 4 * i)) & 0xf;
28-
if (num >= 10)
29-
num += 7;
30-
*str++ = '0' + num;
31-
}
32-
*str = '\0';
33-
}
34-
35-
static void print_machine_type(void)
36-
{
37-
static char mach_str[80] = "Detected machine-type number: ";
38-
char type_str[5];
39-
struct cpuid id;
40-
41-
get_cpu_id(&id);
42-
u16_to_hex(type_str, id.machine);
43-
strcat(mach_str, type_str);
44-
strcat(mach_str, "\n");
45-
sclp_early_printk(mach_str);
46-
}
47-
4814
static void u16_to_decimal(char *str, u16 val)
4915
{
5016
int div = 1;
@@ -80,25 +46,26 @@ void print_missing_facilities(void)
8046
* z/VM adds a four character prefix.
8147
*/
8248
if (strlen(als_str) > 70) {
83-
strcat(als_str, "\n");
84-
sclp_early_printk(als_str);
49+
boot_printk("%s\n", als_str);
8550
*als_str = '\0';
8651
}
8752
u16_to_decimal(val_str, i * BITS_PER_LONG + j);
8853
strcat(als_str, val_str);
8954
first = 0;
9055
}
9156
}
92-
strcat(als_str, "\n");
93-
sclp_early_printk(als_str);
57+
boot_printk("%s\n", als_str);
9458
}
9559

9660
static void facility_mismatch(void)
9761
{
98-
sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
99-
print_machine_type();
62+
struct cpuid id;
63+
64+
get_cpu_id(&id);
65+
boot_printk("The Linux kernel requires more recent processor hardware\n");
66+
boot_printk("Detected machine-type number: %4x\n", id.machine);
10067
print_missing_facilities();
101-
sclp_early_printk("See Principles of Operations for facility bits\n");
68+
boot_printk("See Principles of Operations for facility bits\n");
10269
disabled_wait();
10370
}
10471

arch/s390/boot/boot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void print_pgm_check_info(void);
7070
unsigned long randomize_within_range(unsigned long size, unsigned long align,
7171
unsigned long min, unsigned long max);
7272
void setup_vmem(unsigned long kernel_start, unsigned long kernel_end, unsigned long asce_limit);
73-
void __printf(1, 2) decompressor_printk(const char *fmt, ...);
73+
void __printf(1, 2) boot_printk(const char *fmt, ...);
7474
void print_stacktrace(unsigned long sp);
7575
void error(char *m);
7676
int get_random(unsigned long limit, unsigned long *value);

arch/s390/boot/head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ SYM_CODE_END(startup_normal)
299299
# the save area and does disabled wait with a faulty address.
300300
#
301301
SYM_CODE_START_LOCAL(startup_pgm_check_handler)
302-
stmg %r8,%r15,__LC_SAVE_AREA_SYNC
302+
stmg %r8,%r15,__LC_SAVE_AREA
303303
la %r8,4095
304304
stctg %c0,%c15,__LC_CREGS_SAVE_AREA-4095(%r8)
305305
stmg %r0,%r7,__LC_GPREGS_SAVE_AREA-4095(%r8)
306-
mvc __LC_GPREGS_SAVE_AREA-4095+64(64,%r8),__LC_SAVE_AREA_SYNC
306+
mvc __LC_GPREGS_SAVE_AREA-4095+64(64,%r8),__LC_SAVE_AREA
307307
mvc __LC_PSW_SAVE_AREA-4095(16,%r8),__LC_PGM_OLD_PSW
308308
mvc __LC_RETURN_PSW(16),__LC_PGM_OLD_PSW
309309
ni __LC_RETURN_PSW,0xfc # remove IO and EX bits

arch/s390/boot/ipl_parm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void check_cleared_facilities(void)
215215

216216
for (i = 0; i < ARRAY_SIZE(als); i++) {
217217
if ((stfle_fac_list[i] & als[i]) != als[i]) {
218-
sclp_early_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
218+
boot_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
219219
print_missing_facilities();
220220
break;
221221
}

arch/s390/boot/kaslr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct prng_parm {
3232
static int check_prng(void)
3333
{
3434
if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG)) {
35-
sclp_early_printk("KASLR disabled: CPU has no PRNG\n");
35+
boot_printk("KASLR disabled: CPU has no PRNG\n");
3636
return 0;
3737
}
3838
if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))

0 commit comments

Comments
 (0)