Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3591b195 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 updates from Martin Schwidefsky:

 - A copy of Arnds compat wrapper generation series

 - Pass information about the KVM guest to the host in form the control
   program code and the control program version code

 - Map IOV resources to support PCI physical functions on s390

 - Add vector load and store alignment hints to improve performance

 - Use the "jdd" constraint with gcc 9 to make jump labels working again

 - Remove amode workaround for old z/VM releases from the DCSS code

 - Add support for in-kernel performance measurements using the CPU
   measurement counter facility

 - Introduce a new PMU device cpum_cf_diag to capture counters and store
   thenn as event raw data.

 - Bug fixes and cleanups

* tag 's390-5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (54 commits)
  Revert "s390/cpum_cf: Add kernel message exaplanations"
  s390/dasd: fix read device characteristic with CONFIG_VMAP_STACK=y
  s390/suspend: fix prefix register reset in swsusp_arch_resume
  s390: warn about clearing als implied facilities
  s390: allow overriding facilities via command line
  s390: clean up redundant facilities list setup
  s390/als: remove duplicated in-place implementation of stfle
  s390/cio: Use cpa range elsewhere within vfio-ccw
  s390/cio: Fix vfio-ccw handling of recursive TICs
  s390: vfio_ap: link the vfio_ap devices to the vfio_ap bus subsystem
  s390/cpum_cf: Handle EBUSY return code from CPU counter facility reservation
  s390/cpum_cf: Add kernel message exaplanations
  s390/cpum_cf_diag: Add support for s390 counter facility diagnostic trace
  s390/cpum_cf: add ctr_stcctm() function
  s390/cpum_cf: move common functions into a separate file
  s390/cpum_cf: introduce kernel_cpumcf_avail() function
  s390/cpu_mf: replace stcctm5() with the stcctm() function
  s390/cpu_mf: add store cpu counter multiple instruction support
  s390/cpum_cf: Add minimal in-kernel interface for counter measurements
  s390/cpum_cf: introduce kernel_cpumcf_alert() to obtain measurement alerts
  ...
parents 45f5532a fcc082f3
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -75,6 +75,7 @@ config S390
	select ARCH_HAS_SET_MEMORY
	select ARCH_HAS_SET_MEMORY
	select ARCH_HAS_STRICT_KERNEL_RWX
	select ARCH_HAS_STRICT_KERNEL_RWX
	select ARCH_HAS_STRICT_MODULE_RWX
	select ARCH_HAS_STRICT_MODULE_RWX
	select ARCH_HAS_SYSCALL_WRAPPER
	select ARCH_HAS_UBSAN_SANITIZE_ALL
	select ARCH_HAS_UBSAN_SANITIZE_ALL
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
	select ARCH_INLINE_READ_LOCK
	select ARCH_INLINE_READ_LOCK
@@ -379,6 +380,7 @@ config COMPAT
	select COMPAT_BINFMT_ELF if BINFMT_ELF
	select COMPAT_BINFMT_ELF if BINFMT_ELF
	select ARCH_WANT_OLD_COMPAT_IPC
	select ARCH_WANT_OLD_COMPAT_IPC
	select COMPAT_OLD_SIGACTION
	select COMPAT_OLD_SIGACTION
	select HAVE_UID16
	depends on MULTIUSER
	depends on MULTIUSER
	help
	help
	  Select this option if you want to enable your system kernel to
	  Select this option if you want to enable your system kernel to
+4 −16
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@
#include <asm/facility.h>
#include <asm/facility.h>
#include <asm/lowcore.h>
#include <asm/lowcore.h>
#include <asm/sclp.h>
#include <asm/sclp.h>
#include "boot.h"


/*
/*
 * The code within this file will be called very early. It may _not_
 * The code within this file will be called very early. It may _not_
@@ -58,7 +59,7 @@ static void u16_to_decimal(char *str, u16 val)
	*str = '\0';
	*str = '\0';
}
}


static void print_missing_facilities(void)
void print_missing_facilities(void)
{
{
	static char als_str[80] = "Missing facilities: ";
	static char als_str[80] = "Missing facilities: ";
	unsigned long val;
	unsigned long val;
@@ -90,7 +91,6 @@ static void print_missing_facilities(void)
	}
	}
	strcat(als_str, "\n");
	strcat(als_str, "\n");
	sclp_early_printk(als_str);
	sclp_early_printk(als_str);
	sclp_early_printk("See Principles of Operations for facility bits\n");
}
}


static void facility_mismatch(void)
static void facility_mismatch(void)
@@ -98,6 +98,7 @@ static void facility_mismatch(void)
	sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
	sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
	print_machine_type();
	print_machine_type();
	print_missing_facilities();
	print_missing_facilities();
	sclp_early_printk("See Principles of Operations for facility bits\n");
	disabled_wait(0x8badcccc);
	disabled_wait(0x8badcccc);
}
}


@@ -105,20 +106,7 @@ void verify_facilities(void)
{
{
	int i;
	int i;


	for (i = 0; i < ARRAY_SIZE(S390_lowcore.stfle_fac_list); i++)
	__stfle(S390_lowcore.stfle_fac_list, ARRAY_SIZE(S390_lowcore.stfle_fac_list));
		S390_lowcore.stfle_fac_list[i] = 0;
	asm volatile(
		"	stfl	0(0)\n"
		: "=m" (S390_lowcore.stfl_fac_list));
	S390_lowcore.stfle_fac_list[0] = (u64)S390_lowcore.stfl_fac_list << 32;
	if (S390_lowcore.stfl_fac_list & 0x01000000) {
		register unsigned long reg0 asm("0") = ARRAY_SIZE(als) - 1;

		asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
			     : "+d" (reg0)
			     : "a" (&S390_lowcore.stfle_fac_list)
			     : "memory", "cc");
	}
	for (i = 0; i < ARRAY_SIZE(als); i++) {
	for (i = 0; i < ARRAY_SIZE(als); i++) {
		if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i])
		if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i])
			facility_mismatch();
			facility_mismatch();
+2 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,8 @@ void startup_kernel(void);
void detect_memory(void);
void detect_memory(void);
void store_ipl_parmblock(void);
void store_ipl_parmblock(void);
void setup_boot_command_line(void);
void setup_boot_command_line(void);
void parse_boot_command_line(void);
void setup_memory_end(void);
void setup_memory_end(void);
void print_missing_facilities(void);


#endif /* BOOT_BOOT_H */
#endif /* BOOT_BOOT_H */
+64 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/ctype.h>
#include <linux/ctype.h>
#include <asm/ebcdic.h>
#include <asm/ebcdic.h>
#include <asm/sclp.h>
#include <asm/sclp.h>
#include <asm/sections.h>
#include <asm/sections.h>
#include <asm/boot_data.h>
#include <asm/boot_data.h>
#include <asm/facility.h>
#include "boot.h"
#include "boot.h"


char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
@@ -143,8 +145,66 @@ void setup_boot_command_line(void)
		append_ipl_block_parm();
		append_ipl_block_parm();
}
}


static void modify_facility(unsigned long nr, bool clear)
{
	if (clear)
		__clear_facility(nr, S390_lowcore.stfle_fac_list);
	else
		__set_facility(nr, S390_lowcore.stfle_fac_list);
}

static void check_cleared_facilities(void)
{
	unsigned long als[] = { FACILITIES_ALS };
	int i;

	for (i = 0; i < ARRAY_SIZE(als); i++) {
		if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i]) {
			sclp_early_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
			print_missing_facilities();
			break;
		}
	}
}

static void modify_fac_list(char *str)
{
	unsigned long val, endval;
	char *endp;
	bool clear;

	while (*str) {
		clear = false;
		if (*str == '!') {
			clear = true;
			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) {
				modify_facility(val, clear);
				val++;
			}
		} else {
			modify_facility(val, clear);
		}
		if (*str != ',')
			break;
		str++;
	}
	check_cleared_facilities();
}

static char command_line_buf[COMMAND_LINE_SIZE] __section(.data);
static char command_line_buf[COMMAND_LINE_SIZE] __section(.data);
static void parse_mem_opt(void)
void parse_boot_command_line(void)
{
{
	char *param, *val;
	char *param, *val;
	bool enabled;
	bool enabled;
@@ -165,12 +225,14 @@ static void parse_mem_opt(void)
			if (!rc && !enabled)
			if (!rc && !enabled)
				noexec_disabled = 1;
				noexec_disabled = 1;
		}
		}

		if (!strcmp(param, "facilities"))
			modify_fac_list(val);
	}
	}
}
}


void setup_memory_end(void)
void setup_memory_end(void)
{
{
	parse_mem_opt();
#ifdef CONFIG_CRASH_DUMP
#ifdef CONFIG_CRASH_DUMP
	if (!OLDMEM_BASE && early_ipl_block_valid &&
	if (!OLDMEM_BASE && early_ipl_block_valid &&
	    early_ipl_block.hdr.pbt == DIAG308_IPL_TYPE_FCP &&
	    early_ipl_block.hdr.pbt == DIAG308_IPL_TYPE_FCP &&
+1 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,7 @@ void startup_kernel(void)
	sclp_early_read_info();
	sclp_early_read_info();
	store_ipl_parmblock();
	store_ipl_parmblock();
	setup_boot_command_line();
	setup_boot_command_line();
	parse_boot_command_line();
	setup_memory_end();
	setup_memory_end();
	detect_memory();
	detect_memory();
	if (!IS_ENABLED(CONFIG_KERNEL_UNCOMPRESSED)) {
	if (!IS_ENABLED(CONFIG_KERNEL_UNCOMPRESSED)) {
Loading