more s390 updates for 5.13-rc1
Subsystems (4)
Heiko Carstens
maintainerHi Linus,
please pull some more s390 updates for 5.13-rc1.
Thanks,
Heiko
The following changes since commit 6daa755f813e6aa0bcc97e352666e072b1baac25:
Merge tag 's390-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (2021-04-27 17:54:15 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git tags/s390-5.13-2
for you to fetch changes up to b208108638c4bd3215792415944467c36f5dfd97:
s390: fix detection of vector enhancements facility 1 vs. vector packed decimal facility (2021-05-04 19:10:56 +0200)
----------------------------------------------------------------
more s390 updates for 5.13 merge window
- add support for system call stack randomization.
- handle stale PCI deconfiguration events.
- couple of defconfig updates.
- some fixes and cleanups.
----------------------------------------------------------------
David Hildenbrand (1):
s390: fix detection of vector enhancements facility 1 vs. vector packed decimal facility
Niklas Schnelle (3):
s390/pci: rename zpci_configure_device() s390/pci: handle stale deconfiguration events s390/configs: enable CONFIG_PCI_IOV
Sven Schnelle (1):
s390/entry: add support for syscall stack randomization
Thomas Huth (1):
s390/configs: change CONFIG_VIRTIO_CONSOLE to "m"
Thomas Richter (3):
s390/cpumf: beautify if-then-else indentation s390/cpumf: move counter set size calculation to common place s390/cpumf: remove call to perf_event_update_userpage
Vineeth Vijayan (1):
s390/cio: remove invalid condition on IO_SCH_UNREG
arch/s390/Kconfig | 1 + arch/s390/configs/debug_defconfig | 3 +- arch/s390/configs/defconfig | 3 +- arch/s390/include/asm/cpu_mcf.h | 2 ++ arch/s390/include/asm/entry-common.h | 10 +++++++ arch/s390/include/asm/pci.h | 2 +- arch/s390/kernel/perf_cpum_cf.c | 12 ++------ arch/s390/kernel/perf_cpum_cf_common.c | 46 +++++++++++++++++++++++++++++ arch/s390/kernel/perf_cpum_cf_diag.c | 54 +++------------------------------- arch/s390/kernel/setup.c | 4 +-- arch/s390/kernel/syscall.c | 1 + arch/s390/kernel/traps.c | 2 ++ arch/s390/pci/pci.c | 10 ++++--- arch/s390/pci/pci_event.c | 28 ++++++++++++------ drivers/pci/hotplug/s390_pci_hpc.c | 2 +- drivers/s390/cio/device.c | 3 +- 16 files changed, 103 insertions(+), 80 deletions(-)
arch/s390/Kconfig +1 -0
@@ -137,6 +137,7 @@ config S390 select HAVE_ARCH_JUMP_LABEL_RELATIVE select HAVE_ARCH_KASAN select HAVE_ARCH_KASAN_VMALLOC + select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_SOFT_DIRTY select HAVE_ARCH_TRACEHOOK
arch/s390/configs/debug_defconfig +2 -1
@@ -387,6 +387,7 @@ CONFIG_CGROUP_NET_PRIO=y CONFIG_BPF_JIT=y CONFIG_NET_PKTGEN=m CONFIG_PCI=y +CONFIG_PCI_IOV=y # CONFIG_PCIEASPM is not set CONFIG_PCI_DEBUG=y CONFIG_HOTPLUG_PCI=y
@@ -548,7 +549,7 @@ CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_LEGACY_PTY_COUNT=0 -CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=m CONFIG_HW_RANDOM_VIRTIO=m CONFIG_RAW_DRIVER=m CONFIG_HANGCHECK_TIMER=m
arch/s390/configs/defconfig +2 -1
@@ -377,6 +377,7 @@ CONFIG_CGROUP_NET_PRIO=y CONFIG_BPF_JIT=y CONFIG_NET_PKTGEN=m CONFIG_PCI=y +CONFIG_PCI_IOV=y # CONFIG_PCIEASPM is not set CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI_S390=y
@@ -540,7 +541,7 @@ CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set CONFIG_LEGACY_PTY_COUNT=0 -CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=m CONFIG_HW_RANDOM_VIRTIO=m CONFIG_RAW_DRIVER=m CONFIG_HANGCHECK_TIMER=m
arch/s390/include/asm/cpu_mcf.h +2 -0
@@ -123,4 +123,6 @@ static inline int stccm_avail(void) return test_facility(142); } +size_t cpum_cf_ctrset_size (enum cpumf_ctr_set ctrset, +struct cpumf_ctr_info *info);#endif /* _ASM_S390_CPU_MCF_H */
arch/s390/include/asm/entry-common.h +10 -0
@@ -4,9 +4,11 @@#include <linux/sched.h> #include <linux/audit.h> +#include <linux/randomize_kstack.h> #include <linux/tracehook.h> #include <linux/processor.h> #include <linux/uaccess.h> +#include <asm/timex.h> #include <asm/fpu/api.h> #define ARCH_EXIT_TO_USER_MODE_WORK (_TIF_GUARDED_STORAGE | _TIF_PER_TRAP)
@@ -48,6 +50,14 @@ static __always_inline void arch_exit_to_user_mode(void)#define arch_exit_to_user_mode arch_exit_to_user_mode +static inline void arch_exit_to_user_mode_prepare (struct pt_regs *regs, +unsigned long ti_work) +{ +choose_random_kstack_offset (get_tod_clock_fast () &0xff ); +} + +#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare +static inline bool on_thread_stack (void ) {return !(((unsigned long )(current->stack) ^current_stack_pointer ()) & ~(THREAD_SIZE -1 ));
arch/s390/include/asm/pci.h +1 -1
@@ -204,7 +204,7 @@ extern unsigned int s390_pci_no_rid;struct zpci_dev *zpci_create_device (u32 fid,u32 fh,enum zpci_state state);int zpci_enable_device (struct zpci_dev *);int zpci_disable_device (struct zpci_dev *); -int zpci_configure_device (struct zpci_dev *zdev,u32 fh); +int zpci_scan_configured_device (struct zpci_dev *zdev,u32 fh);int zpci_deconfigure_device (struct zpci_dev *zdev);int zpci_register_ioat (struct zpci_dev *,u8 ,u64 ,u64 ,u64 );
arch/s390/kernel/perf_cpum_cf.c +3 -9
@@ -230,9 +230,7 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)/* No support for kernel space counters only */ }else if (!attr->exclude_kernel && attr->exclude_user) {return -EOPNOTSUPP ; - -/* Count user and kernel space */ - }else { + }else {/* Count user and kernel space */ if (ev >=ARRAY_SIZE (cpumf_generic_events_basic))return -EOPNOTSUPP ; ev = cpumf_generic_events_basic[ev];
@@ -402,12 +400,12 @@ static void cpumf_pmu_stop(struct perf_event *event, int flags)*/ if (!atomic_dec_return (&cpuhw->ctr_set[hwc->config_base]))ctr_set_stop (&cpuhw->state, hwc->config_base); - event->hw.state |=PERF_HES_STOPPED ; + hwc->state |=PERF_HES_STOPPED ; }if ((flags &PERF_EF_UPDATE ) && !(hwc->state &PERF_HES_UPTODATE )) {hw_perf_event_update (event); - event->hw.state |=PERF_HES_UPTODATE ; + hwc->state |=PERF_HES_UPTODATE ; } }
@@ -430,8 +428,6 @@ static int cpumf_pmu_add(struct perf_event *event, int flags)if (flags &PERF_EF_START )cpumf_pmu_start (event,PERF_EF_RELOAD ); -perf_event_update_userpage (event); -return 0 ; }
@@ -451,8 +447,6 @@ static void cpumf_pmu_del(struct perf_event *event, int flags)*/ if (!atomic_read (&cpuhw->ctr_set[event->hw.config_base]))ctr_set_disable (&cpuhw->state, event->hw.config_base); - -perf_event_update_userpage (event); }/*
arch/s390/kernel/perf_cpum_cf_common.c +46 -0
52 lines not on this page · raw message
arch/s390/kernel/perf_cpum_cf_diag.c +4 -50
84 lines not on this page · raw message
arch/s390/kernel/setup.c +2 -2
@@ -937,9 +937,9 @@ static int __init setup_hwcaps(void)if (MACHINE_HAS_VX ) { elf_hwcap |=HWCAP_S390_VXRS ;if (test_facility (134 )) - elf_hwcap |=HWCAP_S390_VXRS_EXT ; -if (test_facility (135 )) elf_hwcap |=HWCAP_S390_VXRS_BCD ; +if (test_facility (135 )) + elf_hwcap |=HWCAP_S390_VXRS_EXT ;if (test_facility (148 )) elf_hwcap |=HWCAP_S390_VXRS_EXT2 ;if (test_facility (152 ))
arch/s390/kernel/syscall.c +1 -0
@@ -142,6 +142,7 @@ void do_syscall(struct pt_regs *regs) void noinstr __do_syscall(struct pt_regs *regs, int per_trap) { +add_random_kstack_offset ();enter_from_user_mode (regs);memcpy (®s->gprs[8 ], S390_lowcore.save_area_sync,8 *sizeof (unsigned long ));
arch/s390/kernel/traps.c +2 -0
@@ -17,6 +17,7 @@#include "asm/ptrace.h" #include <linux/kprobes.h> #include <linux/kdebug.h> +#include <linux/randomize_kstack.h> #include <linux/extable.h> #include <linux/ptrace.h> #include <linux/sched.h>
@@ -301,6 +302,7 @@ void noinstr __do_pgm_check(struct pt_regs *regs)unsigned int trapnr, syscall_redirect =0 ;irqentry_state_t state; +add_random_kstack_offset (); regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc; regs->int_parm_long = S390_lowcore.trans_exc_code;
arch/s390/pci/pci.c +6 -4
@@ -738,17 +738,19 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state) }/** -* zpci_configure_device() - Configure a zpci_dev +* zpci_scan_configured_device() - Scan a freshly configured zpci_dev * @zdev: The zpci_dev to be configured * @fh: The general function handle supplied by the platform * * Given a device in the configuration state Configured, enables, scans and -* adds it to the common code PCI subsystem. If any failure occurs, the -* zpci_dev is left disabled. +* adds it to the common code PCI subsystem if possible. If the PCI device is +* parked because we can not yet create a PCI bus because we have not seen +* function 0, it is ignored but will be scanned once function 0 appears. +* If any failure occurs, the zpci_dev is left disabled. * * Return: 0 on success, or an error code otherwise */ -int zpci_configure_device (struct zpci_dev *zdev,u32 fh) +int zpci_scan_configured_device (struct zpci_dev *zdev,u32 fh) {int rc;
arch/s390/pci/pci_event.c +19 -9
@@ -76,8 +76,6 @@ void zpci_event_error(void *data)static void zpci_event_hard_deconfigured (struct zpci_dev *zdev,u32 fh) { -enum zpci_state state; - zdev->fh = fh;/* Give the driver a hint that the function is * already unusable.
@@ -88,15 +86,12 @@ static void zpci_event_hard_deconfigured(struct zpci_dev *zdev, u32 fh)*/ zpci_disable_device (zdev); zdev->state =ZPCI_FN_STATE_STANDBY ; -if (!clp_get_state (zdev->fid, &state) && - state ==ZPCI_FN_STATE_RESERVED ) { -zpci_zdev_put (zdev); - } }static void __zpci_event_availability (struct zpci_ccdf_avail *ccdf) {struct zpci_dev *zdev =get_zdev_by_fid (ccdf->fid); +enum zpci_state state;zpci_err ("avail CCDF:\n" );zpci_err_hex (ccdf,sizeof (*ccdf));
@@ -113,7 +108,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)break ; zdev->state =ZPCI_FN_STATE_CONFIGURED ; } -zpci_configure_device (zdev, ccdf->fh); +zpci_scan_configured_device (zdev, ccdf->fh);break ;case 0x0302 :/* Reserved -> Standby */ if (!zdev)
@@ -123,13 +118,28 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)break ;case 0x0303 :/* Deconfiguration requested */ if (zdev) { +/* The event may have been queued before we confirgured +* the device. +*/ +if (zdev->state !=ZPCI_FN_STATE_CONFIGURED ) +break ; zdev->fh = ccdf->fh;zpci_deconfigure_device (zdev); }break ;case 0x0304 :/* Configured -> Standby|Reserved */ -if (zdev) -zpci_event_hard_deconfigured (zdev, ccdf->fh); +if (zdev) { +/* The event may have been queued before we confirgured +* the device.: +*/ +if (zdev->state ==ZPCI_FN_STATE_CONFIGURED ) +zpci_event_hard_deconfigured (zdev, ccdf->fh); +/* The 0x0304 event may immediately reserve the device */ +if (!clp_get_state (zdev->fid, &state) && + state ==ZPCI_FN_STATE_RESERVED ) { +zpci_zdev_put (zdev); + } + }break ;case 0x0306 :/* 0x308 or 0x302 for multiple devices */ zpci_remove_reserved_devices ();
drivers/pci/hotplug/s390_pci_hpc.c +1 -1
@@ -35,7 +35,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)return rc; zdev->state =ZPCI_FN_STATE_CONFIGURED ; -return zpci_configure_device (zdev, zdev->fh); +return zpci_scan_configured_device (zdev, zdev->fh); }static int disable_slot (struct hotplug_slot *hotplug_slot)
drivers/s390/cio/device.c +1 -2
@@ -1532,8 +1532,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)switch (action) {case IO_SCH_ORPH_UNREG :case IO_SCH_UNREG : -if (!cdev) -css_sch_device_unregister (sch); +css_sch_device_unregister (sch);break ;case IO_SCH_ORPH_ATTACH :case IO_SCH_UNREG_ATTACH :
The pull request you sent on Thu, 6 May 2021 22:12:58 +0200:
The pull request you sent on Thu, 6 May 2021 22:12:58 +0200:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.gittags/s390-5.13-2
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/e48661230cc35b3d0f4367eddfc19f86463ab917
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html