Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Heiko Carstens:
 "Since Martin is on vacation you get the s390 pull request from me:

   - Host large page support for KVM guests. As the patches have large
     impact on arch/s390/mm/ this series goes out via both the KVM and
     the s390 tree.

   - Add an option for no compression to the "Kernel compression mode"
     menu, this will come in handy with the rework of the early boot
     code.

   - A large rework of the early boot code that will make life easier
     for KASAN and KASLR. With the rework the bootable uncompressed
     image is not generated anymore, only the bzImage is available. For
     debuggung purposes the new "no compression" option is used.

   - Re-enable the gcc plugins as the issue with the latent entropy
     plugin is solved with the early boot code rework.

   - More spectre relates changes:
      + Detect the etoken facility and remove expolines automatically.
      + Add expolines to a few more indirect branches.

   - A rewrite of the common I/O layer trace points to make them
     consumable by 'perf stat'.

   - Add support for format-3 PCI function measurement blocks.

   - Changes for the zcrypt driver:
      + Add attributes to indicate the load of cards and queues.
      + Restructure some code for the upcoming AP device support in KVM.

   - Build flags improvements in various Makefiles.

   - A few fixes for the kdump support.

   - A couple of patches for gcc 8 compile warning cleanup.

   - Cleanup s390 specific proc handlers.

   - Add s390 support to the restartable sequence self tests.

   - Some PTR_RET vs PTR_ERR_OR_ZERO cleanup.

   - Lots of bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (107 commits)
  s390/dasd: fix hanging offline processing due to canceled worker
  s390/dasd: fix panic for failed online processing
  s390/mm: fix addressing exception after suspend/resume
  rseq/selftests: add s390 support
  s390: fix br_r1_trampoline for machines without exrl
  s390/lib: use expoline for all bcr instructions
  s390/numa: move initial setup of node_to_cpumask_map
  s390/kdump: Fix elfcorehdr size calculation
  s390/cpum_sf: save TOD clock base in SDBs for time conversion
  KVM: s390: Add huge page enablement control
  s390/mm: Add huge page gmap linking support
  s390/mm: hugetlb pages within a gmap can not be freed
  KVM: s390: Add skey emulation fault handling
  s390/mm: Add huge pmd storage key handling
  s390/mm: Clear skeys for newly mapped huge guest pmds
  s390/mm: Clear huge page storage keys on enable_skey
  s390/mm: Add huge page dirty sync support
  s390/mm: Add gmap pmd invalidation and clearing
  s390/mm: Add gmap pmd notification bit setting
  s390/mm: Add gmap pmd linking
  ...
This commit is contained in:
Linus Torvalds
2018-08-13 19:07:17 -07:00
107 changed files with 2375 additions and 1097 deletions
+16
View File
@@ -4391,6 +4391,22 @@ all such vmexits.
Do not enable KVM_FEATURE_PV_UNHALT if you disable HLT exits. Do not enable KVM_FEATURE_PV_UNHALT if you disable HLT exits.
7.14 KVM_CAP_S390_HPAGE_1M
Architectures: s390
Parameters: none
Returns: 0 on success, -EINVAL if hpage module parameter was not set
or cmma is enabled
With this capability the KVM support for memory backing with 1m pages
through hugetlbfs can be enabled for a VM. After the capability is
enabled, cmma can't be enabled anymore and pfmfi and the storage key
interpretation are disabled. If cmma has already been enabled or the
hpage module parameter is not set to 1, -EINVAL is returned.
While it is generally possible to create a huge page backed VM without
this capability, the VM will not be able to run.
8. Other capabilities. 8. Other capabilities.
---------------------- ----------------------
-1
View File
@@ -12408,7 +12408,6 @@ F: drivers/pci/hotplug/s390_pci_hpc.c
S390 VFIO-CCW DRIVER S390 VFIO-CCW DRIVER
M: Cornelia Huck <cohuck@redhat.com> M: Cornelia Huck <cohuck@redhat.com>
M: Dong Jia Shi <bjsdjshi@linux.ibm.com>
M: Halil Pasic <pasic@linux.ibm.com> M: Halil Pasic <pasic@linux.ibm.com>
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
L: kvm@vger.kernel.org L: kvm@vger.kernel.org
+1
View File
@@ -145,6 +145,7 @@ config S390
select HAVE_KERNEL_LZ4 select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA select HAVE_KERNEL_LZMA
select HAVE_KERNEL_LZO select HAVE_KERNEL_LZO
select HAVE_KERNEL_UNCOMPRESSED
select HAVE_KERNEL_XZ select HAVE_KERNEL_XZ
select HAVE_KPROBES select HAVE_KPROBES
select HAVE_KRETPROBES select HAVE_KRETPROBES
+26 -16
View File
@@ -14,8 +14,18 @@ LD_BFD := elf64-s390
LDFLAGS := -m elf64_s390 LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
KBUILD_AFLAGS += -m64 KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
aflags_dwarf := -Wa,-gdwarf-2
KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
KBUILD_CFLAGS_DECOMPRESSOR := -m64 -O2
KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
UTS_MACHINE := s390x UTS_MACHINE := s390x
STACK_SIZE := 16384 STACK_SIZE := 16384
CHECKFLAGS += -D__s390__ -D__s390x__ CHECKFLAGS += -D__s390__ -D__s390x__
@@ -52,18 +62,14 @@ cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
# #
cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
# old style option for packed stacks
ifeq ($(call cc-option-yn,-mkernel-backchain),y)
cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK
aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
endif
# new style option for packed stacks
ifeq ($(call cc-option-yn,-mpacked-stack),y) ifeq ($(call cc-option-yn,-mpacked-stack),y)
cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK
aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
endif endif
KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y)
KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y)
ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
ifneq ($(call cc-option-yn,-mstack-size=8192),y) ifneq ($(call cc-option-yn,-mstack-size=8192),y)
@@ -71,8 +77,11 @@ cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
endif endif
endif endif
ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) ifdef CONFIG_WARN_DYNAMIC_STACK
cflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
KBUILD_CFLAGS += -mwarn-dynamicstack
KBUILD_CFLAGS_DECOMPRESSOR += -mwarn-dynamicstack
endif
endif endif
ifdef CONFIG_EXPOLINE ifdef CONFIG_EXPOLINE
@@ -82,6 +91,7 @@ ifdef CONFIG_EXPOLINE
CC_FLAGS_EXPOLINE += -mindirect-branch-table CC_FLAGS_EXPOLINE += -mindirect-branch-table
export CC_FLAGS_EXPOLINE export CC_FLAGS_EXPOLINE
cflags-y += $(CC_FLAGS_EXPOLINE) -DCC_USING_EXPOLINE cflags-y += $(CC_FLAGS_EXPOLINE) -DCC_USING_EXPOLINE
aflags-y += -DCC_USING_EXPOLINE
endif endif
endif endif
@@ -102,11 +112,12 @@ KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y)
KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables $(cfi) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables $(cfi)
KBUILD_AFLAGS += $(aflags-y) $(cfi) KBUILD_AFLAGS += $(aflags-y) $(cfi)
export KBUILD_AFLAGS_DECOMPRESSOR
export KBUILD_CFLAGS_DECOMPRESSOR
OBJCOPYFLAGS := -O binary OBJCOPYFLAGS := -O binary
head-y := arch/s390/kernel/head.o head-y := arch/s390/kernel/head64.o
head-y += arch/s390/kernel/head64.o
# See arch/s390/Kbuild for content of core part of the kernel # See arch/s390/Kbuild for content of core part of the kernel
core-y += arch/s390/ core-y += arch/s390/
@@ -121,7 +132,7 @@ boot := arch/s390/boot
syscalls := arch/s390/kernel/syscalls syscalls := arch/s390/kernel/syscalls
tools := arch/s390/tools tools := arch/s390/tools
all: image bzImage all: bzImage
#KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg... #KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg...
KBUILD_IMAGE := $(boot)/bzImage KBUILD_IMAGE := $(boot)/bzImage
@@ -129,7 +140,7 @@ KBUILD_IMAGE := $(boot)/bzImage
install: vmlinux install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@ $(Q)$(MAKE) $(build)=$(boot) $@
image bzImage: vmlinux bzImage: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
zfcpdump: zfcpdump:
@@ -152,8 +163,7 @@ archprepare:
# Don't use tabs in echo arguments # Don't use tabs in echo arguments
define archhelp define archhelp
echo '* image - Kernel image for IPL ($(boot)/image)' echo '* bzImage - Kernel image for IPL ($(boot)/bzImage)'
echo '* bzImage - Compressed kernel image for IPL ($(boot)/bzImage)'
echo ' install - Install kernel using' echo ' install - Install kernel using'
echo ' (your) ~/bin/$(INSTALLKERNEL) or' echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/$(INSTALLKERNEL) or' echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
+45 -77
View File
@@ -206,35 +206,28 @@ static int
appldata_timer_handler(struct ctl_table *ctl, int write, appldata_timer_handler(struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
unsigned int len; int timer_active = appldata_timer_active;
char buf[2]; int zero = 0;
int one = 1;
int rc;
struct ctl_table ctl_entry = {
.procname = ctl->procname,
.data = &timer_active,
.maxlen = sizeof(int),
.extra1 = &zero,
.extra2 = &one,
};
rc = proc_douintvec_minmax(&ctl_entry, write, buffer, lenp, ppos);
if (rc < 0 || !write)
return rc;
if (!*lenp || *ppos) {
*lenp = 0;
return 0;
}
if (!write) {
strncpy(buf, appldata_timer_active ? "1\n" : "0\n",
ARRAY_SIZE(buf));
len = strnlen(buf, ARRAY_SIZE(buf));
if (len > *lenp)
len = *lenp;
if (copy_to_user(buffer, buf, len))
return -EFAULT;
goto out;
}
len = *lenp;
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
return -EFAULT;
spin_lock(&appldata_timer_lock); spin_lock(&appldata_timer_lock);
if (buf[0] == '1') if (timer_active)
__appldata_vtimer_setup(APPLDATA_ADD_TIMER); __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
else if (buf[0] == '0') else
__appldata_vtimer_setup(APPLDATA_DEL_TIMER); __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
spin_unlock(&appldata_timer_lock); spin_unlock(&appldata_timer_lock);
out:
*lenp = len;
*ppos += len;
return 0; return 0;
} }
@@ -248,37 +241,24 @@ static int
appldata_interval_handler(struct ctl_table *ctl, int write, appldata_interval_handler(struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
unsigned int len; int interval = appldata_interval;
int interval; int one = 1;
char buf[16]; int rc;
struct ctl_table ctl_entry = {
.procname = ctl->procname,
.data = &interval,
.maxlen = sizeof(int),
.extra1 = &one,
};
if (!*lenp || *ppos) { rc = proc_dointvec_minmax(&ctl_entry, write, buffer, lenp, ppos);
*lenp = 0; if (rc < 0 || !write)
return 0; return rc;
}
if (!write) {
len = sprintf(buf, "%i\n", appldata_interval);
if (len > *lenp)
len = *lenp;
if (copy_to_user(buffer, buf, len))
return -EFAULT;
goto out;
}
len = *lenp;
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
return -EFAULT;
interval = 0;
sscanf(buf, "%i", &interval);
if (interval <= 0)
return -EINVAL;
spin_lock(&appldata_timer_lock); spin_lock(&appldata_timer_lock);
appldata_interval = interval; appldata_interval = interval;
__appldata_vtimer_setup(APPLDATA_MOD_TIMER); __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
spin_unlock(&appldata_timer_lock); spin_unlock(&appldata_timer_lock);
out:
*lenp = len;
*ppos += len;
return 0; return 0;
} }
@@ -293,10 +273,17 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
struct appldata_ops *ops = NULL, *tmp_ops; struct appldata_ops *ops = NULL, *tmp_ops;
unsigned int len;
int rc, found;
char buf[2];
struct list_head *lh; struct list_head *lh;
int rc, found;
int active;
int zero = 0;
int one = 1;
struct ctl_table ctl_entry = {
.data = &active,
.maxlen = sizeof(int),
.extra1 = &zero,
.extra2 = &one,
};
found = 0; found = 0;
mutex_lock(&appldata_ops_mutex); mutex_lock(&appldata_ops_mutex);
@@ -317,31 +304,15 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
} }
mutex_unlock(&appldata_ops_mutex); mutex_unlock(&appldata_ops_mutex);
if (!*lenp || *ppos) { active = ops->active;
*lenp = 0; rc = proc_douintvec_minmax(&ctl_entry, write, buffer, lenp, ppos);
if (rc < 0 || !write) {
module_put(ops->owner); module_put(ops->owner);
return 0; return rc;
}
if (!write) {
strncpy(buf, ops->active ? "1\n" : "0\n", ARRAY_SIZE(buf));
len = strnlen(buf, ARRAY_SIZE(buf));
if (len > *lenp)
len = *lenp;
if (copy_to_user(buffer, buf, len)) {
module_put(ops->owner);
return -EFAULT;
}
goto out;
}
len = *lenp;
if (copy_from_user(buf, buffer,
len > sizeof(buf) ? sizeof(buf) : len)) {
module_put(ops->owner);
return -EFAULT;
} }
mutex_lock(&appldata_ops_mutex); mutex_lock(&appldata_ops_mutex);
if ((buf[0] == '1') && (ops->active == 0)) { if (active && (ops->active == 0)) {
// protect work queue callback // protect work queue callback
if (!try_module_get(ops->owner)) { if (!try_module_get(ops->owner)) {
mutex_unlock(&appldata_ops_mutex); mutex_unlock(&appldata_ops_mutex);
@@ -359,7 +330,7 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
module_put(ops->owner); module_put(ops->owner);
} else } else
ops->active = 1; ops->active = 1;
} else if ((buf[0] == '0') && (ops->active == 1)) { } else if (!active && (ops->active == 1)) {
ops->active = 0; ops->active = 0;
rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
(unsigned long) ops->data, ops->size, (unsigned long) ops->data, ops->size,
@@ -370,9 +341,6 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
module_put(ops->owner); module_put(ops->owner);
} }
mutex_unlock(&appldata_ops_mutex); mutex_unlock(&appldata_ops_mutex);
out:
*lenp = len;
*ppos += len;
module_put(ops->owner); module_put(ops->owner);
return 0; return 0;
} }
+39 -6
View File
@@ -3,19 +3,52 @@
# Makefile for the linux s390-specific parts of the memory manager. # Makefile for the linux s390-specific parts of the memory manager.
# #
targets := image KCOV_INSTRUMENT := n
targets += bzImage GCOV_PROFILE := n
subdir- := compressed UBSAN_SANITIZE := n
$(obj)/image: vmlinux FORCE KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
$(call if_changed,objcopy) KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
#
# Use -march=z900 for als.c to be able to print an error
# message if the kernel is started on a machine which is too old
#
ifneq ($(CC_FLAGS_MARCH),-march=z900)
AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH)
AFLAGS_head.o += -march=z900
AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH)
AFLAGS_mem.o += -march=z900
CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH)
CFLAGS_als.o += -march=z900
CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
CFLAGS_sclp_early_core.o += -march=z900
endif
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
obj-y := head.o als.o ebcdic.o sclp_early_core.o mem.o
targets := bzImage startup.a $(obj-y)
subdir- := compressed
OBJECTS := $(addprefix $(obj)/,$(obj-y))
$(obj)/bzImage: $(obj)/compressed/vmlinux FORCE $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
$(obj)/compressed/vmlinux: FORCE $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
quiet_cmd_ar = AR $@
cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(filter $(OBJECTS), $^)
$(obj)/startup.a: $(OBJECTS) FORCE
$(call if_changed,ar)
install: $(CONFIGURE) $(obj)/bzImage install: $(CONFIGURE) $(obj)/bzImage
sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
System.map "$(INSTALL_PATH)" System.map "$(INSTALL_PATH)"
chkbss := $(OBJECTS)
chkbss-target := $(obj)/startup.a
include $(srctree)/arch/s390/scripts/Makefile.chkbss
@@ -3,12 +3,10 @@
* Copyright IBM Corp. 2016 * Copyright IBM Corp. 2016
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
#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 "entry.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_
@@ -18,9 +16,9 @@
* For temporary objects the stack (16k) should be used. * For temporary objects the stack (16k) should be used.
*/ */
static unsigned long als[] __initdata = { FACILITIES_ALS }; static unsigned long als[] = { FACILITIES_ALS };
static void __init u16_to_hex(char *str, u16 val) static void u16_to_hex(char *str, u16 val)
{ {
int i, num; int i, num;
@@ -33,9 +31,9 @@ static void __init u16_to_hex(char *str, u16 val)
*str = '\0'; *str = '\0';
} }
static void __init print_machine_type(void) static void print_machine_type(void)
{ {
static char mach_str[80] __initdata = "Detected machine-type number: "; static char mach_str[80] = "Detected machine-type number: ";
char type_str[5]; char type_str[5];
struct cpuid id; struct cpuid id;
@@ -46,7 +44,7 @@ static void __init print_machine_type(void)
sclp_early_printk(mach_str); sclp_early_printk(mach_str);
} }
static void __init u16_to_decimal(char *str, u16 val) static void u16_to_decimal(char *str, u16 val)
{ {
int div = 1; int div = 1;
@@ -60,9 +58,9 @@ static void __init u16_to_decimal(char *str, u16 val)
*str = '\0'; *str = '\0';
} }
static void __init print_missing_facilities(void) static void print_missing_facilities(void)
{ {
static char als_str[80] __initdata = "Missing facilities: "; static char als_str[80] = "Missing facilities: ";
unsigned long val; unsigned long val;
char val_str[6]; char val_str[6];
int i, j, first; int i, j, first;
@@ -95,7 +93,7 @@ static void __init print_missing_facilities(void)
sclp_early_printk("See Principles of Operations for facility bits\n"); sclp_early_printk("See Principles of Operations for facility bits\n");
} }
static void __init facility_mismatch(void) 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();
@@ -103,7 +101,7 @@ static void __init facility_mismatch(void)
disabled_wait(0x8badcccc); disabled_wait(0x8badcccc);
} }
void __init verify_facilities(void) void verify_facilities(void)
{ {
int i; int i;
+1
View File
@@ -1,4 +1,5 @@
sizes.h sizes.h
vmlinux vmlinux
vmlinux.lds vmlinux.lds
vmlinux.scr.lds
vmlinux.bin.full vmlinux.bin.full
+25 -34
View File
@@ -6,39 +6,29 @@
# #
KCOV_INSTRUMENT := n KCOV_INSTRUMENT := n
targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
targets += misc.o piggy.o sizes.h head.o
KBUILD_CFLAGS := -m64 -D__KERNEL__ -O2
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
GCOV_PROFILE := n GCOV_PROFILE := n
UBSAN_SANITIZE := n UBSAN_SANITIZE := n
OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o ebcdic.o als.o) obj-y := $(if $(CONFIG_KERNEL_UNCOMPRESSED),,head.o misc.o) piggy.o
OBJECTS += $(objtree)/drivers/s390/char/sclp_early_core.o targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
targets += vmlinux.scr.lds $(obj-y) $(if $(CONFIG_KERNEL_UNCOMPRESSED),,sizes.h)
KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
OBJECTS := $(addprefix $(obj)/,$(obj-y))
LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/vmlinux: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OBJECTS)
$(call if_changed,ld) $(call if_changed,ld)
TRIM_HEAD_SIZE := 0x11000 # extract required uncompressed vmlinux symbols and adjust them to reflect offsets inside vmlinux.bin
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - 0x100000)/p'
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - $(TRIM_HEAD_SIZE))/p'
quiet_cmd_sizes = GEN $@ quiet_cmd_sizes = GEN $@
cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
quiet_cmd_trim_head = TRIM $@
cmd_trim_head = tail -c +$$(($(TRIM_HEAD_SIZE) + 1)) $< > $@
$(obj)/sizes.h: vmlinux $(obj)/sizes.h: vmlinux
$(call if_changed,sizes) $(call if_changed,sizes)
@@ -48,21 +38,18 @@ $(obj)/head.o: $(obj)/sizes.h
CFLAGS_misc.o += -I$(objtree)/$(obj) CFLAGS_misc.o += -I$(objtree)/$(obj)
$(obj)/misc.o: $(obj)/sizes.h $(obj)/misc.o: $(obj)/sizes.h
OBJCOPYFLAGS_vmlinux.bin.full := -R .comment -S OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
$(obj)/vmlinux.bin.full: vmlinux $(obj)/vmlinux.bin: vmlinux
$(call if_changed,objcopy) $(call if_changed,objcopy)
$(obj)/vmlinux.bin: $(obj)/vmlinux.bin.full
$(call if_changed,trim_head)
vmlinux.bin.all-y := $(obj)/vmlinux.bin vmlinux.bin.all-y := $(obj)/vmlinux.bin
suffix-$(CONFIG_KERNEL_GZIP) := gz suffix-$(CONFIG_KERNEL_GZIP) := .gz
suffix-$(CONFIG_KERNEL_BZIP2) := bz2 suffix-$(CONFIG_KERNEL_BZIP2) := .bz2
suffix-$(CONFIG_KERNEL_LZ4) := lz4 suffix-$(CONFIG_KERNEL_LZ4) := .lz4
suffix-$(CONFIG_KERNEL_LZMA) := lzma suffix-$(CONFIG_KERNEL_LZMA) := .lzma
suffix-$(CONFIG_KERNEL_LZO) := lzo suffix-$(CONFIG_KERNEL_LZO) := .lzo
suffix-$(CONFIG_KERNEL_XZ) := xz suffix-$(CONFIG_KERNEL_XZ) := .xz
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
$(call if_changed,gzip) $(call if_changed,gzip)
@@ -78,5 +65,9 @@ $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
$(call if_changed,xzkern) $(call if_changed,xzkern)
LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) $(obj)/piggy.o: $(obj)/vmlinux.scr.lds $(obj)/vmlinux.bin$(suffix-y)
$(call if_changed,ld) $(call if_changed,ld)
chkbss := $(filter-out $(obj)/misc.o $(obj)/piggy.o,$(OBJECTS))
chkbss-target := $(obj)/vmlinux.bin
include $(srctree)/arch/s390/scripts/Makefile.chkbss
+4 -4
View File
@@ -15,7 +15,7 @@
#include "sizes.h" #include "sizes.h"
__HEAD __HEAD
ENTRY(startup_continue) ENTRY(startup_decompressor)
basr %r13,0 # get base basr %r13,0 # get base
.LPG1: .LPG1:
# setup stack # setup stack
@@ -23,7 +23,7 @@ ENTRY(startup_continue)
aghi %r15,-160 aghi %r15,-160
brasl %r14,decompress_kernel brasl %r14,decompress_kernel
# Set up registers for memory mover. We move the decompressed image to # Set up registers for memory mover. We move the decompressed image to
# 0x11000, where startup_continue of the decompressed image is supposed # 0x100000, where startup_continue of the decompressed image is supposed
# to be. # to be.
lgr %r4,%r2 lgr %r4,%r2
lg %r2,.Loffset-.LPG1(%r13) lg %r2,.Loffset-.LPG1(%r13)
@@ -33,7 +33,7 @@ ENTRY(startup_continue)
la %r1,0x200 la %r1,0x200
mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13) mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
# When the memory mover is done we pass control to # When the memory mover is done we pass control to
# arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in # arch/s390/kernel/head64.S:startup_continue which lives at 0x100000 in
# the decompressed image. # the decompressed image.
lgr %r6,%r2 lgr %r6,%r2
br %r1 br %r1
@@ -47,6 +47,6 @@ mover_end:
.Lstack: .Lstack:
.quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER)) .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
.Loffset: .Loffset:
.quad 0x11000 .quad 0x100000
.Lmvsize: .Lmvsize:
.quad SZ__bss_start .quad SZ__bss_start
-37
View File
@@ -71,43 +71,6 @@ static int puts(const char *s)
return 0; return 0;
} }
void *memset(void *s, int c, size_t n)
{
char *xs;
xs = s;
while (n--)
*xs++ = c;
return s;
}
void *memcpy(void *dest, const void *src, size_t n)
{
const char *s = src;
char *d = dest;
while (n--)
*d++ = *s++;
return dest;
}
void *memmove(void *dest, const void *src, size_t n)
{
const char *s = src;
char *d = dest;
if (d <= s) {
while (n--)
*d++ = *s++;
} else {
d += n;
s += n;
while (n--)
*--d = *--s;
}
return dest;
}
static void error(char *x) static void error(char *x)
{ {
unsigned long long psw = 0x000a0000deadbeefULL; unsigned long long psw = 0x000a0000deadbeefULL;
+11 -4
View File
@@ -23,13 +23,10 @@ SECTIONS
*(.text.*) *(.text.*)
_etext = . ; _etext = . ;
} }
.rodata.compressed : {
*(.rodata.compressed)
}
.rodata : { .rodata : {
_rodata = . ; _rodata = . ;
*(.rodata) /* read-only data */ *(.rodata) /* read-only data */
*(.rodata.*) *(EXCLUDE_FILE (*piggy.o) .rodata.compressed)
_erodata = . ; _erodata = . ;
} }
.data : { .data : {
@@ -38,6 +35,15 @@ SECTIONS
*(.data.*) *(.data.*)
_edata = . ; _edata = . ;
} }
startup_continue = 0x100000;
#ifdef CONFIG_KERNEL_UNCOMPRESSED
. = 0x100000;
#else
. = ALIGN(8);
#endif
.rodata.compressed : {
*(.rodata.compressed)
}
. = ALIGN(256); . = ALIGN(256);
.bss : { .bss : {
_bss = . ; _bss = . ;
@@ -54,5 +60,6 @@ SECTIONS
*(.eh_frame) *(.eh_frame)
*(__ex_table) *(__ex_table)
*(*__ksymtab*) *(*__ksymtab*)
*(___kcrctab*)
} }
} }
@@ -2,10 +2,14 @@
SECTIONS SECTIONS
{ {
.rodata.compressed : { .rodata.compressed : {
#ifndef CONFIG_KERNEL_UNCOMPRESSED
input_len = .; input_len = .;
LONG(input_data_end - input_data) input_data = .; LONG(input_data_end - input_data) input_data = .;
#endif
*(.data) *(.data)
#ifndef CONFIG_KERNEL_UNCOMPRESSED
output_len = . - 4; output_len = . - 4;
input_data_end = .; input_data_end = .;
#endif
} }
} }
+2
View File
@@ -0,0 +1,2 @@
// SPDX-License-Identifier: GPL-2.0
#include "../kernel/ebcdic.c"
@@ -272,14 +272,14 @@ iplstart:
.org 0x10000 .org 0x10000
ENTRY(startup) ENTRY(startup)
j .Lep_startup_normal j .Lep_startup_normal
.org 0x10008 .org EP_OFFSET
# #
# This is a list of s390 kernel entry points. At address 0x1000f the number of # This is a list of s390 kernel entry points. At address 0x1000f the number of
# valid entry points is stored. # valid entry points is stored.
# #
# IMPORTANT: Do not change this table, it is s390 kernel ABI! # IMPORTANT: Do not change this table, it is s390 kernel ABI!
# #
.ascii "S390EP" .ascii EP_STRING
.byte 0x00,0x01 .byte 0x00,0x01
# #
# kdump startup-code at 0x10010, running in 64 bit absolute addressing mode # kdump startup-code at 0x10010, running in 64 bit absolute addressing mode
@@ -310,10 +310,11 @@ ENTRY(startup_kdump)
l %r15,.Lstack-.LPG0(%r13) l %r15,.Lstack-.LPG0(%r13)
ahi %r15,-STACK_FRAME_OVERHEAD ahi %r15,-STACK_FRAME_OVERHEAD
brasl %r14,verify_facilities brasl %r14,verify_facilities
# For uncompressed images, continue in #ifdef CONFIG_KERNEL_UNCOMPRESSED
# arch/s390/kernel/head64.S. For compressed images, continue in
# arch/s390/boot/compressed/head.S.
jg startup_continue jg startup_continue
#else
jg startup_decompressor
#endif
.Lstack: .Lstack:
.long 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER)) .long 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
+2
View File
@@ -0,0 +1,2 @@
/* SPDX-License-Identifier: GPL-2.0 */
#include "../lib/mem.S"
+2
View File
@@ -0,0 +1,2 @@
// SPDX-License-Identifier: GPL-2.0
#include "../../../drivers/s390/char/sclp_early_core.c"
+2 -2
View File
@@ -497,7 +497,7 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info)
} }
diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer); diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer);
rc = hypfs_create_str(cpu_dir, "type", buffer); rc = hypfs_create_str(cpu_dir, "type", buffer);
return PTR_RET(rc); return PTR_ERR_OR_ZERO(rc);
} }
static void *hypfs_create_lpar_files(struct dentry *systems_dir, void *part_hdr) static void *hypfs_create_lpar_files(struct dentry *systems_dir, void *part_hdr)
@@ -544,7 +544,7 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info)
return PTR_ERR(rc); return PTR_ERR(rc);
diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer); diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer);
rc = hypfs_create_str(cpu_dir, "type", buffer); rc = hypfs_create_str(cpu_dir, "type", buffer);
return PTR_RET(rc); return PTR_ERR_OR_ZERO(rc);
} }
static void *hypfs_create_phys_files(struct dentry *parent_dir, void *phys_hdr) static void *hypfs_create_phys_files(struct dentry *parent_dir, void *phys_hdr)
+3 -3
View File
@@ -36,7 +36,7 @@ struct hypfs_sb_info {
kuid_t uid; /* uid used for files and dirs */ kuid_t uid; /* uid used for files and dirs */
kgid_t gid; /* gid used for files and dirs */ kgid_t gid; /* gid used for files and dirs */
struct dentry *update_file; /* file to trigger update */ struct dentry *update_file; /* file to trigger update */
time_t last_update; /* last update time in secs since 1970 */ time64_t last_update; /* last update, CLOCK_MONOTONIC time */
struct mutex lock; /* lock to protect update process */ struct mutex lock; /* lock to protect update process */
}; };
@@ -52,7 +52,7 @@ static void hypfs_update_update(struct super_block *sb)
struct hypfs_sb_info *sb_info = sb->s_fs_info; struct hypfs_sb_info *sb_info = sb->s_fs_info;
struct inode *inode = d_inode(sb_info->update_file); struct inode *inode = d_inode(sb_info->update_file);
sb_info->last_update = get_seconds(); sb_info->last_update = ktime_get_seconds();
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
} }
@@ -179,7 +179,7 @@ static ssize_t hypfs_write_iter(struct kiocb *iocb, struct iov_iter *from)
* to restart data collection in this case. * to restart data collection in this case.
*/ */
mutex_lock(&fs_info->lock); mutex_lock(&fs_info->lock);
if (fs_info->last_update == get_seconds()) { if (fs_info->last_update == ktime_get_seconds()) {
rc = -EBUSY; rc = -EBUSY;
goto out; goto out;
} }

Some files were not shown because too many files have changed in this diff Show More