s390 updates for 5.16-rc2
Subsystems (5)
Heiko Carstens
maintainerHi Linus,
please pull s390 updates for 5.16-rc2. Besides the usual bunch of fixes and trivial cleanups this also touches x86 and samples code. This is required to add and rename a Kconfig option and fixes an incorrect merge resolution proposed by me when you merged the first round of s390 patches during the merge window.
This has been acked by Steven Rostedt:
https://lore.kernel.org/all/[email protected]/
Thanks,
Heiko
The following changes since commit fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf:
Linux 5.16-rc1 (2021-11-14 13:56:52 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git tags/s390-5.16-3
for you to fetch changes up to 890e3dc8bb6ee630870560c34054692f7a45da42:
ftrace/samples: add s390 support for ftrace direct multi sample (2021-11-18 17:50:54 +0100)
----------------------------------------------------------------
s390 updates for 5.16-rc2
- Add missing Kconfig option for ftrace direct multi sample, so it can be compiled again, and also add s390 support for this sample.
- Update Christian Borntraeger's email address.
- Various fixes for memory layout setup. Besides other this makes it possible to load shared DCSS segments again.
- Fix copy to user space of swapped kdump oldmem.
- Remove -mstack-guard and -mstack-size compile options when building vdso binaries. This can happen when CONFIG_VMAP_STACK is disabled and results in broken vdso code which causes more or less random exceptions. Also remove the not needed -nostdlib option.
- Fix memory leak on cpu hotplug and return code handling in kexec code.
- Wire up futex_waitv system call.
- Replace snprintf with sysfs_emit where appropriate.
----------------------------------------------------------------
Alexander Egorenkov (1):
s390/dump: fix copying to user-space of swapped kdump oldmem
Baoquan He (1):
s390/kexec: fix memory leak of ipl report buffer
Christian Borntraeger (1):
MAINTAINERS: update email address of Christian Borntraeger
Heiko Carstens (3):
s390/kexec: fix return code handling
ftrace/samples: add missing Kconfig option for ftrace direct multi sample ftrace/samples: add s390 support for ftrace direct multi sample
Masahiro Yamada (1):
s390/vdso: remove -nostdlib compiler flag
Qing Wang (1):
s390: replace snprintf in show functions with sysfs_emit
Sven Schnelle (1):
s390/vdso: filter out -mstack-guard and -mstack-size
Vasily Gorbik (5):
s390/setup: avoid reserving memory above identity mapping s390/setup: avoid using memblock_enforce_memory_limit s390/setup: re-arrange memblock setup s390/boot: simplify and fix kernel memory layout setup
s390: wire up sys_futex_waitv system call
.mailmap | 3 ++ MAINTAINERS | 4 +- arch/s390/Kconfig | 3 +- arch/s390/Makefile | 10 ++-- arch/s390/boot/startup.c | 88 ++++++++++++----------------------- arch/s390/include/asm/kexec.h | 6 +++ arch/s390/kernel/crash_dump.c | 4 +- arch/s390/kernel/ipl.c | 3 +- arch/s390/kernel/machine_kexec_file.c | 18 ++++++- arch/s390/kernel/setup.c | 22 ++------- arch/s390/kernel/syscalls/syscall.tbl | 1 + arch/s390/kernel/vdso32/Makefile | 2 +- arch/s390/kernel/vdso64/Makefile | 7 +-- arch/x86/Kconfig | 2 +- drivers/s390/block/dasd_devmap.c | 76 +++++++++++++++--------------- drivers/s390/char/raw3270.c | 12 ++--- drivers/s390/cio/chp.c | 2 +- samples/Kconfig | 11 ++++- samples/Makefile | 2 +- samples/ftrace/Makefile | 2 +- samples/ftrace/ftrace-direct-multi.c | 30 ++++++++++++ 21 files changed, 170 insertions(+), 138 deletions(-)
.mailmap +3 -0
@@ -71,6 +71,9 @@ Chao Yu <[email protected]> <[email protected]> Chao Yu <[email protected]> <[email protected]> Chris Chiu <[email protected]> <[email protected]> Chris Chiu <[email protected]> <[email protected]> +Christian Borntraeger <[email protected]> <[email protected]> +Christian Borntraeger <[email protected]> <[email protected]> +Christian Borntraeger <[email protected]> <[email protected]> Christophe Ricard <[email protected]> Christoph Hellwig <[email protected]> Colin Ian King <[email protected]> <[email protected]>
MAINTAINERS +2 -2
@@ -10445,7 +10445,7 @@ F: arch/riscv/include/uapi/asm/kvm* F: arch/riscv/kvm/ KERNEL VIRTUAL MACHINE for s390 (KVM/s390) -M: Christian Borntraeger <[email protected]> +M: Christian Borntraeger <[email protected]> M: Janosch Frank <[email protected]> R: David Hildenbrand <[email protected]> R: Claudio Imbrenda <[email protected]>
@@ -16573,7 +16573,7 @@ F: drivers/video/fbdev/savage/ S390 M: Heiko Carstens <[email protected]> M: Vasily Gorbik <[email protected]> -M: Christian Borntraeger <[email protected]> +M: Christian Borntraeger <[email protected]> R: Alexander Gordeev <[email protected]> L: [email protected] S: Supported
arch/s390/Kconfig +2 -1
@@ -47,7 +47,7 @@ config ARCH_SUPPORTS_UPROBES config KASAN_SHADOW_OFFSET hex depends on KASAN - default 0x18000000000000 + default 0x1C000000000000 config S390 def_bool y
@@ -194,6 +194,7 @@ config S390 select HAVE_RELIABLE_STACKTRACE select HAVE_RSEQ select HAVE_SAMPLE_FTRACE_DIRECT + select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_SOFTIRQ_ON_OWN_STACK select HAVE_SYSCALL_TRACEPOINTS select HAVE_VIRT_CPU_ACCOUNTING
arch/s390/Makefile +6 -4
@@ -77,10 +77,12 @@ KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y) KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y) ifneq ($(call cc-option,-mstack-size=8192 -mstack-guard=128),) -cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) -ifeq ($(call cc-option,-mstack-size=8192),) -cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) -endif + CC_FLAGS_CHECK_STACK := -mstack-size=$(STACK_SIZE) + ifeq ($(call cc-option,-mstack-size=8192),) + CC_FLAGS_CHECK_STACK += -mstack-guard=$(CONFIG_STACK_GUARD) + endif + export CC_FLAGS_CHECK_STACK + cflags-$(CONFIG_CHECK_STACK) += $(CC_FLAGS_CHECK_STACK) endif ifdef CONFIG_EXPOLINE
arch/s390/boot/startup.c +31 -57
113 lines not on this page · raw message
arch/s390/include/asm/kexec.h +6 -0
@@ -74,6 +74,12 @@ void *kexec_file_add_components(struct kimage *image,int arch_kexec_do_relocs (int r_type,void *loc,unsigned long val,unsigned long addr); +#define ARCH_HAS_KIMAGE_ARCH + +struct kimage_arch { +void *ipl_buf; +}; +extern const struct kexec_file_ops s390_kexec_image_ops;extern const struct kexec_file_ops s390_kexec_elf_ops;
arch/s390/kernel/crash_dump.c +2 -2
@@ -191,8 +191,8 @@ static int copy_oldmem_user(void __user *dst, void *src, size_t count)return rc; }else {/* Check for swapped kdump oldmem areas */ -if (oldmem_data.start && from - oldmem_data.size < oldmem_data.size) { - from -= oldmem_data.size; +if (oldmem_data.start && from - oldmem_data.start < oldmem_data.size) { + from -= oldmem_data.start; len =min (count, oldmem_data.size - from); }else if (oldmem_data.start && from < oldmem_data.size) { len =min (count, oldmem_data.size - from);
arch/s390/kernel/ipl.c +2 -1
@@ -2156,7 +2156,7 @@ void *ipl_report_finish(struct ipl_report *report) buf =vzalloc (report->size);if (!buf) -return ERR_PTR (-ENOMEM ); + goto out; ptr = buf;memcpy (ptr, report->ipib, report->ipib->hdr.len);
@@ -2195,6 +2195,7 @@ void *ipl_report_finish(struct ipl_report *report) }BUG_ON (ptr > buf + report->size); +out:return buf; }
arch/s390/kernel/machine_kexec_file.c +17 -1
@@ -12,6 +12,7 @@#include <linux/kexec.h> #include <linux/module_signature.h> #include <linux/verification.h> +#include <linux/vmalloc.h> #include <asm/boot_data.h> #include <asm/ipl.h> #include <asm/setup.h>
@@ -170,6 +171,7 @@ static int kexec_file_add_ipl_report(struct kimage *image,struct kexec_buf buf;unsigned long addr;void *ptr, *end; +int ret; buf.image = image;
@@ -199,9 +201,13 @@ static int kexec_file_add_ipl_report(struct kimage *image, ptr += len; } + ret = -ENOMEM ; buf.buffer =ipl_report_finish (data->report); +if (!buf.buffer) + goto out; buf.bufsz = data->report->size; buf.memsz = buf.bufsz; + image->arch.ipl_buf = buf.buffer; data->memsz += buf.memsz;
@@ -209,7 +215,9 @@ static int kexec_file_add_ipl_report(struct kimage *image, data->kernel_buf + offsetof(struct lowcore , ipl_parmblock_ptr); *lc_ipl_parmblock_ptr = (__u32 )buf.mem; -return kexec_add_buffer (&buf); + ret =kexec_add_buffer (&buf); +out: +return ret; } void *kexec_file_add_components(struct kimage *image,
@@ -322,3 +330,11 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi, }return 0 ; } + +int arch_kimage_file_post_load_cleanup (struct kimage *image) +{ +vfree (image->arch.ipl_buf); + image->arch.ipl_buf =NULL ; + +return kexec_image_post_load_cleanup_default (image); +}
arch/s390/kernel/setup.c +5 -17
@@ -606,7 +606,7 @@ static void __init setup_resources(void)static void __init setup_memory_end (void ) { -memblock_remove (ident_map_size,ULONG_MAX ); +memblock_remove (ident_map_size,PHYS_ADDR_MAX - ident_map_size); max_pfn = max_low_pfn =PFN_DOWN (ident_map_size);pr_notice ("The maximum memory size is %luMB\n" , ident_map_size >>20 ); }
@@ -637,14 +637,6 @@ static struct notifier_block kdump_mem_nb = {#endif -/* -* Make sure that the area above identity mapping is protected -*/ -static void __init reserve_above_ident_map (void ) -{ -memblock_reserve (ident_map_size,ULONG_MAX ); -} -/* * Reserve memory for kdump kernel to be loaded with kexec */
@@ -785,7 +777,6 @@ static void __init memblock_add_mem_detect_info(void) }memblock_set_bottom_up (false);memblock_set_node (0 ,ULONG_MAX , &memblock.memory,0 ); -memblock_dump_all (); }/*
@@ -826,9 +817,6 @@ static void __init setup_memory(void)storage_key_init_range (start, end);psw_set_key (PAGE_DEFAULT_KEY ); - -/* Only cosmetics */ -memblock_enforce_memory_limit (memblock_end_of_DRAM ()); }static void __init relocate_amode31_section (void )
@@ -999,24 +987,24 @@ void __init setup_arch(char **cmdline_p)setup_control_program_code ();/* Do some memory reservations *before* memory is added to memblock */ -reserve_above_ident_map ();reserve_kernel ();reserve_initrd ();reserve_certificate_list ();reserve_mem_detect_info (); +memblock_set_current_limit (ident_map_size);memblock_allow_resize ();/* Get information about *all* installed memory */ memblock_add_mem_detect_info ();free_mem_detect_info (); +setup_memory_end (); +memblock_dump_all (); +setup_memory ();relocate_amode31_section ();setup_cr (); -setup_uv (); -setup_memory_end (); -setup_memory ();dma_contiguous_reserve (ident_map_size);vmcp_cma_reserve ();if (MACHINE_HAS_EDAT2 )
arch/s390/kernel/syscalls/syscall.tbl +1 -0
@@ -451,3 +451,4 @@ 446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self # 447 reserved for memfd_secret 448 common process_mrelease sys_process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv sys_futex_waitv
arch/s390/kernel/vdso32/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_AFLAGS_32 += -m31 -s KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -LDFLAGS_vdso32.so.dbg += -fPIC -shared -nostdlib -soname=linux-vdso32.so.1 \ +LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \ --hash-style=both --build-id=sha1 -melf_s390 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
arch/s390/kernel/vdso64/Makefile +4 -3
@@ -8,8 +8,9 @@ ARCH_REL_TYPE_ABS += R_390_GOT|R_390_PLT include $(srctree)/lib/vdso/Makefile obj-vdso64 = vdso_user_wrapper.o note.o obj-cvdso64 = vdso64_generic.o getcpu.o -CFLAGS_REMOVE_getcpu.o = -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE) -CFLAGS_REMOVE_vdso64_generic.o = -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE) +VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE) $(CC_FLAGS_CHECK_STACK) +CFLAGS_REMOVE_getcpu.o = $(VDSO_CFLAGS_REMOVE) +CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE) # Build rules
@@ -25,7 +26,7 @@ KBUILD_AFLAGS_64 += -m64 -s KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin -ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \ +ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \ --hash-style=both --build-id=sha1 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
arch/x86/Kconfig +1 -1
@@ -193,7 +193,7 @@ config X86 select HAVE_DYNAMIC_FTRACE_WITH_ARGS if X86_64 select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_SAMPLE_FTRACE_DIRECT if X86_64 - select HAVE_SAMPLE_FTRACE_MULTI_DIRECT if X86_64 + select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if X86_64 select HAVE_EBPF_JIT select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_EISA
drivers/s390/block/dasd_devmap.c +38 -38
240 lines not on this page · raw message
drivers/s390/char/raw3270.c +6 -6
@@ -1047,24 +1047,24 @@ raw3270_probe (struct ccw_device *cdev)static ssize_t raw3270_model_show (struct device *dev,struct device_attribute *attr,char *buf) { -return snprintf (buf,PAGE_SIZE ,"%i\n" , - ((struct raw3270 *)dev_get_drvdata (dev))->model); +return sysfs_emit (buf,"%i\n" , + ((struct raw3270 *)dev_get_drvdata (dev))->model); } static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL);static ssize_t raw3270_rows_show (struct device *dev,struct device_attribute *attr,char *buf) { -return snprintf (buf,PAGE_SIZE ,"%i\n" , - ((struct raw3270 *)dev_get_drvdata (dev))->rows); +return sysfs_emit (buf,"%i\n" , + ((struct raw3270 *)dev_get_drvdata (dev))->rows); } static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL);static ssize_t raw3270_columns_show (struct device *dev,struct device_attribute *attr,char *buf) { -return snprintf (buf,PAGE_SIZE ,"%i\n" , - ((struct raw3270 *)dev_get_drvdata (dev))->cols); +return sysfs_emit (buf,"%i\n" , + ((struct raw3270 *)dev_get_drvdata (dev))->cols); } static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL);
drivers/s390/cio/chp.c +1 -1
@@ -285,7 +285,7 @@ static ssize_t chp_configure_show(struct device *dev,if (status <0 )return status; -return snprintf (buf,PAGE_SIZE ,"%d\n" , status); +return sysfs_emit (buf,"%d\n" , status); }static int cfg_wait_idle (void );
samples/Kconfig +10 -1
@@ -31,6 +31,15 @@ config SAMPLE_FTRACE_DIRECT This builds an ftrace direct function example that hooks to wake_up_process and prints the parameters. +config SAMPLE_FTRACE_DIRECT_MULTI + tristate "Build register_ftrace_direct_multi() example" + depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m + depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI + help + This builds an ftrace direct function example + that hooks to wake_up_process and schedule, and prints + the function addresses. + config SAMPLE_TRACE_ARRAY tristate "Build sample module for kernel access to Ftrace instancess" depends on EVENT_TRACING && m
@@ -237,5 +246,5 @@ endif # SAMPLES config HAVE_SAMPLE_FTRACE_DIRECT bool -config HAVE_SAMPLE_FTRACE_MULTI_DIRECT +config HAVE_SAMPLE_FTRACE_DIRECT_MULTI bool
samples/Makefile +1 -1
@@ -22,7 +22,7 @@ subdir-$(CONFIG_SAMPLE_TIMER) += timers obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace_events/ obj-$(CONFIG_SAMPLE_TRACE_PRINTK) += trace_printk/ obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace/ -obj-$(CONFIG_SAMPLE_FTRACE_MULTI_DIRECT) += ftrace/ +obj-$(CONFIG_SAMPLE_FTRACE_DIRECT_MULTI) += ftrace/ obj-$(CONFIG_SAMPLE_TRACE_ARRAY) += ftrace/ subdir-$(CONFIG_SAMPLE_UHID) += uhid obj-$(CONFIG_VIDEO_PCI_SKELETON) += v4l/
samples/ftrace/Makefile +1 -1
@@ -3,7 +3,7 @@ obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace-direct.o obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace-direct-too.o obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace-direct-modify.o -obj-$(CONFIG_SAMPLE_FTRACE_MULTI_DIRECT) += ftrace-direct-multi.o +obj-$(CONFIG_SAMPLE_FTRACE_DIRECT_MULTI) += ftrace-direct-multi.o CFLAGS_sample-trace-array.o := -I$(src) obj-$(CONFIG_SAMPLE_TRACE_ARRAY) += sample-trace-array.o
samples/ftrace/ftrace-direct-multi.c +30 -0
@@ -4,6 +4,7 @@#include <linux/mm.h> /* for handle_mm_fault() */ #include <linux/ftrace.h> #include <linux/sched/stat.h> +#include <asm/asm-offsets.h> extern void my_direct_func (unsigned long ip);
@@ -14,6 +15,8 @@ void my_direct_func(unsigned long ip)extern void my_tramp (void *); +#ifdef CONFIG_X86_64 + asm (" .pushsection .text, \"ax\", @progbits\n" " .type my_tramp, @function\n"
@@ -31,6 +34,33 @@ asm (" .popsection\n" ); +#endif /* CONFIG_X86_64 */ + +#ifdef CONFIG_S390 + +asm ( +" .pushsection .text, \"ax\", @progbits\n" +" .type my_tramp, @function\n" +" .globl my_tramp\n" +" my_tramp:" +" lgr %r1,%r15\n" +" stmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n" +" stg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n" +" aghi %r15,"__stringify(-STACK_FRAME_OVERHEAD)"\n" +" stg %r1,"__stringify(__SF_BACKCHAIN)"(%r15)\n" +" lgr %r2,%r0\n" +" brasl %r14,my_direct_func\n" +" aghi %r15,"__stringify(STACK_FRAME_OVERHEAD)"\n" +" lmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n" +" lg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n" +" lgr %r1,%r0\n" +" br %r1\n" +" .size my_tramp, .-my_tramp\n" +" .popsection\n" +); + +#endif /* CONFIG_S390 */ +static struct ftrace_ops direct;static int __init ftrace_direct_multi_init (void )
The pull request you sent on Sat, 20 Nov 2021 15:47:46 +0100:
The pull request you sent on Sat, 20 Nov 2021 15:47:46 +0100:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.gittags/s390-5.16-3
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6b38e2fb70b6682fd8f8cd24c03597e27fec3df3
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html