Commit 1ec6d097 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 7856a565 9fed8d7c
Loading
Loading
Loading
Loading
+26 −10
Original line number Diff line number Diff line
@@ -514,6 +514,26 @@ config SCHED_TOPOLOGY
	  making when dealing with machines that have multi-threading,
	  multiple cores or multiple books.

config SCHED_TOPOLOGY_VERTICAL
	def_bool y
	bool "Use vertical CPU polarization by default"
	depends on SCHED_TOPOLOGY
	help
	  Use vertical CPU polarization by default if available.
	  The default CPU polarization is horizontal.

config HIPERDISPATCH_ON
	def_bool y
	bool "Use hiperdispatch on vertical polarization by default"
	depends on SCHED_TOPOLOGY
	depends on PROC_SYSCTL
	help
	  Hiperdispatch aims to improve the CPU scheduler's decision
	  making when using vertical polarization by adjusting CPU
	  capacities dynamically. Set this option to use hiperdispatch
	  on vertical polarization by default. This can be overwritten
	  by sysctl's s390.hiperdispatch attribute later on.

source "kernel/Kconfig.hz"

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

config EXPOLINE_EXTERN
	def_bool y if EXPOLINE
	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."
	def_bool EXPOLINE && CC_IS_GCC && GCC_VERSION >= 110200 && \
		 $(success,$(srctree)/arch/s390/tools/gcc-thunk-extern.sh $(CC))
	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.
	  Generate expolines as external functions if the compiler supports it.
	  This option is required for some tooling like kpatch, if expolines
	  are enabled. The kernel is compiled with
	  -mindirect-branch=thunk-extern, which requires a newer compiler.

choice
	prompt "Expoline default"
+38 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
# ===========================================================================
# Post-link s390 pass
# ===========================================================================
#
# 1. Separate relocations from vmlinux into relocs.S.
# 2. Strip relocations from vmlinux.

PHONY := __archpost
__archpost:

-include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include

CMD_RELOCS=arch/s390/tools/relocs
OUT_RELOCS = arch/s390/boot
quiet_cmd_relocs = RELOCS  $(OUT_RELOCS)/relocs.S
      cmd_relocs = \
	mkdir -p $(OUT_RELOCS); \
	$(CMD_RELOCS) $@ > $(OUT_RELOCS)/relocs.S

quiet_cmd_strip_relocs = RSTRIP  $@
      cmd_strip_relocs = \
	$(OBJCOPY) --remove-section='.rel.*' --remove-section='.rel__*' \
		   --remove-section='.rela.*' --remove-section='.rela__*' $@

vmlinux: FORCE
	$(call cmd,relocs)
	$(call cmd,strip_relocs)

clean:
	@rm -f $(OUT_RELOCS)/relocs.S

PHONY += FORCE clean

FORCE:

.PHONY: $(PHONY)
+11 −25
Original line number Diff line number Diff line
@@ -11,35 +11,23 @@ KASAN_SANITIZE := n
KCSAN_SANITIZE := n
KMSAN_SANITIZE := n

KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)

#
# Use minimum architecture for als.c to be able to print an error
# Use minimum architecture level so it is possible to print an error
# message if the kernel is started on a machine which is too old
#
ifndef CONFIG_CC_IS_CLANG
CC_FLAGS_MARCH_MINIMUM := -march=z900
else
CC_FLAGS_MARCH_MINIMUM := -march=z10
endif

ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
AFLAGS_REMOVE_head.o		+= $(CC_FLAGS_MARCH)
AFLAGS_head.o			+= $(CC_FLAGS_MARCH_MINIMUM)
AFLAGS_REMOVE_mem.o		+= $(CC_FLAGS_MARCH)
AFLAGS_mem.o			+= $(CC_FLAGS_MARCH_MINIMUM)
CFLAGS_REMOVE_als.o		+= $(CC_FLAGS_MARCH)
CFLAGS_als.o			+= $(CC_FLAGS_MARCH_MINIMUM)
CFLAGS_REMOVE_sclp_early_core.o	+= $(CC_FLAGS_MARCH)
CFLAGS_sclp_early_core.o	+= $(CC_FLAGS_MARCH_MINIMUM)
endif

KBUILD_AFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_AFLAGS_DECOMPRESSOR))
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_CFLAGS_DECOMPRESSOR))
KBUILD_AFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
KBUILD_CFLAGS += $(CC_FLAGS_MARCH_MINIMUM)

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

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

CMD_RELOCS=arch/s390/tools/relocs
quiet_cmd_relocs = RELOCS  $@
	cmd_relocs = $(CMD_RELOCS) $< > $@
$(obj)/relocs.S: vmlinux FORCE
	$(call if_changed,relocs)
# relocs.S is created by the vmlinux postlink step.
$(obj)/relocs.S: vmlinux
	@true

suffix-$(CONFIG_KERNEL_GZIP)  := .gz
suffix-$(CONFIG_KERNEL_BZIP2) := .bz2
+8 −41
Original line number Diff line number Diff line
@@ -9,42 +9,8 @@
#include <asm/sclp.h>
#include "boot.h"

/*
 * The code within this file will be called very early. It may _not_
 * access anything within the bss section, since that is not cleared
 * yet and may contain data (e.g. initrd) that must be saved by other
 * code.
 * For temporary objects the stack (16k) should be used.
 */

static unsigned long als[] = { FACILITIES_ALS };

static void u16_to_hex(char *str, u16 val)
{
	int i, num;

	for (i = 1; i <= 4; i++) {
		num = (val >> (16 - 4 * i)) & 0xf;
		if (num >= 10)
			num += 7;
		*str++ = '0' + num;
	}
	*str = '\0';
}

static void print_machine_type(void)
{
	static char mach_str[80] = "Detected machine-type number: ";
	char type_str[5];
	struct cpuid id;

	get_cpu_id(&id);
	u16_to_hex(type_str, id.machine);
	strcat(mach_str, type_str);
	strcat(mach_str, "\n");
	sclp_early_printk(mach_str);
}

static void u16_to_decimal(char *str, u16 val)
{
	int div = 1;
@@ -80,8 +46,7 @@ void print_missing_facilities(void)
			 * z/VM adds a four character prefix.
			 */
			if (strlen(als_str) > 70) {
				strcat(als_str, "\n");
				sclp_early_printk(als_str);
				boot_printk("%s\n", als_str);
				*als_str = '\0';
			}
			u16_to_decimal(val_str, i * BITS_PER_LONG + j);
@@ -89,16 +54,18 @@ void print_missing_facilities(void)
			first = 0;
		}
	}
	strcat(als_str, "\n");
	sclp_early_printk(als_str);
	boot_printk("%s\n", als_str);
}

static void facility_mismatch(void)
{
	sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
	print_machine_type();
	struct cpuid id;

	get_cpu_id(&id);
	boot_printk("The Linux kernel requires more recent processor hardware\n");
	boot_printk("Detected machine-type number: %4x\n", id.machine);
	print_missing_facilities();
	sclp_early_printk("See Principles of Operations for facility bits\n");
	boot_printk("See Principles of Operations for facility bits\n");
	disabled_wait();
}

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ void print_pgm_check_info(void);
unsigned long randomize_within_range(unsigned long size, unsigned long align,
				     unsigned long min, unsigned long max);
void setup_vmem(unsigned long kernel_start, unsigned long kernel_end, unsigned long asce_limit);
void __printf(1, 2) decompressor_printk(const char *fmt, ...);
void __printf(1, 2) boot_printk(const char *fmt, ...);
void print_stacktrace(unsigned long sp);
void error(char *m);
int get_random(unsigned long limit, unsigned long *value);
Loading