s390 patches for the 5.8 merge window
Subsystems (15)
Vasily Gorbik
maintainerHello Linus,
please pull s390 changes for 5.8. There are some common code changes to pci code acked by Bjorn Helgaas:
https://lore.kernel.org/linux-pci/20200507155132.GA6568@bjorn-Precision-5520/
As well as MAINTAINERS file touched to add s390 specific pci documentation.
The following changes since commit ae83d0b416db002fe95601e7f97f64b59514d936:
Linux 5.7-rc2 (2020-04-19 14:35:30 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git tags/s390-5.8-1
for you to fetch changes up to bfa50e1427e4608ce6941d3d0855445fcaa7dbb7:
vfio-ccw: make vfio_ccw_regops variables declarations static (2020-06-04 13:45:51 +0200)
Please note 2 minor merge conflict resolutions below:
arch/s390/kernel/smp.c +0 -0
@@@ -403,7 -404,12 +404,12 @@@ int smp_find_processor_id(u16 addressreturn -1 ; } +void schedule_mcck_handler (void ) + { +pcpu_ec_call (pcpu_devices +smp_processor_id (), ec_mcck_pending); + } + -bool arch_vcpu_is_preempted(int cpu) +bool notrace arch_vcpu_is_preempted(int cpu) {if (test_cpu_flag_of (CIF_ENABLED_WAIT , cpu))return false;
arch/s390/kvm/vsie.c +0 -0
@@@ -1000,9 -1000,9 +1000,6 @@@ static int do_vsie_run(struct kvm_vcpuhandle_last_fault (vcpu, vsie_page); -if (test_cpu_flag (CIF_MCCK_PENDING )) -s390_handle_mcck (); - if (need_resched()) -schedule (); --srcu_read_unlock (&vcpu->kvm->srcu, vcpu->srcu_idx);/* save current guest state of bp isolation override */
Thank you,
Vasily
----------------------------------------------------------------
s390 updates for the 5.8 merge window
- Add support for multi-function devices in pci code.
- Enable PF-VF linking for architectures using the pdev->no_vf_scan flag (currently just s390).
- Add reipl from NVMe support.
- Get rid of critical section cleanup in entry.S.
- Refactor PNSO CHSC (perform network subchannel operation) in cio and qeth.
- QDIO interrupts and error handling fixes and improvements, more refactoring changes.
- Align ioremap() with generic code.
- Accept requests without the prefetch bit set in vfio-ccw.
- Enable path handling via two new regions in vfio-ccw.
- Other small fixes and improvements all over the code.
----------------------------------------------------------------
Alexander Schmidt (1):
s390/pci: Expose new port attribute for PCIe functions
Alexandra Winter (1):
s390/cio, s390/qeth: cleanup PNSO CHSC
Cornelia Huck (1):
vfio-ccw: document possible errors
David Hildenbrand (1):
s390: simplify memory notifier for protecting kdump crash kernel area
Eric Farman (3):
vfio-ccw: Refactor the unregister of the async regions
vfio-ccw: Refactor IRQ handlers
vfio-ccw: Add trace for CRW event
Farhan Ali (5):
vfio-ccw: Introduce new helper functions to free/destroy regions
vfio-ccw: Register a chp_event callback for vfio-ccw
vfio-ccw: Introduce a new schib region
vfio-ccw: Introduce a new CRW region
vfio-ccw: Wire up the CRW irq and CRW region
Gerald Schaefer (1):
Documentation/s390: Update / remove developerWorks web links
Harald Freudenberger (1):
s390/ap: introduce new ap function ap_get_qdev()
Jared Rossi (1):
vfio-ccw: Enable transparent CCW IPL from DASD
Jason J. Herne (2):
s390: nvme ipl
s390: nvme reipl
Julian Wiedmann (14):
s390/qdio: consistently restore the IRQ handler s390/qdio: tear down thinint indicator after early error s390/qdio: put thinint indicator after early error s390/qdio: consolidate thinint init/exit s390/qdio: do more fine-grained allocation roll-back s390/qdio: roll-back after queue allocation error s390/qdio: keep track of allocated queue count s390/qdio: de-duplicate tiqdio_inbound_processing() s390/qdio: remove always-true condition s390/qdio: simplify overlap calculation on Input refill s390/qdio: refactor ACK processing for primed SBALs s390/qdio: add IRQ reduction for error SBALs s390/qdio: fix up qdio_start_irq() kerneldoc s390/qdio: remove q->first_to_kick
Masahiro Yamada (1):
s390: ptrace: hard-code "s390x" instead of UTS_MACHINE
Niklas Schnelle (3):
PCI/IOV: Introduce pci_iov_sysfs_link() function s390/pci: create links between PFs and VFs s390/pci: ioremap() align with generic code
Petr Tesarik (1):
s390/pci: Log new handle in clp_disable_fh()
Pierre Morel (11):
s390/pci: adaptation of iommu to multifunction s390/pci: define kernel parameters for PCI multifunction s390/pci: define RID and RID available s390/pci: create zPCI bus
s390/pci: adapt events for zbus
s390/pci: Adding bus resource
s390/pci: Handling multifunctions
s390/pci: Do not disable PF when VFs exist s390/pci: Documentation for zPCI
s390/pci: removes wrong PCI multifunction assignment s390/pci: Documentation update for s390 PCI
Sven Schnelle (2):
s390: add machine check SIGP
s390: remove critical section cleanup from entry.S
Vasily Gorbik (2):
Merge tag 'vfio-ccw-20200603-v2' of https://git.kernel.org/.../kvms390/vfio-ccw into features
vfio-ccw: make vfio_ccw_regops variables declarations static
YueHaibing (2):
s390: Remove two unused inline functions s390/cio: Remove unused inline function idset_sch_get_first
Documentation/admin-guide/kernel-parameters.txt | 2 + Documentation/s390/index.rst | 1 + Documentation/s390/pci.rst | 125 +++++++ Documentation/s390/vfio-ccw.rst | 100 ++++- Documentation/s390/zfcpdump.rst | 4 +- MAINTAINERS | 1 + arch/s390/appldata/appldata_mem.c | 4 - arch/s390/appldata/appldata_net_sum.c | 4 - arch/s390/appldata/appldata_os.c | 4 - arch/s390/include/asm/ccwdev.h | 5 + arch/s390/include/asm/chsc.h | 62 ++++ arch/s390/include/asm/io.h | 2 +- arch/s390/include/asm/ipl.h | 11 + arch/s390/include/asm/nmi.h | 2 +- arch/s390/include/asm/pci.h | 42 ++- arch/s390/include/asm/pci_clp.h | 13 +- arch/s390/include/asm/processor.h | 20 +- arch/s390/include/asm/qdio.h | 33 -- arch/s390/include/asm/smp.h | 1 + arch/s390/include/uapi/asm/ipl.h | 25 ++ arch/s390/kernel/Makefile | 5 - arch/s390/kernel/entry.S | 464 ++++++------------------ arch/s390/kernel/ftrace.c | 16 - arch/s390/kernel/idle.c | 14 +- arch/s390/kernel/ipl.c | 209 +++++++++++ arch/s390/kernel/nmi.c | 23 +- arch/s390/kernel/ptrace.c | 2 +- arch/s390/kernel/setup.c | 16 +- arch/s390/kernel/smp.c | 8 + arch/s390/kvm/kvm-s390.c | 3 - arch/s390/kvm/vsie.c | 2 - arch/s390/lib/delay.c | 4 +- arch/s390/pci/Makefile | 3 +- arch/s390/pci/pci.c | 225 +++++------- arch/s390/pci/pci_bus.c | 328 +++++++++++++++++ arch/s390/pci/pci_bus.h | 31 ++ arch/s390/pci/pci_clp.c | 8 +- arch/s390/pci/pci_event.c | 39 +- arch/s390/pci/pci_sysfs.c | 4 +- drivers/iommu/s390-iommu.c | 8 +- drivers/pci/hotplug/s390_pci_hpc.c | 16 +- drivers/pci/iov.c | 39 +- drivers/s390/cio/Makefile | 2 +- drivers/s390/cio/chsc.c | 40 +- drivers/s390/cio/chsc.h | 50 +-- drivers/s390/cio/device_ops.c | 23 ++ drivers/s390/cio/idset.c | 12 - drivers/s390/cio/qdio.h | 16 +- drivers/s390/cio/qdio_main.c | 299 ++++----------- drivers/s390/cio/qdio_setup.c | 100 +++-- drivers/s390/cio/qdio_thinint.c | 61 ++-- drivers/s390/cio/vfio_ccw_chp.c | 148 ++++++++ drivers/s390/cio/vfio_ccw_cp.c | 19 +- drivers/s390/cio/vfio_ccw_drv.c | 165 ++++++++- drivers/s390/cio/vfio_ccw_ops.c | 65 +++- drivers/s390/cio/vfio_ccw_private.h | 16 + drivers/s390/cio/vfio_ccw_trace.c | 1 + drivers/s390/cio/vfio_ccw_trace.h | 30 ++ drivers/s390/crypto/ap_bus.c | 94 +++-- drivers/s390/crypto/ap_bus.h | 25 +- drivers/s390/crypto/ap_card.c | 47 ++- drivers/s390/crypto/ap_queue.c | 10 +- drivers/s390/net/qeth_l2_main.c | 198 +++++----- include/linux/pci.h | 8 + include/uapi/linux/vfio.h | 3 + include/uapi/linux/vfio_ccw.h | 19 + 66 files changed, 2131 insertions(+), 1248 deletions(-) create mode 100644 Documentation/s390/pci.rst create mode 100644 arch/s390/include/asm/chsc.h create mode 100644 arch/s390/pci/pci_bus.c create mode 100644 arch/s390/pci/pci_bus.h create mode 100644 drivers/s390/cio/vfio_ccw_chp.c
Documentation/admin-guide/kernel-parameters.txt +2 -0
@@ -3669,6 +3669,8 @@ may put more devices in an IOMMU group. force_floating [S390] Force usage of floating interrupts. nomio [S390] Do not use MIO instructions. + norid [S390] ignore the RID field and force use of + one PCI domain per PCI function pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power Management.
Documentation/s390/index.rst +1 -0
@@ -15,6 +15,7 @@ s390 Architecture vfio-ccw zfcpdump common_io + pci text_files
Documentation/s390/pci.rst new file +125 -0
125 lines not on this page · raw message
Documentation/s390/vfio-ccw.rst +97 -3
125 lines not on this page · raw message
Documentation/s390/zfcpdump.rst +2 -2
@@ -46,5 +46,5 @@ initramfs with a user space application that writes the dump to a SCSI partition. For more information on how to use zfcpdump refer to the s390 'Using the Dump -Tools book', which is available from -http://www.ibm.com/developerworks/linux/linux390. +Tools' book, which is available from IBM Knowledge Center: +https://www.ibm.com/support/knowledgecenter/linuxonibm/liaaf/lnz_r_dt.html
MAINTAINERS +1 -0
@@ -14662,6 +14662,7 @@ S: Supported W: http://www.ibm.com/developerworks/linux/linux390/ F: arch/s390/pci/ F: drivers/pci/hotplug/s390_pci_hpc.c +F: Documentation/s390/pci.rst S390 VFIO AP DRIVER M: Tony Krowiak <[email protected]>
arch/s390/appldata/appldata_mem.c +0 -4
@@ -29,10 +29,6 @@* the structure version (product ID, see appldata_base.c) needs to be changed * as well and all documentation and z/VM applications using it must be * updated. -* -* The record layout is documented in the Linux for zSeries Device Drivers -* book: -* http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml */ struct appldata_mem_data {u64 timestamp;
arch/s390/appldata/appldata_net_sum.c +0 -4
@@ -25,10 +25,6 @@* This is accessed as binary data by z/VM. If changes to it can't be avoided, * the structure version (product ID, see appldata_base.c) needs to be changed * as well and all documentation and z/VM applications using it must be updated. -* -* The record layout is documented in the Linux for zSeries Device Drivers -* book: -* http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml */ struct appldata_net_sum_data {u64 timestamp;
arch/s390/appldata/appldata_os.c +0 -4
@@ -32,10 +32,6 @@* the structure version (product ID, see appldata_base.c) needs to be changed * as well and all documentation and z/VM applications using it must be * updated. -* -* The record layout is documented in the Linux for zSeries Device Drivers -* book: -* http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml */ struct appldata_os_per_cpu {u32 per_cpu_user;/* timer ticks spent in user mode */
arch/s390/include/asm/ccwdev.h +5 -0
@@ -11,6 +11,7 @@#include <linux/device.h> #include <linux/mod_devicetable.h> +#include <asm/chsc.h> #include <asm/fcx.h> #include <asm/irq.h> #include <asm/schid.h>
@@ -236,4 +237,8 @@ extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);struct channel_path_desc_fmt0 *ccw_device_get_chp_desc (struct ccw_device *,int );u8 *ccw_device_get_util_str (struct ccw_device *cdev,int chp_idx); +int ccw_device_pnso (struct ccw_device *cdev, +struct chsc_pnso_area *pnso_area, +struct chsc_pnso_resume_token resume_token, +int cnc);#endif /* _S390_CCWDEV_H_ */
arch/s390/include/asm/chsc.h new file +62 -0
62 lines not on this page · raw message
arch/s390/include/asm/io.h +1 -1
@@ -26,7 +26,7 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);#define IO_SPACE_LIMIT 0 -void __iomem *ioremap (unsigned long offset,unsigned long size); +void __iomem *ioremap (phys_addr_t addr,size_t size);void iounmap (volatile void __iomem *addr);static inline void __iomem *ioport_map (unsigned long port,unsigned int nr)
arch/s390/include/asm/ipl.h +11 -0
@@ -21,6 +21,7 @@ struct ipl_parameter_block {struct ipl_pb0_common common;struct ipl_pb0_fcp fcp;struct ipl_pb0_ccw ccw; +struct ipl_pb0_nvme nvme;char raw[PAGE_SIZE -sizeof (struct ipl_pl_hdr )]; }; } __packed__aligned(PAGE_SIZE) ;
@@ -30,6 +31,11 @@ struct ipl_parameter_block {#define IPL_BP_FCP_LEN (sizeof(struct ipl_pl_hdr) + \ sizeof(struct ipl_pb0_fcp))#define IPL_BP0_FCP_LEN (sizeof(struct ipl_pb0_fcp)) + +#define IPL_BP_NVME_LEN (sizeof(struct ipl_pl_hdr) + \ + sizeof(struct ipl_pb0_nvme)) +#define IPL_BP0_NVME_LEN (sizeof(struct ipl_pb0_nvme)) +#define IPL_BP_CCW_LEN (sizeof(struct ipl_pl_hdr) + \ sizeof(struct ipl_pb0_ccw))#define IPL_BP0_CCW_LEN (sizeof(struct ipl_pb0_ccw))
@@ -59,6 +65,7 @@ enum ipl_type {IPL_TYPE_FCP =4 ,IPL_TYPE_FCP_DUMP =8 ,IPL_TYPE_NSS =16 , + IPL_TYPE_NVME = 32, };struct ipl_info
@@ -73,6 +80,10 @@ struct ipl_infou64 wwpn;u64 lun; } fcp; +struct { +u32 fid; +u32 nsid; + } nvme;struct {char name[NSS_NAME_SIZE +1 ]; } nss;
arch/s390/include/asm/nmi.h +1 -1
@@ -99,7 +99,7 @@ int nmi_alloc_per_cpu(struct lowcore *lc);void nmi_free_per_cpu (struct lowcore *lc);void s390_handle_mcck (void ); -void s390_do_machine_check (struct pt_regs *regs); +int s390_do_machine_check (struct pt_regs *regs);#endif /* __ASSEMBLY__ */ #endif /* _ASM_S390_NMI_H */
arch/s390/include/asm/pci.h +38 -4
80 lines not on this page · raw message
arch/s390/include/asm/pci_clp.h +10 -3
@@ -93,7 +93,10 @@ struct clp_req_query_pci {struct clp_rsp_query_pci {struct clp_rsp_hdr hdr;u16 vfn;/* virtual fn number */ - u16 : 6; + u16 : 3; +u16 rid_avail :1 ; +u16 is_physfn :1 ; +u16 reserved1 :1 ;u16 mio_addr_avail :1 ;u16 util_str_avail :1 ;/* utility string available? */ u16 pfgid :8 ;/* pci function group id */
@@ -102,12 +105,16 @@ struct clp_rsp_query_pci {u16 pchid;__le32 bar[PCI_STD_NUM_BARS ];u8 pfip[CLP_PFIP_NR_SEGMENTS ];/* pci function internal path */ - u32 :16 ; + u16 :12 ; + u16 port : 4;u8 fmb_len;u8 pft;/* pci function type */ u64 sdma;/* start dma as */ u64 edma;/* end dma as */ -u32 reserved[11 ]; +#define ZPCI_RID_MASK_DEVFN 0x00ff +u16 rid;/* BUS/DEVFN PCI address */ +u16 reserved0; +u32 reserved[10 ];u32 uid;/* user defined id */ u8 util_str[CLP_UTIL_STR_LEN ];/* utility string */ u32 reserved2[16 ];
arch/s390/include/asm/processor.h +9 -11
@@ -14,17 +14,15 @@#include <linux/bits.h> -#define CIF_MCCK_PENDING 0/* machine check handling is pending */ -#define CIF_ASCE_PRIMARY 1/* primary asce needs fixup / uaccess */ -#define CIF_ASCE_SECONDARY 2/* secondary asce needs fixup / uaccess */ -#define CIF_NOHZ_DELAY 3/* delay HZ disable for a tick */ -#define CIF_FPU 4/* restore FPU registers */ -#define CIF_IGNORE_IRQ 5/* ignore interrupt (for udelay) */ -#define CIF_ENABLED_WAIT 6/* in enabled wait state */ -#define CIF_MCCK_GUEST 7/* machine check happening in guest */ -#define CIF_DEDICATED_CPU 8/* this CPU is dedicated */ - -#define _CIF_MCCK_PENDING BIT(CIF_MCCK_PENDING) +#define CIF_ASCE_PRIMARY 0/* primary asce needs fixup / uaccess */ +#define CIF_ASCE_SECONDARY 1/* secondary asce needs fixup / uaccess */ +#define CIF_NOHZ_DELAY 2/* delay HZ disable for a tick */ +#define CIF_FPU 3/* restore FPU registers */ +#define CIF_IGNORE_IRQ 4/* ignore interrupt (for udelay) */ +#define CIF_ENABLED_WAIT 5/* in enabled wait state */ +#define CIF_MCCK_GUEST 6/* machine check happening in guest */ +#define CIF_DEDICATED_CPU 7/* this CPU is dedicated */ +#define _CIF_ASCE_PRIMARY BIT(CIF_ASCE_PRIMARY)#define _CIF_ASCE_SECONDARY BIT(CIF_ASCE_SECONDARY)#define _CIF_NOHZ_DELAY BIT(CIF_NOHZ_DELAY)
arch/s390/include/asm/qdio.h +0 -33
@@ -365,34 +365,6 @@ struct qdio_initialize {struct qdio_outbuf_state *output_sbal_state_array; }; -/** -* enum qdio_brinfo_entry_type - type of address entry for qdio_brinfo_desc() -* @l3_ipv6_addr: entry contains IPv6 address -* @l3_ipv4_addr: entry contains IPv4 address -* @l2_addr_lnid: entry contains MAC address and VLAN ID -*/ -enum qdio_brinfo_entry_type {l3_ipv6_addr, l3_ipv4_addr, l2_addr_lnid}; - -/** -* struct qdio_brinfo_entry_XXX - Address entry for qdio_brinfo_desc() -* @nit: Network interface token -* @addr: Address of one of the three types -* -* The struct is passed to the callback function by qdio_brinfo_desc() -*/ -struct qdio_brinfo_entry_l3_ipv6 { -u64 nit; -struct {unsigned char _s6_addr[16 ]; } addr; -} __packed; -struct qdio_brinfo_entry_l3_ipv4 { -u64 nit; -struct {uint32_t _s_addr; } addr; -} __packed; -struct qdio_brinfo_entry_l2 { -u64 nit; -struct {u8 mac[6 ];u16 lnid; } addr_lnid; -} __packed; -#define QDIO_STATE_INACTIVE 0x00000002/* after qdio_cleanup */ #define QDIO_STATE_ESTABLISHED 0x00000004/* after qdio_establish */ #define QDIO_STATE_ACTIVE 0x00000008/* after qdio_activate */
@@ -423,10 +395,5 @@ extern int qdio_inspect_queue(struct ccw_device *cdev, unsigned int nr,extern int qdio_shutdown (struct ccw_device *,int );extern int qdio_free (struct ccw_device *);extern int qdio_get_ssqd_desc (struct ccw_device *,struct qdio_ssqd_desc *); -extern int qdio_pnso_brinfo (struct subchannel_id schid, -int cnc,u16 *response, -void (*cb)(void *priv,enum qdio_brinfo_entry_type type, -void *entry), -void *priv);#endif /* __QDIO_H__ */
arch/s390/include/asm/smp.h +1 -0
@@ -58,5 +58,6 @@ extern int smp_rescan_cpus(void);extern void __noreturn cpu_die (void );extern void __cpu_die (unsigned int cpu);extern int __cpu_disable (void ); +extern void schedule_mcck_handler (void );#endif /* __ASM_SMP_H */
arch/s390/include/uapi/asm/ipl.h +25 -0
@@ -27,6 +27,7 @@ enum ipl_pbt {IPL_PBT_FCP =0 ,IPL_PBT_SCP_DATA =1 ,IPL_PBT_CCW =2 , + IPL_PBT_NVME = 4, };/* IPL Parameter Block 0 with common fields */
@@ -67,6 +68,30 @@ struct ipl_pb0_fcp {#define IPL_PB0_FCP_OPT_IPL 0x10#define IPL_PB0_FCP_OPT_DUMP 0x20 +/* IPL Parameter Block 0 for NVMe */ +struct ipl_pb0_nvme { +__u32 len; +__u8 pbt; +__u8 reserved1[3 ]; +__u8 loadparm[8 ]; +__u8 reserved2[304 ]; +__u8 opt; +__u8 reserved3[3 ]; +__u32 fid; +__u8 reserved4[12 ]; +__u32 nsid; +__u8 reserved5[4 ]; +__u32 bootprog; +__u8 reserved6[12 ]; +__u64 br_lba; +__u32 scp_data_len; +__u8 reserved7[260 ]; +__u8 scp_data[]; +} __packed; + +#define IPL_PB0_NVME_OPT_IPL 0x10 +#define IPL_PB0_NVME_OPT_DUMP 0x20 +/* IPL Parameter Block 0 for CCW */ struct ipl_pb0_ccw {__u32 len;
arch/s390/kernel/Makefile +0 -5
@@ -33,11 +33,6 @@ CFLAGS_stacktrace.o += -fno-optimize-sibling-calls CFLAGS_dumpstack.o += -fno-optimize-sibling-calls CFLAGS_unwind_bc.o += -fno-optimize-sibling-calls -# -# Pass UTS_MACHINE for user_regset definition -# -CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' - obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o obj-y += debug.o irq.o ipl.o dis.o diag.o vdso.o
arch/s390/kernel/entry.S +110 -354
766 lines not on this page · raw message
arch/s390/kernel/ftrace.c +0 -16
@@ -72,22 +72,6 @@ static inline void ftrace_generate_orig_insn(struct ftrace_insn *insn)#endif } -static inline void ftrace_generate_kprobe_nop_insn (struct ftrace_insn *insn) -{ -#ifdef CONFIG_KPROBES - insn->opc =BREAKPOINT_INSTRUCTION ; - insn->disp =KPROBE_ON_FTRACE_NOP ; -#endif -} - -static inline void ftrace_generate_kprobe_call_insn (struct ftrace_insn *insn) -{ -#ifdef CONFIG_KPROBES - insn->opc =BREAKPOINT_INSTRUCTION ; - insn->disp =KPROBE_ON_FTRACE_CALL ; -#endif -} -int ftrace_modify_call (struct dyn_ftrace *rec,unsigned long old_addr,unsigned long addr) {
arch/s390/kernel/idle.c +4 -10
@@ -24,19 +24,19 @@ void enabled_wait(void) {struct s390_idle_data *idle =this_cpu_ptr (&s390_idle);unsigned long long idle_time; -unsigned long psw_mask; +unsigned long psw_mask, flags; -trace_hardirqs_on ();/* Wait for external, I/O or machine check interrupt. */ psw_mask =PSW_KERNEL_BITS |PSW_MASK_WAIT |PSW_MASK_DAT |PSW_MASK_IO |PSW_MASK_EXT |PSW_MASK_MCHECK ;clear_cpu_flag (CIF_NOHZ_DELAY ); +local_irq_save (flags);/* Call the assembler magic in entry.S */ psw_idle (idle, psw_mask); +local_irq_restore (flags); -trace_hardirqs_off ();/* Account time spent with enabled wait psw loaded as idle time. */ write_seqcount_begin (&idle->seqcount);
@@ -118,22 +118,16 @@ u64 arch_cpu_idle_time(int cpu)void arch_cpu_idle_enter (void ) { -local_mcck_disable (); }void arch_cpu_idle (void ) { -if (!test_cpu_flag (CIF_MCCK_PENDING )) -/* Halt the cpu and keep track of cpu time accounting. */ -enabled_wait (); +enabled_wait ();local_irq_enable (); }void arch_cpu_idle_exit (void ) { -local_mcck_enable (); -if (test_cpu_flag (CIF_MCCK_PENDING )) -s390_handle_mcck (); }void arch_cpu_idle_dead (void )
arch/s390/kernel/ipl.c +209 -0
326 lines not on this page · raw message
arch/s390/kernel/nmi.c +16 -7
@@ -148,7 +148,6 @@ void s390_handle_mcck(void)local_mcck_disable (); mcck = *this_cpu_ptr (&cpu_mcck);memset (this_cpu_ptr (&cpu_mcck),0 ,sizeof (mcck)); -clear_cpu_flag (CIF_MCCK_PENDING );local_mcck_enable ();local_irq_restore (flags);
@@ -333,7 +332,7 @@ NOKPROBE_SYMBOL(s390_backup_mcck_info);/* * machine check handler. */ -void notrace s390_do_machine_check(struct pt_regs *regs) +int notrace s390_do_machine_check(struct pt_regs *regs) {static int ipd_count;static DEFINE_SPINLOCK (ipd_lock);
@@ -342,6 +341,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)unsigned long long tmp;union mci mci;unsigned long mcck_dam_code; +int mcck_pending =0 ;nmi_enter ();inc_irq_stat (NMI_NMI );
@@ -400,7 +400,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)*/ mcck->kill_task =1 ; mcck->mcck_code = mci.val; -set_cpu_flag (CIF_MCCK_PENDING ); + mcck_pending =1 ; }/*
@@ -420,8 +420,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs) mcck->stp_queue |=stp_sync_check ();if (S390_lowcore.external_damage_code & (1U <<ED_STP_ISLAND )) mcck->stp_queue |=stp_island_check (); -if (mcck->stp_queue) -set_cpu_flag (CIF_MCCK_PENDING ); + mcck_pending =1 ; }/*
@@ -442,12 +441,12 @@ void notrace s390_do_machine_check(struct pt_regs *regs)if (mci.cp) {/* Channel report word pending */ mcck->channel_report =1 ; -set_cpu_flag (CIF_MCCK_PENDING ); + mcck_pending =1 ; }if (mci.w) {/* Warning pending */ mcck->warning =1 ; -set_cpu_flag (CIF_MCCK_PENDING ); + mcck_pending =1 ; }/*
@@ -462,7 +461,17 @@ void notrace s390_do_machine_check(struct pt_regs *regs) *((long *)(regs->gprs[15 ] + __SF_SIE_REASON)) = -EINTR ; }clear_cpu_flag (CIF_MCCK_GUEST ); + +if (user_mode (regs) && mcck_pending) { +nmi_exit (); +return 1 ; + } + +if (mcck_pending) +schedule_mcck_handler (); +nmi_exit (); +return 0 ; }NOKPROBE_SYMBOL (s390_do_machine_check);
arch/s390/kernel/ptrace.c +1 -1
@@ -1416,7 +1416,7 @@ static const struct user_regset s390_regsets[] = { };static const struct user_regset_view user_s390_view = { - .name =UTS_MACHINE , + .name ="s390x" , .e_machine =EM_S390 , .regsets = s390_regsets, .n =ARRAY_SIZE (s390_regsets)
arch/s390/kernel/setup.c +6 -10
@@ -384,8 +384,7 @@ static void __init setup_lowcore_dat_off(void) lc->restart_psw.addr = (unsigned long ) restart_int_handler; lc->external_new_psw.mask =PSW_KERNEL_BITS |PSW_MASK_MCHECK ; lc->external_new_psw.addr = (unsigned long ) ext_int_handler; - lc->svc_new_psw.mask =PSW_KERNEL_BITS | -PSW_MASK_IO |PSW_MASK_EXT |PSW_MASK_MCHECK ; + lc->svc_new_psw.mask =PSW_KERNEL_BITS |PSW_MASK_MCHECK ; lc->svc_new_psw.addr = (unsigned long ) system_call; lc->program_new_psw.mask =PSW_KERNEL_BITS |PSW_MASK_MCHECK ; lc->program_new_psw.addr = (unsigned long ) pgm_check_handler;
@@ -597,9 +596,10 @@ static void __init setup_memory_end(void)#ifdef CONFIG_CRASH_DUMP /* -* When kdump is enabled, we have to ensure that no memory from -* the area [0 - crashkernel memory size] and -* [crashk_res.start - crashk_res.end] is set offline. +* When kdump is enabled, we have to ensure that no memory from the area +* [0 - crashkernel memory size] is set offline - it will be exchanged with +* the crashkernel memory region when kdump is triggered. The crashkernel +* memory region can never get offlined (pages are unmovable). */ static int kdump_mem_notifier (struct notifier_block *nb,unsigned long action,void *data)
@@ -610,11 +610,7 @@ static int kdump_mem_notifier(struct notifier_block *nb,return NOTIFY_OK ;if (arg->start_pfn <PFN_DOWN (resource_size (&crashk_res)))return NOTIFY_BAD ; -if (arg->start_pfn >PFN_DOWN (crashk_res.end)) -return NOTIFY_OK ; -if (arg->start_pfn + arg->nr_pages -1 <PFN_DOWN (crashk_res.start)) -return NOTIFY_OK ; -return NOTIFY_BAD ; +return NOTIFY_OK ; }static struct notifier_block kdump_mem_nb = {
arch/s390/kernel/smp.c +8 -0
@@ -61,6 +61,7 @@ enum { ec_schedule =0 , ec_call_function_single, ec_stop_cpu, + ec_mcck_pending, }; enum {
@@ -403,6 +404,11 @@ int smp_find_processor_id(u16 address)return -1 ; } +void schedule_mcck_handler (void ) +{ +pcpu_ec_call (pcpu_devices +smp_processor_id (), ec_mcck_pending); +} +bool arch_vcpu_is_preempted (int cpu) {if (test_cpu_flag_of (CIF_ENABLED_WAIT , cpu))
@@ -497,6 +503,8 @@ static void smp_handle_ext_call(void)scheduler_ipi ();if (test_bit (ec_call_function_single, &bits))generic_smp_call_function_single_interrupt (); +if (test_bit (ec_mcck_pending, &bits)) +s390_handle_mcck (); } static void do_ext_call_interrupt(struct ext_code ext_code,
arch/s390/kvm/kvm-s390.c +0 -3
@@ -3995,9 +3995,6 @@ static int vcpu_pre_run(struct kvm_vcpu *vcpu)if (need_resched ())schedule (); -if (test_cpu_flag (CIF_MCCK_PENDING )) -s390_handle_mcck (); -if (!kvm_is_ucontrol (vcpu->kvm)) { rc =kvm_s390_deliver_pending_interrupts (vcpu);if (rc)
arch/s390/kvm/vsie.c +0 -2
@@ -1002,8 +1002,6 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)if (need_resched ())schedule (); -if (test_cpu_flag (CIF_MCCK_PENDING )) -s390_handle_mcck ();srcu_read_unlock (&vcpu->kvm->srcu, vcpu->srcu_idx);
arch/s390/lib/delay.c +3 -1
@@ -33,7 +33,7 @@ EXPORT_SYMBOL(__delay);static void __udelay_disabled (unsigned long long usecs) { -unsigned long cr0, cr0_new, psw_mask; +unsigned long cr0, cr0_new, psw_mask, flags;struct s390_idle_data idle;u64 end;
@@ -45,7 +45,9 @@ static void __udelay_disabled(unsigned long long usecs) psw_mask =__extract_psw () |PSW_MASK_EXT |PSW_MASK_WAIT ;set_clock_comparator (end);set_cpu_flag (CIF_IGNORE_IRQ ); +local_irq_save (flags);psw_idle (&idle, psw_mask); +local_irq_restore (flags);clear_cpu_flag (CIF_IGNORE_IRQ );set_clock_comparator (S390_lowcore.clock_comparator);__ctl_load (cr0,0 ,0 );
arch/s390/pci/Makefile +2 -1
@@ -4,4 +4,5 @@ # obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_dma.o pci_clp.o pci_sysfs.o \ - pci_event.o pci_debug.o pci_insn.o pci_mmio.o + pci_event.o pci_debug.o pci_insn.o pci_mmio.o \ + pci_bus.o
arch/s390/pci/pci.c +98 -127
358 lines not on this page · raw message
arch/s390/pci/pci_bus.c new file +328 -0
328 lines not on this page · raw message
arch/s390/pci/pci_bus.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright IBM Corp. 2020 +* +* Author(s): +* Pierre Morel <[email protected]> +* +*/ + +int zpci_bus_device_register (struct zpci_dev *zdev,struct pci_ops *ops); +void zpci_bus_device_unregister (struct zpci_dev *zdev); +int zpci_bus_init (void ); + +void zpci_release_device (struct kref *kref); +static inline void zpci_zdev_put (struct zpci_dev *zdev) +{ +kref_put (&zdev->kref, zpci_release_device); +} + +int zpci_alloc_domain (int domain); +void zpci_free_domain (int domain); +int zpci_setup_bus_resources (struct zpci_dev *zdev, +struct list_head *resources); + +static inline struct zpci_dev *get_zdev_by_bus (struct pci_bus *bus, +unsigned int devfn) +{ +struct zpci_bus *zbus = bus->sysdata; + +return (devfn >=ZPCI_FUNCTIONS_PER_BUS ) ?NULL : zbus->function[devfn]; +}
arch/s390/pci/pci_clp.c +6 -2
@@ -155,8 +155,13 @@ static int clp_store_query_pci_fn(struct zpci_dev *zdev, zdev->pfgid = response->pfgid; zdev->pft = response->pft; zdev->vfn = response->vfn; + zdev->port = response->port; zdev->uid = response->uid; zdev->fmb_length =sizeof (u32) * response->fmb_len; + zdev->rid_available = response->rid_avail; + zdev->is_physfn = response->is_physfn; +if (!s390_pci_no_rid && zdev->rid_available) + zdev->devfn = response->rid &ZPCI_RID_MASK_DEVFN ;memcpy (zdev->pfip, response->pfip,sizeof (zdev->pfip));if (response->util_str_avail) {
@@ -309,14 +314,13 @@ int clp_enable_fh(struct zpci_dev *zdev, u8 nr_dma_as)int clp_disable_fh (struct zpci_dev *zdev) { -u32 fh = zdev->fh;int rc;if (!zdev_enabled (zdev))return 0 ; rc =clp_set_pci_fn (zdev,0 ,CLP_SET_DISABLE_PCI_FN ); -zpci_dbg (3 ,"dis fid:%x, fh:%x, rc:%d\n" , zdev->fid, fh, rc); +zpci_dbg (3 ,"dis fid:%x, fh:%x, rc:%d\n" , zdev->fid, zdev->fh, rc);return rc; }
arch/s390/pci/pci_event.c +15 -24
@@ -14,6 +14,8 @@#include <asm/pci_debug.h> #include <asm/sclp.h> +#include "pci_bus.h" +/* Content Code Description for PCI Function Error */ struct zpci_ccdf_err {u32 reserved1;
@@ -53,7 +55,7 @@ static void __zpci_event_error(struct zpci_ccdf_err *ccdf)zpci_err_hex (ccdf,sizeof (*ccdf));if (zdev) - pdev =pci_get_slot (zdev->bus,ZPCI_DEVFN ); + pdev =pci_get_slot (zdev->zbus->bus, zdev->devfn);pr_err ("%s: Event 0x%x reports an error for PCI function 0x%x\n" , pdev ?pci_name (pdev) :"n/a" , ccdf->pec, ccdf->fid);
@@ -78,36 +80,28 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)enum zpci_state state;int ret; -if (zdev) - pdev =pci_get_slot (zdev->bus,ZPCI_DEVFN ); +if (zdev && zdev->zbus && zdev->zbus->bus) + pdev =pci_get_slot (zdev->zbus->bus, zdev->devfn); -pr_info ("%s: Event 0x%x reconfigured PCI function 0x%x\n" , - pdev ?pci_name (pdev) :"n/a" , ccdf->pec, ccdf->fid);zpci_err ("avail CCDF:\n" );zpci_err_hex (ccdf,sizeof (*ccdf));switch (ccdf->pec) {case 0x0301 :/* Reserved|Standby -> Configured */ if (!zdev) { - ret =clp_add_pci_device (ccdf->fid, ccdf->fh,0 ); -if (ret) -break ; - zdev =get_zdev_by_fid (ccdf->fid); - } -if (!zdev || zdev->state !=ZPCI_FN_STATE_STANDBY ) + ret =clp_add_pci_device (ccdf->fid, ccdf->fh,1 );break ; - zdev->state =ZPCI_FN_STATE_CONFIGURED ; + } zdev->fh = ccdf->fh; - ret =zpci_enable_device (zdev); -if (ret) -break ; -pci_lock_rescan_remove (); -pci_rescan_bus (zdev->bus); -pci_unlock_rescan_remove (); + zdev->state =ZPCI_FN_STATE_CONFIGURED ; +zpci_create_device (zdev);break ;case 0x0302 :/* Reserved -> Standby */ -if (!zdev) +if (!zdev) {clp_add_pci_device (ccdf->fid, ccdf->fh,0 ); +break ; + } + zdev->fh = ccdf->fh;break ;case 0x0303 :/* Deconfiguration requested */ if (!zdev)
@@ -135,12 +129,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)pci_stop_and_remove_bus_device_locked (pdev); } - zdev->fh = ccdf->fh; -zpci_disable_device (zdev); zdev->state =ZPCI_FN_STATE_STANDBY ;if (!clp_get_state (ccdf->fid, &state) && state ==ZPCI_FN_STATE_RESERVED ) { -zpci_remove_device (zdev); +zpci_zdev_put (zdev); }break ;case 0x0306 :/* 0x308 or 0x302 for multiple devices */
@@ -149,12 +141,11 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)case 0x0308 :/* Standby -> Reserved */ if (!zdev)break ; -zpci_remove_device (zdev); +zpci_zdev_put (zdev);break ;default :break ; } -pci_dev_put (pdev); }void zpci_event_availability (void *data)
arch/s390/pci/pci_sysfs.c +3 -1
@@ -33,6 +33,7 @@ zpci_attr(pchid, "0x%04x\n", pchid);zpci_attr (pfgid,"0x%02x\n" , pfgid);zpci_attr (vfn,"0x%04x\n" , vfn);zpci_attr (pft,"0x%02x\n" , pft); +zpci_attr (port,"%d\n" , port);zpci_attr (uid,"0x%x\n" , uid);zpci_attr (segment0,"0x%02x\n" , pfip[0 ]);zpci_attr (segment1,"0x%02x\n" , pfip[1 ]);
@@ -88,7 +89,7 @@ static ssize_t recover_store(struct device *dev, struct device_attribute *attr, ret =zpci_enable_device (zdev);if (ret) goto out; -pci_rescan_bus (zdev->bus); +pci_rescan_bus (zdev->zbus->bus); } out:pci_unlock_rescan_remove ();
@@ -142,6 +143,7 @@ static struct attribute *zpci_dev_attrs[] = { &dev_attr_pchid.attr, &dev_attr_pfgid.attr, &dev_attr_pft.attr, + &dev_attr_port.attr, &dev_attr_vfn.attr, &dev_attr_uid.attr, &dev_attr_recover.attr,
drivers/iommu/s390-iommu.c +4 -4
@@ -87,7 +87,7 @@ static int s390_iommu_attach_device(struct iommu_domain *domain, struct device *dev) {struct s390_domain *s390_domain =to_s390_domain (domain); -struct zpci_dev *zdev =to_pci_dev (dev)->sysdata; +struct zpci_dev *zdev =to_zpci_dev (dev);struct s390_domain_device *domain_device;unsigned long flags;int rc;
@@ -139,7 +139,7 @@ static void s390_iommu_detach_device(struct iommu_domain *domain, struct device *dev) {struct s390_domain *s390_domain =to_s390_domain (domain); -struct zpci_dev *zdev =to_pci_dev (dev)->sysdata; +struct zpci_dev *zdev =to_zpci_dev (dev);struct s390_domain_device *domain_device, *tmp;unsigned long flags;int found =0 ;
@@ -169,7 +169,7 @@ static void s390_iommu_detach_device(struct iommu_domain *domain,static int s390_iommu_add_device (struct device *dev) {struct iommu_group *group =iommu_group_get_for_dev (dev); -struct zpci_dev *zdev =to_pci_dev (dev)->sysdata; +struct zpci_dev *zdev =to_zpci_dev (dev);if (IS_ERR (group))return PTR_ERR (group);
@@ -182,7 +182,7 @@ static int s390_iommu_add_device(struct device *dev)static void s390_iommu_remove_device (struct device *dev) { -struct zpci_dev *zdev =to_pci_dev (dev)->sysdata; +struct zpci_dev *zdev =to_zpci_dev (dev);struct iommu_domain *domain;/*
drivers/pci/hotplug/s390_pci_hpc.c +11 -5
@@ -52,6 +52,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot) { struct zpci_dev *zdev = container_of(hotplug_slot, struct zpci_dev, hotplug_slot); +struct zpci_bus *zbus = zdev->zbus;int rc;if (zdev->state !=ZPCI_FN_STATE_STANDBY )
@@ -65,9 +66,9 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)if (rc) goto out_deconfigure; -pci_scan_slot (zdev->bus,ZPCI_DEVFN ); +pci_scan_slot (zbus->bus, zdev->devfn);pci_lock_rescan_remove (); -pci_bus_add_devices (zdev->bus); +pci_bus_add_devices (zbus->bus);pci_unlock_rescan_remove ();return rc;
@@ -82,13 +83,17 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) struct zpci_dev *zdev = container_of(hotplug_slot, struct zpci_dev, hotplug_slot);struct pci_dev *pdev; +struct zpci_bus *zbus = zdev->zbus;int rc;if (!zpci_fn_configured (zdev->state))return -EIO ; - pdev =pci_get_slot (zdev->bus,ZPCI_DEVFN ); + pdev =pci_get_slot (zbus->bus, zdev->devfn);if (pdev) { +if (pci_num_vf (pdev)) +return -EBUSY ; +pci_stop_and_remove_bus_device_locked (pdev);pci_dev_put (pdev); }
@@ -133,12 +138,13 @@ static const struct hotplug_slot_ops s390_hotplug_slot_ops = {int zpci_init_slot (struct zpci_dev *zdev) {char name[SLOT_NAME_SIZE ]; +struct zpci_bus *zbus = zdev->zbus; zdev->hotplug_slot.ops = &s390_hotplug_slot_ops;snprintf (name,SLOT_NAME_SIZE ,"%08x" , zdev->fid); -return pci_hp_register (&zdev->hotplug_slot, zdev->bus, -ZPCI_DEVFN , name); +return pci_hp_register (&zdev->hotplug_slot, zbus->bus, + zdev->devfn, name); }void zpci_exit_slot (struct zpci_dev *zdev)
drivers/pci/iov.c +25 -14
@@ -133,12 +133,35 @@ static void pci_read_vf_config_common(struct pci_dev *virtfn) &physfn->sriov->subsystem_device); } +int pci_iov_sysfs_link (struct pci_dev *dev, +struct pci_dev *virtfn,int id) +{ +char buf[VIRTFN_ID_LEN ]; +int rc; + +sprintf (buf,"virtfn%u" , id); + rc =sysfs_create_link (&dev->dev.kobj, &virtfn->dev.kobj, buf); +if (rc) + goto failed; + rc =sysfs_create_link (&virtfn->dev.kobj, &dev->dev.kobj,"physfn" ); +if (rc) + goto failed1; + +kobject_uevent (&virtfn->dev.kobj,KOBJ_CHANGE ); + +return 0 ; + +failed1: +sysfs_remove_link (&dev->dev.kobj, buf); +failed: +return rc; +} +int pci_iov_add_virtfn (struct pci_dev *dev,int id) {int i;int rc = -ENOMEM ;
Lines of this file are not shown. View the raw message.
drivers/s390/cio/chsc.h +4 -46
50 lines not on this page · raw message
drivers/s390/cio/qdio_main.c +70 -229
299 lines not on this page · raw message
drivers/s390/cio/qdio_setup.c +63 -37
100 lines not on this page · raw message
drivers/s390/cio/qdio_thinint.c +27 -34
61 lines not on this page · raw message
drivers/s390/cio/vfio_ccw_chp.c new file +148 -0
148 lines not on this page · raw message
drivers/s390/cio/vfio_ccw_drv.c +155 -10
165 lines not on this page · raw message
drivers/s390/cio/vfio_ccw_ops.c +49 -16
65 lines not on this page · raw message
drivers/s390/crypto/ap_bus.c +54 -40
94 lines not on this page · raw message
drivers/s390/crypto/ap_card.c +23 -24
47 lines not on this page · raw message
drivers/s390/net/qeth_l2_main.c +109 -89
198 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 2 lines · Vasily Gorbik
Please note 2 minor merge conflict resolutions below:
There was a third because of the iommu tree I merged today.
That one looked trivial too, but please double-check things anyway,
Linus
Quoted 6 lines · Linus Torvalds
Quoted 2 lines · Vasily Gorbik
Please note 2 minor merge conflict resolutions below:
There was a third because of the iommu tree I merged today.
Oh, and please don't post the whole patch in your pull request.
That's ok for small "fixes" pulls, but it's absolutely the wrong thing to do with thousands of lines, nobody is going to review that anyway when the review is supposed to happen on the individual patches.
I'm surprised it even made it to lkml at almost 200k in size.
Linus
The pull request you sent on Mon, 8 Jun 2020 17:34:39 +0200:
The pull request you sent on Mon, 8 Jun 2020 17:34:39 +0200:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.gittags/s390-5.8-1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/23fc02e36e4f657af242e59175c891b27c704935
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker
Vasily Gorbik
maintainerQuoted 8 lines · Linus Torvalds
Quoted 6 lines · Linus Torvalds
Quoted 2 lines · Vasily Gorbik
Please note 2 minor merge conflict resolutions below:
There was a third because of the iommu tree I merged today.
Looks fine, thank you.
Quoted 1 line
Oh, and please don't post the whole patch in your pull request.
Yes, this was not intentional. Sorry about that.
Vasily