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

 - Add sorting of mcount locations at build time

 - Rework uaccess functions with C exception handling to shorten inline
   assembly size and enable full inlining. This yields near-optimal code
   for small constant copies with a ~40kb kernel size increase

 - Add support for a configurable STRICT_MM_TYPECHECKS which allows to
   generate better code, but also allows to have type checking for debug
   builds

 - Optimize get_lowcore() for common callers with alternatives that
   nearly revert to the pre-relocated lowcore code, while also slightly
   reducing syscall entry and exit time

 - Convert MACHINE_HAS_* checks for single facility tests into cpu_has_*
   style macros that call test_facility(), and for features with
   additional conditions, add a new ALT_TYPE_FEATURE alternative to
   provide a static branch via alternative patching. Also, move machine
   feature detection to the decompressor for early patching and add
   debugging functionality to easily show which alternatives are patched

 - Add exception table support to early boot / startup code to get rid
   of the open coded exception handling

 - Use asm_inline for all inline assemblies with EX_TABLE or ALTERNATIVE
   to ensure correct inlining and unrolling decisions

 - Remove 2k page table leftovers now that s390 has been switched to
   always allocate 4k page tables

 - Split kfence pool into 4k mappings in arch_kfence_init_pool() and
   remove the architecture-specific kfence_split_mapping()

 - Use READ_ONCE_NOCHECK() in regs_get_kernel_stack_nth() to silence
   spurious KASAN warnings from opportunistic ftrace argument tracing

 - Force __atomic_add_const() variants on s390 to always return void,
   ensuring compile errors for improper usage

 - Remove s390's ioremap_wt() and pgprot_writethrough() due to
   mismatched semantics and lack of known users, relying on asm-generic
   fallbacks

 - Signal eventfd in vfio-ap to notify userspace when the guest AP
   configuration changes, including during mdev removal

 - Convert mdev_types from an array to a pointer in vfio-ccw and vfio-ap
   drivers to avoid fake flex array confusion

 - Cleanup trap code

 - Remove references to the outdated linux390@de.ibm.com address

 - Other various small fixes and improvements all over the code

* tag 's390-6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (78 commits)
  s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies
  s390/kfence: Split kfence pool into 4k mappings in arch_kfence_init_pool()
  s390/ptrace: Avoid KASAN false positives in regs_get_kernel_stack_nth()
  s390/boot: Ignore vmlinux.map
  s390/sysctl: Remove "vm/allocate_pgste" sysctl
  s390: Remove 2k vs 4k page table leftovers
  s390/tlb: Use mm_has_pgste() instead of mm_alloc_pgste()
  s390/lowcore: Use lghi instead llilh to clear register
  s390/syscall: Merge __do_syscall() and do_syscall()
  s390/spinlock: Implement SPINLOCK_LOCKVAL with inline assembly
  s390/smp: Implement raw_smp_processor_id() with inline assembly
  s390/current: Implement current with inline assembly
  s390/lowcore: Use inline qualifier for get_lowcore() inline assembly
  s390: Move s390 sysctls into their own file under arch/s390
  s390/syscall: Simplify syscall_get_arguments()
  s390/vfio-ap: Notify userspace that guest's AP config changed when mdev removed
  s390: Remove ioremap_wt() and pgprot_writethrough()
  s390/mm: Add configurable STRICT_MM_TYPECHECKS
  s390/mm: Convert pgste_val() into function
  s390/mm: Convert pgprot_val() into function
  ...
parents 1fa753c7 0dafe996
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ config S390
	imply IMA_SECURE_AND_OR_TRUSTED_BOOT
	select ALTERNATE_USER_ADDRESS_SPACE
	select ARCH_32BIT_USTAT_F_TINODE
	select ARCH_BINFMT_ELF_STATE
	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
	select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
	select ARCH_ENABLE_MEMORY_HOTREMOVE
@@ -183,6 +182,7 @@ config S390
	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
	select HAVE_ARCH_VMAP_STACK
	select HAVE_ASM_MODVERSIONS
	select HAVE_BUILDTIME_MCOUNT_SORT
	select HAVE_CMPXCHG_DOUBLE
	select HAVE_CMPXCHG_LOCAL
	select HAVE_DEBUG_KMEMLEAK
+10 −0
Original line number Diff line number Diff line
@@ -13,6 +13,16 @@ config DEBUG_ENTRY

	  If unsure, say N.

config STRICT_MM_TYPECHECKS
	bool "Strict Memory Management Type Checks"
	depends on DEBUG_KERNEL
	help
	  Enable strict type checking for memory management types like pte_t
	  and pmd_t. This generates slightly worse code and should be used
	  for debug builds.

	  If unsure, say N.

config CIO_INJECT
	bool "CIO Inject interfaces"
	depends on DEBUG_KERNEL && DEBUG_FS
+1 −0
Original line number Diff line number Diff line
@@ -5,4 +5,5 @@ relocs.S
section_cmp.*
vmlinux
vmlinux.lds
vmlinux.map
vmlinux.syms
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ 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
obj-y	+= version.o pgm_check.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
+135 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#define boot_fmt(fmt)	"alt: " fmt
#include "boot.h"

#define a_debug		boot_debug

#include "../kernel/alternative.c"

static void alt_debug_all(int type)
{
	int i;

	switch (type) {
	case ALT_TYPE_FACILITY:
		for (i = 0; i < ARRAY_SIZE(alt_debug.facilities); i++)
			alt_debug.facilities[i] = -1UL;
		break;
	case ALT_TYPE_FEATURE:
		for (i = 0; i < ARRAY_SIZE(alt_debug.mfeatures); i++)
			alt_debug.mfeatures[i] = -1UL;
		break;
	case ALT_TYPE_SPEC:
		alt_debug.spec = 1;
		break;
	}
}

static void alt_debug_modify(int type, unsigned int nr, bool clear)
{
	switch (type) {
	case ALT_TYPE_FACILITY:
		if (clear)
			__clear_facility(nr, alt_debug.facilities);
		else
			__set_facility(nr, alt_debug.facilities);
		break;
	case ALT_TYPE_FEATURE:
		if (clear)
			__clear_machine_feature(nr, alt_debug.mfeatures);
		else
			__set_machine_feature(nr, alt_debug.mfeatures);
		break;
	}
}

static char *alt_debug_parse(int type, char *str)
{
	unsigned long val, endval;
	char *endp;
	bool clear;
	int i;

	if (*str == ':') {
		str++;
	} else {
		alt_debug_all(type);
		return str;
	}
	clear = false;
	if (*str == '!') {
		alt_debug_all(type);
		clear = true;
		str++;
	}
	while (*str) {
		val = simple_strtoull(str, &endp, 0);
		if (str == endp)
			break;
		str = endp;
		if (*str == '-') {
			str++;
			endval = simple_strtoull(str, &endp, 0);
			if (str == endp)
				break;
			str = endp;
			while (val <= endval) {
				alt_debug_modify(type, val, clear);
				val++;
			}
		} else {
			alt_debug_modify(type, val, clear);
		}
		if (*str != ',')
			break;
		str++;
	}
	return str;
}

/*
 * Use debug-alternative command line parameter for debugging:
 * "debug-alternative"
 *  -> print debug message for every single alternative
 *
 * "debug-alternative=0;2"
 * -> print debug message for all alternatives with type 0 and 2
 *
 * "debug-alternative=0:0-7"
 * -> print debug message for all alternatives with type 0 and with
 *    facility numbers within the range of 0-7
 *    (if type 0 is ALT_TYPE_FACILITY)
 *
 * "debug-alternative=0:!8;1"
 * -> print debug message for all alternatives with type 0, for all
 *    facility number, except facility 8, and in addition print all
 *    alternatives with type 1
 */
void alt_debug_setup(char *str)
{
	unsigned long type;
	char *endp;
	int i;

	if (!str) {
		alt_debug_all(ALT_TYPE_FACILITY);
		alt_debug_all(ALT_TYPE_FEATURE);
		alt_debug_all(ALT_TYPE_SPEC);
		return;
	}
	while (*str) {
		type = simple_strtoull(str, &endp, 0);
		if (str == endp)
			break;
		str = endp;
		switch (type) {
		case ALT_TYPE_FACILITY:
		case ALT_TYPE_FEATURE:
			str = alt_debug_parse(type, str);
			break;
		case ALT_TYPE_SPEC:
			alt_debug_all(ALT_TYPE_SPEC);
			break;
		}
		if (*str != ';')
			break;
		str++;
	}
}
Loading