s390: vfio-ccw dasd ipl support
v3 cover s390: vfio-ccw dasd ipl support
This is to support booting from vfio-ccw dasd devices. We basically implement the real hardware ipl procedure. This allows for booting Linux guests on vfio-ccw devices.
vfio-ccw's channel program prefetch algorithm complicates ipl because most ipl channel programs dynamically modify themselves. Details on the ipl process and how we worked around this issue can be found in docs/devel/s390-dasd-ipl.txt.
Note to Connie: In the v2 review you mentioned some issues with the error handling code involving printing of the eckd dasd sense data. I've addressed those concerns in a new patch just to make those changes clearly stand out from the rest of the code. I can squash them into patches 10, 11, and 15 if you prefer that to having it as a separate patch.
Changelog
==========
v3
01/16: s390 vfio-ccw: Add bootindex property and IPLB data
- Refactored s390_get_ccw_device() to return device type
- Made VFIOCCWDevice private
- Fixed copyright date
- ipl.c: Remove unneeded cast
- Add new file to maintainers
05/16: s390-bios: Factor finding boot device out of virtio code path
- main.c: Remove redundant condition from assert statement
06/16: s390-bios: Clean up cio.h
- Switch formating of bit fields to make checkpatch happy
07/16: s390-bios: Decouple channel i/o logic from virtio
- Fixed copyright statement
- Remove unneeded include in virtio-blkdev.c
08/16: s390-bios: Map low core memory
- Removed packed attribute from psw structs, added static size asserts
- Fix copyright date
09/16: s390-bios: ptr2u32 and u32toptr
- Move new functions out of stdlib.h and into helper.h
10/16: s390-bios: Support for running format-0/1 channel programs
- Rework do_cio (create __do_cio) to avoid possible infinite recursion in error cases.
- Switch formating of bit fields to make checkpatch happy
- cio.c: Include helper.c for new pointer conversion functions
- cio.c: Rename sense_data_eckd_dasd to SenseDataEckdDasd
11/16: s390-bios: cio error handling
- Only print dasd sense data if we have a dasd device, or on initial query of control unit type
- Fixed ccw casting
12/16: s390-bios: Refactor virtio to run channel programs via cio
- Include helper.c for new pointer conversion functions
15/16: s390-bios: Support booting from real dasd device
- dasd-ipl.c: Fix sizeof's
- s390-dasd-ipl.c: Fix section "How this all pertains to QEMU" to detail vfio-ccw driver's role.
- s390-dasd-ipl.c: Replace all instances of Qemu with QEMU
- Added docs/devel/s390-dasd-ipl.txt to MAINTAINERS
- s390-dasd-ipl.c: Include helper.c for new pointer conversion functions
Jason J. Herne (16):
s390 vfio-ccw: Add bootindex property and IPLB data
s390-bios: decouple cio setup from virtio
s390-bios: decouple common boot logic from virtio
s390-bios: Extend find_dev() for non-virtio devices
s390-bios: Factor finding boot device out of virtio code path
s390-bios: Clean up cio.h
s390-bios: Decouple channel i/o logic from virtio
s390-bios: Map low core memory
s390-bios: ptr2u32 and u32toptr
s390-bios: Support for running format-0/1 channel programs
s390-bios: cio error handling
s390-bios: Refactor virtio to run channel programs via cio
s390-bios: Use control unit type to determine boot method
s390-bios: Add channel command codes/structs needed for dasd-ipl
s390-bios: Support booting from real dasd device
s390-bios: dasd-ipl: Use control unit type to customize error data
MAINTAINERS | 2 + docs/devel/s390-dasd-ipl.txt | 133 ++++++++++++++ hw/s390x/ipl.c | 39 +++- hw/s390x/s390-ccw.c | 9 + hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 +++ pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/cio.c | 418 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 307 +++++++++++++++++++++++-------- pc-bios/s390-ccw/dasd-ipl.c | 250 ++++++++++++++++++++++++++ pc-bios/s390-ccw/dasd-ipl.h | 16 ++ pc-bios/s390-ccw/helper.h | 16 ++ pc-bios/s390-ccw/libc.h | 11 ++ pc-bios/s390-ccw/main.c | 159 ++++++++++------ pc-bios/s390-ccw/netboot.mak | 2 +- pc-bios/s390-ccw/netmain.c | 1 + pc-bios/s390-ccw/s390-arch.h | 115 ++++++++++++ pc-bios/s390-ccw/s390-ccw.h | 10 +- pc-bios/s390-ccw/start.S | 31 ++++ pc-bios/s390-ccw/virtio.c | 74 +++----- tests/boot-serial-test.c | 2 +- 22 files changed, 1422 insertions(+), 206 deletions(-) create mode 100644 docs/devel/s390-dasd-ipl.txt create mode 100644 include/hw/s390x/vfio-ccw.h create mode 100644 pc-bios/s390-ccw/cio.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.h create mode 100644 pc-bios/s390-ccw/helper.h create mode 100644 pc-bios/s390-ccw/s390-arch.h
--
2.7.4
PATCH v3 1/16 s390 vfio-ccw: Add bootindex property and IPLB data
Add bootindex property and iplb data for vfio-ccw devices. This allows us to forward boot information into the bios for vfio-ccw devices.
Refactor s390_get_ccw_device() to return device type. This prevents us from having to use messy casting logic in several places.
--- MAINTAINERS | 1 + hw/s390x/ipl.c | 39 +++++++++++++++++++++++++++++++++------ hw/s390x/s390-ccw.c | 9 +++++++++ hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 ++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 include/hw/s390x/vfio-ccw.h
MAINTAINERS +1 -0
@@ -1400,6 +1400,7 @@ S: Supported F: hw/vfio/ccw.c F: hw/s390x/s390-ccw.c F: include/hw/s390x/s390-ccw.h +F: include/hw/s390x/vfio-ccw.h T: git https://github.com/cohuck/qemu.git s390-next L: [email protected]
hw/s390x/ipl.c +33 -6
@@ -19,6 +19,7 @@#include "hw/loader.h" #include "hw/boards.h" #include "hw/s390x/virtio-ccw.h" +#include "hw/s390x/vfio-ccw.h" #include "hw/s390x/css.h" #include "hw/s390x/ebcdic.h" #include "ipl.h"
@@ -305,16 +306,29 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl) *timeout =cpu_to_be32 (splash_time); } -static CcwDevice *s390_get_ccw_device (DeviceState *dev_st) +#define CCW_DEVTYPE_NONE 0x00 +#define CCW_DEVTYPE_VIRTIO 0x01 +#define CCW_DEVTYPE_SCSI 0x02 +#define CCW_DEVTYPE_VFIO 0x03 + +static CcwDevice *s390_get_ccw_device (DeviceState *dev_st,int * devtype) {CcwDevice *ccw_dev =NULL ; + *devtype =CCW_DEVTYPE_NONE ; +if (dev_st) {VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)object_dynamic_cast (OBJECT (qdev_get_parent_bus (dev_st)->parent),TYPE_VIRTIO_CCW_DEVICE ); +VFIOCCWDevice *vfio_ccw_dev = (VFIOCCWDevice *) +object_dynamic_cast (OBJECT (dev_st),TYPE_VFIO_CCW );if (virtio_ccw_dev) { ccw_dev =CCW_DEVICE (virtio_ccw_dev); + *devtype =CCW_DEVTYPE_VIRTIO ; + }else if (vfio_ccw_dev) { + ccw_dev =CCW_DEVICE (vfio_ccw_dev); + *devtype =CCW_DEVTYPE_VFIO ; }else {SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),
@@ -327,6 +341,7 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st) ccw_dev = (CcwDevice *)object_dynamic_cast (OBJECT (scsi_ccw),TYPE_CCW_DEVICE ); + *devtype =CCW_DEVTYPE_SCSI ; } } }
@@ -337,10 +352,11 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) {DeviceState *dev_st;CcwDevice *ccw_dev =NULL ; +int devtype; dev_st =get_boot_device (0 );if (dev_st) { - ccw_dev =s390_get_ccw_device (dev_st); + ccw_dev =s390_get_ccw_device (dev_st, &devtype); }/*
@@ -349,8 +365,10 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (ccw_dev) {SCSIDevice *sd = (SCSIDevice *)object_dynamic_cast (OBJECT (dev_st),TYPE_SCSI_DEVICE ); +VirtIONet *vn; -if (sd) { +switch (devtype) { +case CCW_DEVTYPE_SCSI : ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN ); ipl->iplb.blk0_len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN -S390_IPLB_HEADER_LEN );
@@ -360,8 +378,15 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) ipl->iplb.scsi.channel =cpu_to_be16 (sd->channel); ipl->iplb.scsi.devno =cpu_to_be16 (ccw_dev->sch->devno); ipl->iplb.scsi.ssid = ccw_dev->sch->ssid &3 ; - }else { -VirtIONet *vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st), +break ; +case CCW_DEVTYPE_VFIO : + ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN ); + ipl->iplb.pbt =S390_IPL_TYPE_CCW ; + ipl->iplb.ccw.devno =cpu_to_be16 (ccw_dev->sch->devno); + ipl->iplb.ccw.ssid = ccw_dev->sch->ssid &3 ; +break ; +case CCW_DEVTYPE_VIRTIO : + vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st),TYPE_VIRTIO_NET ); ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN );
@@ -374,6 +399,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (vn) { ipl->netboot = true; } +break ; }if (!s390_ipl_set_loadparm (ipl->iplb.loadparm)) {
@@ -518,6 +544,7 @@ IplParameterBlock *s390_ipl_get_iplb(void)void s390_ipl_reset_request (CPUState *cs,enum s390_reset reset_type) {S390IPLState *ipl =get_ipl_device (); +int devtype;if (reset_type ==S390_RESET_EXTERNAL || reset_type ==S390_RESET_REIPL ) {/* use CPU 0 for full resets */
@@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt ==S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { - CcwDevice *ccw_dev = s390_get_ccw_device(get_boot_device(0)); + CcwDevice *ccw_dev = s390_get_ccw_device(get_boot_device(0), &devtype); if (ccw_dev && cpu_to_be16(ccw_dev->sch->devno) == ipl->iplb.ccw.devno &&
hw/s390x/s390-ccw.c +9 -0
@@ -124,6 +124,14 @@ static void s390_ccw_unrealize(S390CCWDevice *cdev, Error **errp)g_free (cdev->mdevid); } +static void s390_ccw_instance_init (Object *obj) +{ +S390CCWDevice *dev =S390_CCW_DEVICE (obj); + +device_add_bootindex_property (obj, &dev->bootindex,"bootindex" , +"/disk@0,0" ,DEVICE (obj),NULL ); +} +static void s390_ccw_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);
@@ -137,6 +145,7 @@ static void s390_ccw_class_init(ObjectClass *klass, void *data)static const TypeInfo s390_ccw_info = { .name =TYPE_S390_CCW , .parent =TYPE_CCW_DEVICE , + .instance_init = s390_ccw_instance_init, .instance_size =sizeof (S390CCWDevice), .class_size =sizeof (S390CCWDeviceClass), .class_init = s390_ccw_class_init,
hw/vfio/ccw.c +1 -1
@@ -21,11 +21,11 @@#include "hw/vfio/vfio.h" #include "hw/vfio/vfio-common.h" #include "hw/s390x/s390-ccw.h" +#include "hw/s390x/vfio-ccw.h" #include "hw/s390x/ccw-device.h" #include "exec/address-spaces.h" #include "qemu/error-report.h" -#define TYPE_VFIO_CCW "vfio-ccw" typedef struct VFIOCCWDevice { S390CCWDevice cdev; VFIODevice vdev;
include/hw/s390x/s390-ccw.h +1 -0
@@ -27,6 +27,7 @@ typedef struct S390CCWDevice {CcwDevice parent_obj;CssDevId hostid;char *mdevid; +int32_t bootindex; } S390CCWDevice; typedef struct S390CCWDeviceClass {
include/hw/s390x/vfio-ccw.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* vfio based subchannel assignment support +* +* Copyright 2017 IBM Corp. +* Author(s): Dong Jia Shi <[email protected]> +* Xiao Feng Ren <[email protected]> +* Pierre Morel <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#ifndef HW_VFIO_CCW_H +#define HW_VFIO_CCW_H + +#include "hw/vfio/vfio-common.h" +#include "hw/s390x/s390-ccw.h" +#include "hw/s390x/ccw-device.h" + +#define TYPE_VFIO_CCW "vfio-ccw" +#define VFIO_CCW (obj) \ + OBJECT_CHECK(VFIOCCWDevice, (obj), TYPE_VFIO_CCW) + +#define TYPE_VFIO_CCW "vfio-ccw" +typedef struct VFIOCCWDevice VFIOCCWDevice ; + +#endif
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 18 lines · On Fri, 1 Mar 2019 13:59:21 -0500 "Jason J. Herne" <[email protected]>…
Add bootindex property and iplb data for vfio-ccw devices. This allows us to forward boot information into the bios for vfio-ccw devices.
Refactor
s390_get_ccw_device()to return device type. This prevents us from having to use messy casting logic in several places.Signed-off-by Jason J. Herne <[email protected]>Acked-by Halil Pasic <[email protected]>--- MAINTAINERS | 1 + hw/s390x/ipl.c | 39 +++++++++++++++++++++++++++++++++------ hw/s390x/s390-ccw.c | 9 +++++++++ hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 ++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 include/hw/s390x/vfio-ccw.h
(...)
hw/s390x/ipl.c static void s390_ipl_set_boot_menu(S390IPLState *ipl) · line 312
Quoted 9 lines
hw/s390x/ipl.c +4
-1@@ -305,16 +306,29 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl) *timeout =cpu_to_be32 (splash_time); } -static CcwDevice *s390_get_ccw_device (DeviceState *dev_st) +#define CCW_DEVTYPE_NONE 0x00 +#define CCW_DEVTYPE_VIRTIO 0x01 +#define CCW_DEVTYPE_SCSI 0x02 +#define CCW_DEVTYPE_VFIO 0x03
Hm, how would the code look if you introduced a CCW_DEVTYPE_VIRTIO_NET or so? You could use the simply set the netboot flag in get_initial_iplb and fall through to the handling of CCW_DEVTYPE_VIRTIO...
hw/s390x/ipl.c static void s390_ipl_set_boot_menu(S390IPLState *ipl) · line 314
Quoted 2 lines
hw/s390x/ipl.c +2
-0+ +static CcwDevice *s390_get_ccw_device (DeviceState *dev_st,int * devtype)
s/int* devtype/int *devtype/
Quoted 42 lines
hw/s390x/ipl.c +11
-1{CcwDevice *ccw_dev =NULL ; + *devtype =CCW_DEVTYPE_NONE ; +if (dev_st) {VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)object_dynamic_cast (OBJECT (qdev_get_parent_bus (dev_st)->parent),TYPE_VIRTIO_CCW_DEVICE ); +VFIOCCWDevice *vfio_ccw_dev = (VFIOCCWDevice *) +object_dynamic_cast (OBJECT (dev_st),TYPE_VFIO_CCW );if (virtio_ccw_dev) { ccw_dev =CCW_DEVICE (virtio_ccw_dev); + *devtype =CCW_DEVTYPE_VIRTIO ; + }else if (vfio_ccw_dev) { + ccw_dev =CCW_DEVICE (vfio_ccw_dev); + *devtype =CCW_DEVTYPE_VFIO ; }else {SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),@@ -327,6 +341,7 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st) ccw_dev = (CcwDevice *)object_dynamic_cast (OBJECT (scsi_ccw),TYPE_CCW_DEVICE ); + *devtype =CCW_DEVTYPE_SCSI ; } } }@@ -337,10 +352,11 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) {DeviceState *dev_st;CcwDevice *ccw_dev =NULL ; +int devtype; dev_st =get_boot_device (0 );if (dev_st) { - ccw_dev =s390_get_ccw_device (dev_st); + ccw_dev =s390_get_ccw_device (dev_st, &devtype); }/*
hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 368
Quoted 4 lines
hw/s390x/ipl.c +1
-0@@ -349,8 +365,10 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (ccw_dev) {SCSIDevice *sd = (SCSIDevice *)object_dynamic_cast (OBJECT (dev_st),TYPE_SCSI_DEVICE ); +VirtIONet *vn;
I think you could get rid of this variable with my suggestion from above.
hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 371
Quoted 4 lines
hw/s390x/ipl.c +2
-1-if (sd) { +switch (devtype) { +case CCW_DEVTYPE_SCSI :
Move obtaining sd into this case?
Quoted 38 lines
hw/s390x/ipl.c +11
-2ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN ); ipl->iplb.blk0_len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN -S390_IPLB_HEADER_LEN );@@ -360,8 +378,15 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) ipl->iplb.scsi.channel =cpu_to_be16 (sd->channel); ipl->iplb.scsi.devno =cpu_to_be16 (ccw_dev->sch->devno); ipl->iplb.scsi.ssid = ccw_dev->sch->ssid &3 ; - }else { -VirtIONet *vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st), +break ; +case CCW_DEVTYPE_VFIO : + ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN ); + ipl->iplb.pbt =S390_IPL_TYPE_CCW ; + ipl->iplb.ccw.devno =cpu_to_be16 (ccw_dev->sch->devno); + ipl->iplb.ccw.ssid = ccw_dev->sch->ssid &3 ; +break ; +case CCW_DEVTYPE_VIRTIO : + vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st),TYPE_VIRTIO_NET ); ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN );@@ -374,6 +399,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (vn) { ipl->netboot = true; } +break ; }if (!s390_ipl_set_loadparm (ipl->iplb.loadparm)) {@@ -518,6 +544,7 @@ IplParameterBlock *s390_ipl_get_iplb(void)void s390_ipl_reset_request (CPUState *cs,enum s390_reset reset_type) {S390IPLState *ipl =get_ipl_device (); +int devtype;if (reset_type ==S390_RESET_EXTERNAL || reset_type ==S390_RESET_REIPL ) {/* use CPU 0 for full resets */
hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 562
Quoted 5 lines
hw/s390x/ipl.c +1
-1@@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt == S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { -CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 )); +CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 ), &devtype);
It feels wrong to have a variable that is not used later... what about either
- making s390_get_ccw_device() capable of handling a NULL second parameter, or
- (what I think would be nicer) passing in the devtype as an optional parameter to gen_initial_iplb() so you don't need to do the casting dance twice?
Quoted 3 lines
hw/s390x/ipl.c +0
-0if (ccw_dev && cpu_to_be16(ccw_dev->sch->devno) == ipl->iplb.ccw.devno &&
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 134 lines · Cornelia Huck
Quoted 18 lines · On Fri, 1 Mar 2019 13:59:21 -0500 "Jason J. Herne" <[email protected]>…
Add bootindex property and iplb data for vfio-ccw devices. This allows us to forward boot information into the bios for vfio-ccw devices.
Refactor
s390_get_ccw_device()to return device type. This prevents us from having to use messy casting logic in several places.Signed-off-by Jason J. Herne <[email protected]>Acked-by Halil Pasic <[email protected]>--- MAINTAINERS | 1 + hw/s390x/ipl.c | 39 +++++++++++++++++++++++++++++++++------ hw/s390x/s390-ccw.c | 9 +++++++++ hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 ++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 7 deletions(-)create mode 100644
include/hw/s390x/vfio-ccw.h(...)
hw/s390x/ipl.c static void s390_ipl_set_boot_menu(S390IPLState *ipl) · line 312
Quoted 9 lines
hw/s390x/ipl.c +4
-1@@ -305,16 +306,29 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl) *timeout =cpu_to_be32 (splash_time); } -static CcwDevice *s390_get_ccw_device (DeviceState *dev_st) +#define CCW_DEVTYPE_NONE 0x00 +#define CCW_DEVTYPE_VIRTIO 0x01 +#define CCW_DEVTYPE_SCSI 0x02 +#define CCW_DEVTYPE_VFIO 0x03Hm, how would the code look if you introduced a
CCW_DEVTYPE_VIRTIO_NETor so? You could use the simply set the netboot flag inget_initial_iplband fall through to the handling ofCCW_DEVTYPE_VIRTIO...hw/s390x/ipl.c static void s390_ipl_set_boot_menu(S390IPLState *ipl) · line 314
Quoted 2 lines
hw/s390x/ipl.c +2
-0+ +static CcwDevice *s390_get_ccw_device (DeviceState *dev_st,int * devtype)s/int* devtype/int *devtype/
Quoted 42 lines
hw/s390x/ipl.c +11
-1{CcwDevice *ccw_dev =NULL ; + *devtype =CCW_DEVTYPE_NONE ; +if (dev_st) {VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)object_dynamic_cast (OBJECT (qdev_get_parent_bus (dev_st)->parent),TYPE_VIRTIO_CCW_DEVICE ); +VFIOCCWDevice *vfio_ccw_dev = (VFIOCCWDevice *) +object_dynamic_cast (OBJECT (dev_st),TYPE_VFIO_CCW );if (virtio_ccw_dev) { ccw_dev =CCW_DEVICE (virtio_ccw_dev); + *devtype =CCW_DEVTYPE_VIRTIO ; + }else if (vfio_ccw_dev) { + ccw_dev =CCW_DEVICE (vfio_ccw_dev); + *devtype =CCW_DEVTYPE_VFIO ; }else {SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),@@ -327,6 +341,7 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st) ccw_dev = (CcwDevice *)object_dynamic_cast (OBJECT (scsi_ccw),TYPE_CCW_DEVICE ); + *devtype =CCW_DEVTYPE_SCSI ; } } }@@ -337,10 +352,11 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) {DeviceState *dev_st;CcwDevice *ccw_dev =NULL ; +int devtype; dev_st =get_boot_device (0 );if (dev_st) { - ccw_dev =s390_get_ccw_device (dev_st); + ccw_dev =s390_get_ccw_device (dev_st, &devtype); }/* hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 368
Quoted 4 lines
hw/s390x/ipl.c +1
-0@@ -349,8 +365,10 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (ccw_dev) {SCSIDevice *sd = (SCSIDevice *)object_dynamic_cast (OBJECT (dev_st),TYPE_SCSI_DEVICE ); +VirtIONet *vn;I think you could get rid of this variable with my suggestion from above.
hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 371
Quoted 4 lines
hw/s390x/ipl.c +2
-1-if (sd) { +switch (devtype) { +case CCW_DEVTYPE_SCSI :Move obtaining sd into this case?
Quoted 35 lines
hw/s390x/ipl.c +11
-2ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN ); ipl->iplb.blk0_len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN -S390_IPLB_HEADER_LEN );@@ -360,8 +378,15 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) ipl->iplb.scsi.channel =cpu_to_be16 (sd->channel); ipl->iplb.scsi.devno =cpu_to_be16 (ccw_dev->sch->devno); ipl->iplb.scsi.ssid = ccw_dev->sch->ssid &3 ; - }else { -VirtIONet *vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st), +break ; +case CCW_DEVTYPE_VFIO : + ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN ); + ipl->iplb.pbt =S390_IPL_TYPE_CCW ; + ipl->iplb.ccw.devno =cpu_to_be16 (ccw_dev->sch->devno); + ipl->iplb.ccw.ssid = ccw_dev->sch->ssid &3 ; +break ; +case CCW_DEVTYPE_VIRTIO : + vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st),TYPE_VIRTIO_NET ); ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN );@@ -374,6 +399,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (vn) { ipl->netboot = true; } +break ; }if (!s390_ipl_set_loadparm (ipl->iplb.loadparm)) {@@ -518,6 +544,7 @@ IplParameterBlock *s390_ipl_get_iplb(void)void s390_ipl_reset_request (CPUState *cs,enum s390_reset reset_type) {S390IPLState *ipl =get_ipl_device (); +int devtype;
Quoted 17 lines
hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 562
Quoted 8 lines
hw/s390x/ipl.c +1
-1if (reset_type ==S390_RESET_EXTERNAL || reset_type ==S390_RESET_REIPL ) {/* use CPU 0 for full resets */ @@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt == S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { -CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 )); +CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 ), &devtype);It feels wrong to have a variable that is not used later... what about either
- makings390_get_ccw_device()capable of handling a NULL second parameter, or
- (what I think would be nicer) passing in the devtype as an optional parameter togen_initial_iplb()so you don't need to do the casting dance twice?
I'm with you on everything suggested for this patch except this last item. I'm not sure what you are suggesting here. I can easily visualize passing NULL for devtype when we want to ignore it but I'm not sure what you mean by 'optional parameter'
Quoted 5 lines
Quoted 3 lines
hw/s390x/ipl.c +0
-0if (ccw_dev && cpu_to_be16(ccw_dev->sch->devno) == ipl->iplb.ccw.devno &&
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 20 lines · On Wed, 6 Mar 2019 09:55:40 -0500 "Jason J. Herne" <[email protected]>…
Quoted 18 lines · Cornelia Huck
hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 562
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:21 -0500 "Jason J. Herne" <[email protected]>…
hw/s390x/ipl.c +1
-1@@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt == S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { -CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 )); +CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 ), &devtype);It feels wrong to have a variable that is not used later... what about either
- makings390_get_ccw_device()capable of handling a NULL second parameter, or
- (what I think would be nicer) passing in the devtype as an optional parameter togen_initial_iplb()so you don't need to do the casting dance twice?
Quoted 3 lines
I'm with you on everything suggested for this patch except this last item. I'm not sure what you are suggesting here. I can easily visualize passing NULL for devtype when we want to ignore it but I'm not sure what you mean by 'optional parameter'
Hm, actually you'd need the device as well :) Basically,
static bool s390_gen_initial_iplb(S390IPLState *ipl, CcwDevice *ccw_dev, int devtype) {
(...)
if (!ccw_dev) {
//get ccw_dev, which also gives us the devtype
}
if (ccw_dev) {
//as before; devtype is valid here
(...)
return true;
}
return false;
}So you can call it with s390_gen_initial_iplb(ipl, NULL, 0) if you don't have the values already.
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 44 lines · Cornelia Huck
Quoted 20 lines · On Wed, 6 Mar 2019 09:55:40 -0500 "Jason J. Herne" <[email protected]>…
Quoted 18 lines · Cornelia Huck
hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 562
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:21 -0500 "Jason J. Herne" <[email protected]>…
hw/s390x/ipl.c +1
-1@@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt == S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { -CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 )); +CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 ), &devtype);It feels wrong to have a variable that is not used later... what about either
- makings390_get_ccw_device()capable of handling a NULL second parameter, or
- (what I think would be nicer) passing in the devtype as an optional parameter togen_initial_iplb()so you don't need to do the casting dance twice?Quoted 3 lines
I'm with you on everything suggested for this patch except this last item. I'm not sure what you are suggesting here. I can easily visualize passing NULL for devtype when we want to ignore it but I'm not sure what you mean by 'optional parameter'
Hm, actually you'd need the device as well :) Basically,
static bool
s390_gen_initial_iplb(S390IPLState *ipl, CcwDevice *ccw_dev, int devtype){
(...)if (!ccw_dev) { //get ccw_dev, which also gives us the devtype } if (ccw_dev) { //as before; devtype is valid here (...) return true; } return false; }
Quoted 4 lines
So you can call it with
s390_gen_initial_iplb(ipl, NULL, 0)if you don't have the values already.
Ahh, makes sense now. Thanks for clarifying. I can do it that way, but it does seem a bit redundant to allow s390_gen_initial_iplb to be called either with, or without the device type data. In the case where it is called without, it just has to make the call to s390_get_ccw_device anyway. So, to me, it seems like added lines of code for very little benefit. Why not either always call s390_get_ccw_device from inside s390_gen_initial_iplb, or always require the parameters to be valid?
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 49 lines · On Wed, 6 Mar 2019 11:28:37 -0500 "Jason J. Herne" <[email protected]>…
Quoted 44 lines · Cornelia Huck
Quoted 20 lines · On Wed, 6 Mar 2019 09:55:40 -0500 "Jason J. Herne" <[email protected]>…
Quoted 18 lines · Cornelia Huck
hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 562
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:21 -0500 "Jason J. Herne" <[email protected]>…
hw/s390x/ipl.c +1
-1@@ -532,7 +559,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) !ipl->netboot && ipl->iplb.pbt == S390_IPL_TYPE_CCW && is_virtio_scsi_device(&ipl->iplb)) { -CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 )); +CcwDevice *ccw_dev =s390_get_ccw_device (get_boot_device (0 ), &devtype);It feels wrong to have a variable that is not used later... what about either
- makings390_get_ccw_device()capable of handling a NULL second parameter, or
- (what I think would be nicer) passing in the devtype as an optional parameter togen_initial_iplb()so you don't need to do the casting dance twice?Quoted 3 lines
I'm with you on everything suggested for this patch except this last item. I'm not sure what you are suggesting here. I can easily visualize passing NULL for devtype when we want to ignore it but I'm not sure what you mean by 'optional parameter'
Hm, actually you'd need the device as well :) Basically,
static bool
s390_gen_initial_iplb(S390IPLState *ipl, CcwDevice *ccw_dev, int devtype){
(...)if (!ccw_dev) { //get ccw_dev, which also gives us the devtype } if (ccw_dev) { //as before; devtype is valid here (...) return true; } return false; }Quoted 4 lines
So you can call it with
s390_gen_initial_iplb(ipl, NULL, 0)if you don't have the values already.
Quoted 7 lines
Ahh, makes sense now. Thanks for clarifying. I can do it that way, but it does seem a bit redundant to allow
s390_gen_initial_iplbto be called either with, or without the device type data. In the case where it is called without, it just has to make the call tos390_get_ccw_deviceanyway. So, to me, it seems like added lines of code for very little benefit. Why not either always calls390_get_ccw_devicefrom insides390_gen_initial_iplb, or always require the parameters to be valid?
My main goal was to avoid needing to do the casting twice. If that makes the code too ugly, we can also go back to making s390_get_ccw_device accept a NULL devtype (which I'd find less ugly than needing to pass in an unused variable.)
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
In reply to Jason J. HerneQuoted 109 lines · Jason J. Herne
Add bootindex property and iplb data for vfio-ccw devices. This allows us to forward boot information into the bios for vfio-ccw devices.
Refactor
s390_get_ccw_device()to return device type. This prevents us from having to use messy casting logic in several places.Signed-off-by Jason J. Herne<[email protected]>Acked-by Halil Pasic<[email protected]>--- MAINTAINERS | 1 + hw/s390x/ipl.c | 39 +++++++++++++++++++++++++++++++++------ hw/s390x/s390-ccw.c | 9 +++++++++ hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 ++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 7 deletions(-)create mode 100644
include/hw/s390x/vfio-ccw.hMAINTAINERS +1
-0@@ -1400,6 +1400,7 @@ S: Supported F: hw/vfio/ccw.c F: hw/s390x/s390-ccw.c F: include/hw/s390x/s390-ccw.h +F: include/hw/s390x/vfio-ccw.h T: githttps://github.com/cohuck/qemu.git s390-next L:[email protected]hw/s390x/ipl.c +21
-3@@ -19,6 +19,7 @@#include "hw/loader.h" #include "hw/boards.h" #include "hw/s390x/virtio-ccw.h" +#include "hw/s390x/vfio-ccw.h" #include "hw/s390x/css.h" #include "hw/s390x/ebcdic.h" #include "ipl.h" @@ -305,16 +306,29 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl) *timeout =cpu_to_be32 (splash_time); } -static CcwDevice *s390_get_ccw_device (DeviceState *dev_st) +#define CCW_DEVTYPE_NONE 0x00 +#define CCW_DEVTYPE_VIRTIO 0x01 +#define CCW_DEVTYPE_SCSI 0x02 +#define CCW_DEVTYPE_VFIO 0x03 + +static CcwDevice *s390_get_ccw_device (DeviceState *dev_st,int * devtype) {CcwDevice *ccw_dev =NULL ; + *devtype =CCW_DEVTYPE_NONE ; +if (dev_st) {VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)object_dynamic_cast (OBJECT (qdev_get_parent_bus (dev_st)->parent),TYPE_VIRTIO_CCW_DEVICE ); +VFIOCCWDevice *vfio_ccw_dev = (VFIOCCWDevice *) +object_dynamic_cast (OBJECT (dev_st),TYPE_VFIO_CCW );if (virtio_ccw_dev) { ccw_dev =CCW_DEVICE (virtio_ccw_dev); + *devtype =CCW_DEVTYPE_VIRTIO ; + }else if (vfio_ccw_dev) { + ccw_dev =CCW_DEVICE (vfio_ccw_dev); + *devtype =CCW_DEVTYPE_VFIO ; }else {SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),@@ -327,6 +341,7 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st) ccw_dev = (CcwDevice *)object_dynamic_cast (OBJECT (scsi_ccw),TYPE_CCW_DEVICE ); + *devtype =CCW_DEVTYPE_SCSI ; } } }@@ -337,10 +352,11 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) {DeviceState *dev_st;CcwDevice *ccw_dev =NULL ; +int devtype; dev_st =get_boot_device (0 );if (dev_st) { - ccw_dev =s390_get_ccw_device (dev_st); + ccw_dev =s390_get_ccw_device (dev_st, &devtype); }/* @@ -349,8 +365,10 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (ccw_dev) {SCSIDevice *sd = (SCSIDevice *)object_dynamic_cast (OBJECT (dev_st),TYPE_SCSI_DEVICE ); +VirtIONet *vn; -if (sd) { +switch (devtype) { +case CCW_DEVTYPE_SCSI : ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN ); ipl->iplb.blk0_len =cpu_to_be32 (S390_IPLB_MIN_QEMU_SCSI_LEN -S390_IPLB_HEADER_LEN );@@ -360,8 +378,15 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) ipl->iplb.scsi.channel =cpu_to_be16 (sd->channel); ipl->iplb.scsi.devno =cpu_to_be16 (ccw_dev->sch->devno);
hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 387
Quoted 10 lines
hw/s390x/ipl.c +7
-2ipl->iplb.scsi.ssid = ccw_dev->sch->ssid &3 ; - }else { - VirtIONet *vn = (VirtIONet *) object_dynamic_cast(OBJECT(dev_st), +break ; +case CCW_DEVTYPE_VFIO : + ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN ); + ipl->iplb.pbt =S390_IPL_TYPE_CCW ; + ipl->iplb.ccw.devno =cpu_to_be16 (ccw_dev->sch->devno); + ipl->iplb.ccw.ssid = ccw_dev->sch->ssid &3 ; +break ;
Also for vfio-ccw we are not setting the ipl->iplb.blk0_len like we do for virtio. Is there a reason?
I know we don't reference the value in the bios for both virtio and vfio.
Quoted 11 lines
hw/s390x/ipl.c +3
-0+case CCW_DEVTYPE_VIRTIO : + vn = (VirtIONet *)object_dynamic_cast (OBJECT (dev_st),TYPE_VIRTIO_NET ); ipl->iplb.len =cpu_to_be32 (S390_IPLB_MIN_CCW_LEN );@@ -374,6 +399,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)if (vn) { ipl->netboot = true; } +break ; }
Re: [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data
Quoted 118 lines · Farhan Ali
Quoted 102 lines · Jason J. Herne
Add bootindex property and iplb data for vfio-ccw devices. This allows us to forward boot information into the bios for vfio-ccw devices.
Refactor
s390_get_ccw_device()to return device type. This prevents us from having to use messy casting logic in several places.Signed-off-by Jason J. Herne<[email protected]>Acked-by Halil Pasic<[email protected]>---
MAINTAINERS | 1 +
hw/s390x/ipl.c | 39 +++++++++++++++++++++++++++++++++------ hw/s390x/s390-ccw.c | 9 +++++++++
hw/vfio/ccw.c | 2 +-include/hw/s390x/s390-ccw.h| 1 +include/hw/s390x/vfio-ccw.h| 28 ++++++++++++++++++++++++++++6 files changed, 73 insertions(+), 7 deletions(-)create mode 100644
include/hw/s390x/vfio-ccw.hMAINTAINERS +0
-0@@ -1400,6 +1400,7 @@ S: SupportedF:
hw/vfio/ccw.c
F:hw/s390x/s390-ccw.c
F:include/hw/s390x/s390-ccw.h
+F:include/hw/s390x/vfio-ccw.h
T: githttps://github.com/cohuck/qemu.git s390-next L:[email protected]hw/s390x/ipl.c +21
-3@@ -19,6 +19,7 @@ #include "hw/loader.h" #include "hw/boards.h" #include "hw/s390x/virtio-ccw.h" +#include "hw/s390x/vfio-ccw.h" #include "hw/s390x/css.h" #include "hw/s390x/ebcdic.h" #include "ipl.h"@@ -305,16 +306,29 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl) *timeout = cpu_to_be32(splash_time); } -static CcwDevice *s390_get_ccw_device (DeviceState *dev_st) +#define CCW_DEVTYPE_NONE 0x00 +#define CCW_DEVTYPE_VIRTIO 0x01 +#define CCW_DEVTYPE_SCSI 0x02 +#define CCW_DEVTYPE_VFIO 0x03 + +static CcwDevice*s390_get_ccw_device(DeviceState *dev_st, int* devtype) { CcwDevice *ccw_dev = NULL; + *devtype = CCW_DEVTYPE_NONE; + if (dev_st) { VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *) object_dynamic_cast(OBJECT(qdev_get_parent_bus(dev_st)->parent), TYPE_VIRTIO_CCW_DEVICE); + VFIOCCWDevice *vfio_ccw_dev = (VFIOCCWDevice *) + object_dynamic_cast(OBJECT(dev_st), TYPE_VFIO_CCW); if (virtio_ccw_dev) { ccw_dev = CCW_DEVICE(virtio_ccw_dev); + *devtype = CCW_DEVTYPE_VIRTIO; + } else if (vfio_ccw_dev) { + ccw_dev = CCW_DEVICE(vfio_ccw_dev); + *devtype = CCW_DEVTYPE_VFIO; } else { SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),@@ -327,6 +341,7 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st) ccw_dev = (CcwDevice *)object_dynamic_cast(OBJECT(scsi_ccw), TYPE_CCW_DEVICE); + *devtype = CCW_DEVTYPE_SCSI; } } }@@ -337,10 +352,11 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) { DeviceState *dev_st; CcwDevice *ccw_dev = NULL; + int devtype; dev_st = get_boot_device(0); if (dev_st) { - ccw_dev = s390_get_ccw_device(dev_st); + ccw_dev = s390_get_ccw_device(dev_st, &devtype); } /*@@ -349,8 +365,10 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) if (ccw_dev) { SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st), TYPE_SCSI_DEVICE); + VirtIONet *vn; - if (sd) { + switch (devtype) { + case CCW_DEVTYPE_SCSI: ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN);
ipl->iplb.blk0_len=cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN);hw/s390x/ipl.c +0
-0@@ -360,8 +378,15 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) ipl->iplb.scsi.channel = cpu_to_be16(sd->channel); ipl->iplb.scsi.devno = cpu_to_be16(ccw_dev->sch->devno);hw/s390x/ipl.c static bool s390_gen_initial_iplb(S390IPLState *ipl) · line 387
Quoted 10 lines
hw/s390x/ipl.c +7
-2ipl->iplb.scsi.ssid = ccw_dev->sch->ssid & 3; - } else { - VirtIONet *vn = (VirtIONet *) object_dynamic_cast(OBJECT(dev_st), + break; + case CCW_DEVTYPE_VFIO: + ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); + ipl->iplb.pbt = S390_IPL_TYPE_CCW; + ipl->iplb.ccw.devno = cpu_to_be16(ccw_dev->sch->devno); + ipl->iplb.ccw.ssid = ccw_dev->sch->ssid & 3; + break;Also for vfio-ccw we are not setting the
ipl->iplb.blk0_lenlike we do for virtio. Is there a reason?
Quoted 2 lines
I know we don't reference the value in the bios for both virtio and vfio.
No reason other than I saw no reason to set it. If you know of any reasons please let me know.
Signature · 1 line
-- Jason J. Herne ([email protected])
PATCH v3 2/16 s390-bios: decouple cio setup from virtio
In reply to Jason J. HerneMove channel i/o setup code out to a separate function. This decouples cio setup from the virtio code path and allows us to make use of it for booting dasd devices.
--- pc-bios/s390-ccw/main.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
pc-bios/s390-ccw/main.c +13 -7
@@ -99,6 +99,18 @@ static void menu_setup(void) } } +/* +* Initialize the channel I/O subsystem so we can talk to our ipl/boot device. +*/ +static void css_setup (void ) +{ +/* +* Unconditionally enable mss support. In every sane configuration this +* will succeed; and even if it doesn't, stsch_err() can handle it. +*/ +enable_mss_facility (); +} +static void virtio_setup (void ) {Schib schib;
@@ -109,13 +121,6 @@ static void virtio_setup(void)VDev *vdev =virtio_get_device ();QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS ; -/* -* We unconditionally enable mss support. In every sane configuration, -* this will succeed; and even if it doesn't, stsch_err() can deal -* with the consequences. -*/ -enable_mss_facility (); -sclp_get_loadparm_ascii (loadparm_str);memcpy (ldp +10 , loadparm_str,LOADPARM_LEN );sclp_print (ldp);
@@ -168,6 +173,7 @@ static void virtio_setup(void)int main (void ) {sclp_setup (); +css_setup ();virtio_setup ();zipl_load ();/* no return */
Signature · 1 line
2.7.4
PATCH v3 3/16 s390-bios: decouple common boot logic from virtio
In reply to Jason J. HerneCreate a boot_setup function to handle getting boot information from the machine/hypervisor. This decouples common boot logic from the virtio code path and allows us to make use of it for the real dasd boot scenario.
--- pc-bios/s390-ccw/main.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
pc-bios/s390-ccw/main.c +20 -8
@@ -14,16 +14,17 @@ char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));static SubChannelId blk_schid = { .one =1 }; -IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));static char loadparm_str[LOADPARM_LEN +1 ] = {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 };QemuIplParameters qipl; +IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); +static bool have_iplb;#define LOADPARM_PROMPT "PROMPT "#define LOADPARM_EMPTY " "#define BOOT_MENU_FLAG_MASK (QIPL_FLAG_BM_OPTS_CMD | QIPL_FLAG_BM_OPTS_ZIPL)/* -* Priniciples of Operations (SA22-7832-09) chapter 17 requires that +* Principles of Operations (SA22-7832-09) chapter 17 requires that * a subsystem-identification is at 184-187 and bytes 188-191 are zero * after list-directed-IPL and ccw-IPL. */
@@ -111,23 +112,33 @@ static void css_setup(void)enable_mss_facility (); } +/* +* Collect various pieces of information from the hypervisor/hardware that +* we'll use to determine exactly how we'll boot. +*/ +static void boot_setup (void ) +{ +char lpmsg[] ="LOADPARM=[________]\n" ; + +sclp_get_loadparm_ascii (loadparm_str); +memcpy (lpmsg +10 , loadparm_str,8 ); +sclp_print (lpmsg); + + have_iplb =store_iplb (&iplb); +} +static void virtio_setup (void ) {Schib schib;int ssid;bool found = false;uint16_t dev_no; -char ldp[] ="LOADPARM=[________]\n" ;VDev *vdev =virtio_get_device ();QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS ; -sclp_get_loadparm_ascii (loadparm_str); -memcpy (ldp +10 , loadparm_str,LOADPARM_LEN ); -sclp_print (ldp); -memcpy (&qipl, early_qipl,sizeof (QemuIplParameters)); -if (store_iplb (&iplb)) { +if (have_iplb) {switch (iplb.pbt) {case S390_IPL_TYPE_CCW : dev_no = iplb.ccw.devno;
@@ -174,6 +185,7 @@ int main(void) {sclp_setup ();css_setup (); +boot_setup ();virtio_setup ();zipl_load ();/* no return */
Signature · 1 line
2.7.4
PATCH v3 4/16 s390-bios: Extend find_dev() for non-virtio devices
In reply to Jason J. HerneWe need a method for finding the subchannel of a dasd device. Let's modify find_dev to handle this since it mostly does what we need. Up to this point find_dev has been specific to only virtio devices.
--- pc-bios/s390-ccw/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
pc-bios/s390-ccw/main.c +11 -5
@@ -49,6 +49,12 @@ unsigned int get_loadparm_index(void)return atoui (loadparm_str); } +/* +* Find the subchannel connected to the given device (dev_no) and fill in the +* subchannel information block (schib) with the connected subchannel's info. +* NOTE: The global variable blk_schid is updated to contain the subchannel +* information. +*/ static bool find_dev (Schib *schib,int dev_no) {int i, r;
@@ -62,15 +68,15 @@ static bool find_dev(Schib *schib, int dev_no)if (!schib->pmcw.dnv) {continue ; } -if (!virtio_is_supported (blk_schid)) { -continue ; - } +/* Skip net devices since no IPLB is created and therefore no -* no network bootloader has been loaded +* network bootloader has been loaded */ -if (virtio_get_device_type () ==VIRTIO_ID_NET && dev_no <0 ) { +if (virtio_is_supported (blk_schid) && +virtio_get_device_type () ==VIRTIO_ID_NET && dev_no <0 ) {continue ; } +if ((dev_no <0 ) || (schib->pmcw.dev == dev_no)) {return true; }
Signature · 1 line
2.7.4
PATCH v3 5/16 s390-bios: Factor finding boot device out of virtio code path
In reply to Jason J. HerneMake a new routine find_boot_device to locate the boot device for all cases, not just virtio.
The error message for the case where no boot device has been specified and a suitable boot device cannot be auto detected was specific to virtio devices. We update this message to remove virtio specific wording.
--- pc-bios/s390-ccw/main.c | 85 ++++++++++++++++++++++++++---------------------- tests/boot-serial-test.c | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-)
pc-bios/s390-ccw/main.c +46 -39
@@ -55,17 +55,18 @@ unsigned int get_loadparm_index(void)* NOTE: The global variable blk_schid is updated to contain the subchannel * information. */ -static bool find_dev (Schib *schib,int dev_no) +static bool find_subch (int dev_no) { +Schib schib;int i, r;for (i =0 ; i <0x10000 ; i++) { blk_schid.sch_no = i; - r =stsch_err (blk_schid, schib); + r =stsch_err (blk_schid, &schib);if ((r ==3 ) || (r == -EIO )) {break ; } -if (!schib->pmcw.dnv) { +if (!schib.pmcw.dnv) {continue ; }
@@ -77,7 +78,7 @@ static bool find_dev(Schib *schib, int dev_no)continue ; } -if ((dev_no <0 ) || (schib->pmcw.dev == dev_no)) { +if ((dev_no <0 ) || (schib.pmcw.dev == dev_no)) {return true; } }
@@ -133,56 +134,61 @@ static void boot_setup(void) have_iplb =store_iplb (&iplb); } -static void virtio_setup (void ) +static void find_boot_device (void ) { -Schib schib; -int ssid; -bool found = false; -uint16_t dev_no;VDev *vdev =virtio_get_device (); -QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS ; - -memcpy (&qipl, early_qipl,sizeof (QemuIplParameters)); +int ssid; +bool found; -if (have_iplb) { -switch (iplb.pbt) { -case S390_IPL_TYPE_CCW : - dev_no = iplb.ccw.devno; -debug_print_int ("device no. " , dev_no); - blk_schid.ssid = iplb.ccw.ssid &0x3 ; -debug_print_int ("ssid " , blk_schid.ssid); - found =find_dev (&schib, dev_no); -break ; -case S390_IPL_TYPE_QEMU_SCSI : - vdev->scsi_device_selected = true; - vdev->selected_scsi_device.channel = iplb.scsi.channel; - vdev->selected_scsi_device.target = iplb.scsi.target; - vdev->selected_scsi_device.lun = iplb.scsi.lun; - blk_schid.ssid = iplb.scsi.ssid &0x3 ; - found =find_dev (&schib, iplb.scsi.devno); -break ; -default : -panic ("List-directed IPL not supported yet!\n" ); - } -menu_setup (); - }else { +if (!have_iplb) {for (ssid =0 ; ssid <0x3 ; ssid++) { blk_schid.ssid = ssid; - found =find_dev (&schib,-1 ); + found =find_subch (-1 );if (found) { -break ; +return ; } } +panic ("Could not find a suitable boot device (none specified)\n" ); + } + +switch (iplb.pbt) { +case S390_IPL_TYPE_CCW : +debug_print_int ("device no. " , iplb.ccw.devno); + blk_schid.ssid = iplb.ccw.ssid &0x3 ; +debug_print_int ("ssid " , blk_schid.ssid); + found =find_subch (iplb.ccw.devno); +break ; +case S390_IPL_TYPE_QEMU_SCSI : + vdev->scsi_device_selected = true; + vdev->selected_scsi_device.channel = iplb.scsi.channel; + vdev->selected_scsi_device.target = iplb.scsi.target; + vdev->selected_scsi_device.lun = iplb.scsi.lun; + blk_schid.ssid = iplb.scsi.ssid &0x3 ; + found =find_subch (iplb.scsi.devno); +break ; +default : +panic ("List-directed IPL not supported yet!\n" ); } -IPL_assert (found,"No virtio device found" ); +IPL_assert (found,"Boot device not found\n" ); +} + +static void virtio_setup (void ) +{ +VDev *vdev =virtio_get_device (); +QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS ; + +memcpy (&qipl, early_qipl,sizeof (QemuIplParameters)); + +if (have_iplb) { +menu_setup (); + }if (virtio_get_device_type () ==VIRTIO_ID_NET ) {sclp_print ("Network boot device detected\n" ); vdev->netboot_start_addr = qipl.netboot_start_addr; }else {virtio_blk_setup_device (blk_schid); -IPL_assert (virtio_ipl_disk_is_valid (),"No valid IPL device detected" ); } }
@@ -192,8 +198,9 @@ int main(void)sclp_setup ();css_setup ();boot_setup (); -virtio_setup (); +find_boot_device (); +virtio_setup ();zipl_load ();/* no return */ panic ("Failed to load OS from hard disk\n" );
tests/boot-serial-test.c +1 -1
@@ -112,7 +112,7 @@ static testdef_t tests[] = { { "sparc", "SS-4", "", "MB86904" }, { "sparc", "SS-600MP", "", "TMS390Z55" }, { "sparc64", "sun4u", "", "UltraSPARC" }, - { "s390x", "s390-ccw-virtio", "", "virtio device" }, + { "s390x", "s390-ccw-virtio", "", "device" }, { "m68k", "mcf5208evb", "", "TT", sizeof(kernel_mcf5208), kernel_mcf5208 }, { "microblaze", "petalogix-s3adsp1800", "", "TT", sizeof(kernel_pls3adsp1800), kernel_pls3adsp1800 },
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 05/16] s390-bios: Factor finding boot device out of virtio code path
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:25 -0500 "Jason J. Herne" <[email protected]>…
Make a new routine
find_boot_deviceto locate the boot device for all cases, not just virtio.The error message for the case where no boot device has been specified and a suitable boot device cannot be auto detected was specific to virtio devices. We update this message to remove virtio specific wording.
...and, consequently, need to tweak the serial output boot test.
Quoted 8 lines
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/main.c | 85 ++++++++++++++++++++++++++---------------------- tests/boot-serial-test.c | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-)
(...)
pc-bios/s390-ccw/main.c static void boot_setup(void) · line 173
Quoted 2 lines
pc-bios/s390-ccw/main.c +1
-1-IPL_assert (found,"No virtio device found" ); +IPL_assert (found,"Boot device not found\n" );
You change the output in the bios here...
(...)
tests/boot-serial-test.c static testdef_t tests[] = { · line 115
Quoted 10 lines
tests/boot-serial-test.c +1
-1@@ -112,7 +112,7 @@ static testdef_t tests[] = { { "sparc", "SS-4", "", "MB86904" }, { "sparc", "SS-600MP", "", "TMS390Z55" }, { "sparc64", "sun4u", "", "UltraSPARC" }, - { "s390x", "s390-ccw-virtio", "", "virtio device" }, + { "s390x", "s390-ccw-virtio", "", "device" },
...and therefore need to change the expected string here. Question: is that ok ("device" looks a bit generic), or would "Boot device" be a better match?
tests/boot-serial-test.c static testdef_t tests[] = { · line 118
Quoted 3 lines
tests/boot-serial-test.c +0
-0{ "m68k", "mcf5208evb", "", "TT", sizeof(kernel_mcf5208), kernel_mcf5208 }, { "microblaze", "petalogix-s3adsp1800", "", "TT", sizeof(kernel_pls3adsp1800), kernel_pls3adsp1800 },
Otherwise, looks good.
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 05/16] s390-bios: Factor finding boot device out of virtio code path
Quoted 27 lines · Cornelia Huck
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:25 -0500 "Jason J. Herne" <[email protected]>…
Make a new routine
find_boot_deviceto locate the boot device for all cases, not just virtio.The error message for the case where no boot device has been specified and a suitable boot device cannot be auto detected was specific to virtio devices. We update this message to remove virtio specific wording.
...and, consequently, need to tweak the serial output boot test.
Quoted 8 lines
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/main.c | 85 ++++++++++++++++++++++++++---------------------- tests/boot-serial-test.c | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-)(...)
pc-bios/s390-ccw/main.c static void boot_setup(void) · line 173
Quoted 2 lines
pc-bios/s390-ccw/main.c +1
-1-IPL_assert (found,"No virtio device found" ); +IPL_assert (found,"Boot device not found\n" );You change the output in the bios here...
(...)
Quoted 14 lines
tests/boot-serial-test.c static testdef_t tests[] = { · line 115
Quoted 10 lines
tests/boot-serial-test.c +1
-1@@ -112,7 +112,7 @@ static testdef_t tests[] = { { "sparc", "SS-4", "", "MB86904" }, { "sparc", "SS-600MP", "", "TMS390Z55" }, { "sparc64", "sun4u", "", "UltraSPARC" }, - { "s390x", "s390-ccw-virtio", "", "virtio device" }, + { "s390x", "s390-ccw-virtio", "", "device" },...and therefore need to change the expected string here. Question: is that ok ("device" looks a bit generic), or would "Boot device" be a better match?
Just "device" should be OK. The exact string in the boot-serial-test does not matter too much, as long as it comes from the same print statement.
Thomas
Cornelia Huck
Reviewed-byRe: [Qemu-devel] [qemu-s390x] [PATCH v3 05/16] s390-bios: Factor finding boot device out of virtio code path
Quoted 43 lines · On Mon, 4 Mar 2019 20:26:17 +0100 Thomas Huth <[email protected]> wrote:
Quoted 27 lines · Cornelia Huck
Quoted 6 lines · On Fri, 1 Mar 2019 13:59:25 -0500 "Jason J. Herne" <[email protected]>…
Make a new routine
find_boot_deviceto locate the boot device for all cases, not just virtio.The error message for the case where no boot device has been specified and a suitable boot device cannot be auto detected was specific to virtio devices. We update this message to remove virtio specific wording.
...and, consequently, need to tweak the serial output boot test.
Quoted 8 lines
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/main.c | 85 ++++++++++++++++++++++++++---------------------- tests/boot-serial-test.c | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-)(...)
pc-bios/s390-ccw/main.c static void boot_setup(void) · line 173
Quoted 2 lines
pc-bios/s390-ccw/main.c +1
-1-IPL_assert (found,"No virtio device found" ); +IPL_assert (found,"Boot device not found\n" );You change the output in the bios here...
(...)
Quoted 14 lines
tests/boot-serial-test.c static testdef_t tests[] = { · line 115
Quoted 10 lines
tests/boot-serial-test.c +1
-1@@ -112,7 +112,7 @@ static testdef_t tests[] = { { "sparc", "SS-4", "", "MB86904" }, { "sparc", "SS-600MP", "", "TMS390Z55" }, { "sparc64", "sun4u", "", "UltraSPARC" }, - { "s390x", "s390-ccw-virtio", "", "virtio device" }, + { "s390x", "s390-ccw-virtio", "", "device" },...and therefore need to change the expected string here. Question: is that ok ("device" looks a bit generic), or would "Boot device" be a better match?
Quoted 2 lines
Just "device" should be OK. The exact string in the boot-serial-test does not matter too much, as long as it comes from the same print statement.
Ok, makes sense.
PATCH v3 6/16 s390-bios: Clean up cio.h
In reply to Jason J. HerneAdd proper typedefs to all structs and modify all bit fields to use consistent formatting.
--- pc-bios/s390-ccw/cio.h | 152 ++++++++++++++++++++++---------------------- pc-bios/s390-ccw/s390-ccw.h | 8 --- 2 files changed, 76 insertions(+), 84 deletions(-)
pc-bios/s390-ccw/cio.h +76 -76
@@ -17,35 +17,35 @@* path management control word */ struct pmcw { -__u32 intparm;/* interruption parameter */ -__u32 qf :1 ;/* qdio facility */ -__u32 w :1 ; -__u32 isc :3 ;/* interruption sublass */ -__u32 res5 :3 ;/* reserved zeros */ -__u32 ena :1 ;/* enabled */ -__u32 lm :2 ;/* limit mode */ -__u32 mme :2 ;/* measurement-mode enable */ -__u32 mp :1 ;/* multipath mode */ -__u32 tf :1 ;/* timing facility */ -__u32 dnv :1 ;/* device number valid */ -__u32 dev :16 ;/* device number */ -__u8 lpm;/* logical path mask */ -__u8 pnom;/* path not operational mask */ -__u8 lpum;/* last path used mask */ -__u8 pim;/* path installed mask */ -__u16 mbi;/* measurement-block index */ -__u8 pom;/* path operational mask */ -__u8 pam;/* path available mask */ -__u8 chpid[8 ];/* CHPID 0-7 (if available) */ -__u32 unused1 :8 ;/* reserved zeros */ -__u32 st :3 ;/* subchannel type */ -__u32 unused2 :18 ;/* reserved zeros */ -__u32 mbfc :1 ;/* measurement block format control */ -__u32 xmwme :1 ;/* extended measurement word mode enable */ -__u32 csense :1 ;/* concurrent sense; can be enabled ...*/ -/* ... per MSCH, however, if facility */ -/* ... is not installed, this results */ -/* ... in an operand exception. */ +__u32 intparm;/* interruption parameter */ +__u32 qf:1 ;/* qdio facility */ +__u32 w:1 ; +__u32 isc:3 ;/* interruption sublass */ +__u32 res5:3 ;/* reserved zeros */ +__u32 ena:1 ;/* enabled */ +__u32 lm:2 ;/* limit mode */ +__u32 mme:2 ;/* measurement-mode enable */ +__u32 mp:1 ;/* multipath mode */ +__u32 tf:1 ;/* timing facility */ +__u32 dnv:1 ;/* device number valid */ +__u32 dev:16 ;/* device number */ +__u8 lpm;/* logical path mask */ +__u8 pnom;/* path not operational mask */ +__u8 lpum;/* last path used mask */ +__u8 pim;/* path installed mask */ +__u16 mbi;/* measurement-block index */ +__u8 pom;/* path operational mask */ +__u8 pam;/* path available mask */ +__u8 chpid[8 ];/* CHPID 0-7 (if available) */ +__u32 unused1:8 ;/* reserved zeros */ +__u32 st:3 ;/* subchannel type */ +__u32 unused2:18 ;/* reserved zeros */ +__u32 mbfc:1 ;/* measurement block format control */ +__u32 xmwme:1 ;/* extended measurement word mode enable */ +__u32 csense:1 ;/* concurrent sense; can be enabled ...*/ +/* ... per MSCH, however, if facility */ +/* ... is not installed, this results */ +/* ... in an operand exception. */ } __attribute__ ((packed));/* Target SCHIB configuration. */
@@ -77,28 +77,28 @@ struct scsw {/* * subchannel information block */ -struct schib { +typedef struct schib {struct pmcw pmcw;/* path management control word */ struct scsw scsw;/* subchannel status word */ __u64 mba;/* measurement block address */ __u8 mda[4 ];/* model dependent area */ -} __attribute__ ((packed,aligned (4 ))); - -struct subchannel_id { -__u32 cssid :8 ; - __u32 : 4; -__u32 m :1 ; -__u32 ssid :2 ; -__u32 one :1 ; -__u32 sch_no :16 ; -} __attribute__ ((packed,aligned (4 ))); +} __attribute__ ((packed,aligned (4 )))Schib ; + +typedef struct subchannel_id { +__u32 cssid:8 ; + __u32:4; +__u32 m:1 ; +__u32 ssid:2 ; +__u32 one:1 ; +__u32 sch_no:16 ; +} __attribute__ ((packed,aligned (4 )))SubChannelId ;struct chsc_header {__u16 length;__u16 code; } __attribute__((packed)); -struct chsc_area_sda { +typedef struct chsc_area_sda { struct chsc_header request; __u8 reserved1:4; __u8 format:4;
@@ -111,29 +111,29 @@ struct chsc_area_sda { __u32 reserved5:4; __u32 format2:4; __u32 reserved6:24; -} __attribute__((packed)); +} __attribute__((packed)) ChscAreaSda;/* * TPI info structure */ struct tpi_info {struct subchannel_id schid; -__u32 intparm;/* interruption parameter */ -__u32 adapter_IO :1 ; -__u32 reserved2 :1 ; -__u32 isc :3 ; -__u32 reserved3 :12 ; -__u32 int_type :3 ; -__u32 reserved4 :12 ; +__u32 intparm;/* interruption parameter */ +__u32 adapter_IO:1 ; +__u32 reserved2:1 ; +__u32 isc:3 ; +__u32 reserved3:12 ; +__u32 int_type:3 ; +__u32 reserved4:12 ; } __attribute__ ((packed,aligned (4 )));/* channel command word (type 1) */ -struct ccw1 { +typedef struct ccw1 {__u8 cmd_code;__u8 flags;__u16 count;__u32 cda; -} __attribute__ ((packed,aligned (8 ))); +} __attribute__ ((packed,aligned (8 )))Ccw1 ;#define CCW_FLAG_DC 0x80#define CCW_FLAG_CC 0x40
@@ -162,27 +162,27 @@ struct ccw1 {/* * Command-mode operation request block */ -struct cmd_orb { -__u32 intparm;/* interruption parameter */ -__u32 key:4 ;/* flags, like key, suspend control, etc. */ -__u32 spnd:1 ;/* suspend control */ -__u32 res1:1 ;/* reserved */ -__u32 mod:1 ;/* modification control */ -__u32 sync:1 ;/* synchronize control */ -__u32 fmt:1 ;/* format control */ -__u32 pfch:1 ;/* prefetch control */ -__u32 isic:1 ;/* initial-status-interruption control */ -__u32 alcc:1 ;/* address-limit-checking control */ -__u32 ssic:1 ;/* suppress-suspended-interr. control */ -__u32 res2:1 ;/* reserved */ -__u32 c64:1 ;/* IDAW/QDIO 64 bit control */ -__u32 i2k:1 ;/* IDAW 2/4kB block size control */ -__u32 lpm:8 ;/* logical path mask */ -__u32 ils:1 ;/* incorrect length */ -__u32 zero:6 ;/* reserved zeros */ -__u32 orbx:1 ;/* ORB extension control */ -__u32 cpa;/* channel program address */ -} __attribute__ ((packed,aligned (4 ))); +typedef struct cmd_orb { +__u32 intparm;/* interruption parameter */ +__u32 key:4 ;/* flags, like key, suspend control, etc. */ +__u32 spnd:1 ;/* suspend control */ +__u32 res1:1 ;/* reserved */ +__u32 mod:1 ;/* modification control */ +__u32 sync:1 ;/* synchronize control */ +__u32 fmt:1 ;/* format control */ +__u32 pfch:1 ;/* prefetch control */ +__u32 isic:1 ;/* initial-status-interruption control */ +__u32 alcc:1 ;/* address-limit-checking control */ +__u32 ssic:1 ;/* suppress-suspended-interr. control */ +__u32 res2:1 ;/* reserved */ +__u32 c64:1 ;/* IDAW/QDIO 64 bit control */ +__u32 i2k:1 ;/* IDAW 2/4kB block size control */ +__u32 lpm:8 ;/* logical path mask */ +__u32 ils:1 ;/* incorrect length */ +__u32 zero:6 ;/* reserved zeros */ +__u32 orbx:1 ;/* ORB extension control */ +__u32 cpa;/* channel program address */ +} __attribute__ ((packed,aligned (4 )))CmdOrb ;struct ciw {__u8 type;
@@ -193,7 +193,7 @@ struct ciw {/* * sense-id response buffer layout */ -struct senseid { +typedef struct senseid { /* common part */ __u8 reserved; /* always 0x'FF' */ __u16 cu_type; /* control unit type */
@@ -203,15 +203,15 @@ struct senseid {__u8 unused;/* padding byte */ /* extended part */ struct ciw ciw[62 ]; -} __attribute__ ((packed, aligned(4))); +} __attribute__ ((packed, aligned(4))) SenseId;/* interruption response block */ -struct irb { +typedef struct irb {struct scsw scsw;__u32 esw[5 ];__u32 ecw[8 ];__u32 emw[8 ]; -} __attribute__ ((packed,aligned (4 ))); +} __attribute__ ((packed,aligned (4 )))Irb ;/* * Some S390 specific IO instructions as inline
pc-bios/s390-ccw/s390-ccw.h +0 -8
@@ -49,14 +49,6 @@ typedef unsigned long long __u64;#include "cio.h" #include "iplb.h" -typedef struct irb Irb ; -typedef struct ccw1 Ccw1 ; -typedef struct cmd_orb CmdOrb ; -typedef struct schib Schib ; -typedef struct chsc_area_sda ChscAreaSda ; -typedef struct senseid SenseId ; -typedef struct subchannel_id SubChannelId ; -/* start.s */ void disabled_wait (void );void consume_sclp_int (void );
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 06/16] s390-bios: Clean up cio.h
Quoted 10 lines · On Fri, 1 Mar 2019 13:59:26 -0500 "Jason J. Herne" <[email protected]>…
Add proper typedefs to all structs and modify all bit fields to use consistent formatting.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Collin Walling <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/cio.h | 152 ++++++++++++++++++++++---------------------- pc-bios/s390-ccw/s390-ccw.h | 8 --- 2 files changed, 76 insertions(+), 84 deletions(-)
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 06/16] s390-bios: Clean up cio.h
In reply to Jason J. HerneQuoted 15 lines · Jason J. Herne
Add proper typedefs to all structs and modify all bit fields to use consistent formatting.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Collin Walling <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/cio.h | 152 ++++++++++++++++++++++---------------------- pc-bios/s390-ccw/s390-ccw.h | 8 --- 2 files changed, 76 insertions(+), 84 deletions(-)pc-bios/s390-ccw/cio.h +0
-0
[...]
pc-bios/s390-ccw/cio.h struct scsw { · line 89
Quoted 13 lines
pc-bios/s390-ccw/cio.h +5
-8-struct subchannel_id { -__u32 cssid :8 ; - __u32 : 4; -__u32 m :1 ; -__u32 ssid :2 ; -__u32 one :1 ; -__u32 sch_no :16 ; -} __attribute__ ((packed,aligned (4 ))); +} __attribute__ ((packed, aligned(4))) Schib; + +typedef struct subchannel_id { + __u32 cssid:8; + __u32:4;
__u32:4 looks a little bit funny. Not sure, but maybe this should be given a name like "reserved" or so?
Quoted 10 lines
pc-bios/s390-ccw/cio.h +5
-0+ __u32 m:1; + __u32 ssid:2; + __u32 one:1; + __u32 sch_no:16; +} __attribute__ ((packed, aligned(4))) SubChannelId;struct chsc_header {__u16 length;__u16 code; } __attribute__((packed));
[...]
Quoted 36 lines
pc-bios/s390-ccw/cio.h +11
-21@@ -162,27 +162,27 @@ struct ccw1 {/* * Command-mode operation request block */ -struct cmd_orb { -__u32 intparm;/* interruption parameter */ -__u32 key:4 ;/* flags, like key, suspend control, etc. */ -__u32 spnd:1 ;/* suspend control */ -__u32 res1:1 ;/* reserved */ -__u32 mod:1 ;/* modification control */ -__u32 sync:1 ;/* synchronize control */ -__u32 fmt:1 ;/* format control */ -__u32 pfch:1 ;/* prefetch control */ -__u32 isic:1 ;/* initial-status-interruption control */ -__u32 alcc:1 ;/* address-limit-checking control */ -__u32 ssic:1 ;/* suppress-suspended-interr. control */ -__u32 res2:1 ;/* reserved */ -__u32 c64:1 ;/* IDAW/QDIO 64 bit control */ -__u32 i2k:1 ;/* IDAW 2/4kB block size control */ -__u32 lpm:8 ;/* logical path mask */ -__u32 ils:1 ;/* incorrect length */ -__u32 zero:6 ;/* reserved zeros */ -__u32 orbx:1 ;/* ORB extension control */ -__u32 cpa;/* channel program address */ -} __attribute__ ((packed,aligned (4 ))); +typedef struct cmd_orb { + __u32 intparm; /* interruption parameter */ + __u32 key:4; /* flags, like key, suspend control, etc. */ + __u32 spnd:1; /* suspend control */ + __u32 res1:1; /* reserved */ + __u32 mod:1; /* modification control */ + __u32 sync:1; /* synchronize control */ + __u32 fmt:1; /* format control */ + __u32 pfch:1; /* prefetch control */ + __u32 isic:1; /* initial-status-interruption control */ + __u32 alcc:1; /* address-limit-checking control */
pc-bios/s390-ccw/cio.h struct ccw1 { · line 185
Quoted 10 lines
pc-bios/s390-ccw/cio.h +10
-0+ __u32 ssic:1; /* suppress-suspended-interr. control */ + __u32 res2:1; /* reserved */ + __u32 c64:1; /* IDAW/QDIO 64 bit control */ + __u32 i2k:1; /* IDAW 2/4kB block size control */ + __u32 lpm:8; /* logical path mask */ + __u32 ils:1; /* incorrect length */ + __u32 zero:6; /* reserved zeros */ + __u32 orbx:1; /* ORB extension control */ +__u32 cpa;/* channel program address */ +} __attribute__ ((packed, aligned(4))) CmdOrb;
The white space changes to this struct look like unnecessary code churn to me ... I'd like to suggest to keep the comments at the old indentation level.
With that fixed:
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 06/16] s390-bios: Clean up cio.h
Quoted 17 lines · Thomas Huth
Quoted 15 lines · Jason J. Herne
Add proper typedefs to all structs and modify all bit fields to use consistent formatting.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Collin Walling <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/cio.h | 152 ++++++++++++++++++++++---------------------- pc-bios/s390-ccw/s390-ccw.h | 8 --- 2 files changed, 76 insertions(+), 84 deletions(-)pc-bios/s390-ccw/cio.h +0
-0[...]
Quoted 17 lines
pc-bios/s390-ccw/cio.h struct scsw { · line 89
Quoted 13 lines
pc-bios/s390-ccw/cio.h +5
-8-struct subchannel_id { -__u32 cssid :8 ; - __u32 : 4; -__u32 m :1 ; -__u32 ssid :2 ; -__u32 one :1 ; -__u32 sch_no :16 ; -} __attribute__ ((packed,aligned (4 ))); +} __attribute__ ((packed, aligned(4))) Schib; + +typedef struct subchannel_id { + __u32 cssid:8; + __u32:4;__u32:4 looks a little bit funny. Not sure, but maybe this should be given a name like "reserved" or so?
Perhaps, but this is not my code. I was just cleaning up the style. If you feel strongly that this patch is the place to give this a name, I can do that.
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 06/16] s390-bios: Clean up cio.h
Quoted 36 lines · On Wed, 6 Mar 2019 13:42:17 -0500 "Jason J. Herne" <[email protected]>…
Quoted 17 lines · Thomas Huth
Quoted 15 lines · Jason J. Herne
Add proper typedefs to all structs and modify all bit fields to use consistent formatting.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Collin Walling <[email protected]>Reviewed-by Farhan Ali <[email protected]>--- pc-bios/s390-ccw/cio.h | 152 ++++++++++++++++++++++---------------------- pc-bios/s390-ccw/s390-ccw.h | 8 --- 2 files changed, 76 insertions(+), 84 deletions(-)pc-bios/s390-ccw/cio.h +0
-0[...]
Quoted 17 lines
pc-bios/s390-ccw/cio.h struct scsw { · line 89
Quoted 13 lines
pc-bios/s390-ccw/cio.h +5
-8-struct subchannel_id { -__u32 cssid :8 ; - __u32 : 4; -__u32 m :1 ; -__u32 ssid :2 ; -__u32 one :1 ; -__u32 sch_no :16 ; -} __attribute__ ((packed,aligned (4 ))); +} __attribute__ ((packed, aligned(4))) Schib; + +typedef struct subchannel_id { + __u32 cssid:8; + __u32:4;__u32:4 looks a little bit funny. Not sure, but maybe this should be given a name like "reserved" or so?
Quoted 2 lines
Perhaps, but this is not my code. I was just cleaning up the style. If you feel strongly that this patch is the place to give this a name, I can do that.
FWIW, my personal preference for this is keeping it unnamed.
PATCH v3 7/16 s390-bios: Decouple channel i/o logic from virtio
In reply to Jason J. HerneCreate a separate library for channel i/o related code. This decouples channel i/o operations from virtio and allows us to make use of them for the real dasd boot path.
--- pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/cio.c | 43 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 3 +++ pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/netboot.mak | 2 +- pc-bios/s390-ccw/netmain.c | 1 + pc-bios/s390-ccw/s390-ccw.h | 1 - pc-bios/s390-ccw/virtio.c | 27 ++------------------------- 8 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 pc-bios/s390-ccw/cio.c
pc-bios/s390-ccw/Makefile +1 -1
@@ -10,7 +10,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) .PHONY : all clean build-all OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o libc.o + virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
pc-bios/s390-ccw/cio.c new file +43 -0
43 lines not on this page · raw message
pc-bios/s390-ccw/cio.h +3 -0
@@ -213,6 +213,9 @@ typedef struct irb {__u32 emw[8 ]; } __attribute__ ((packed, aligned(4))) Irb; +int enable_mss_facility (void ); +void enable_subchannel (SubChannelId schid); +/* * Some S390 specific IO instructions as inline */
pc-bios/s390-ccw/main.c +1 -0
@@ -10,6 +10,7 @@#include "libc.h" #include "s390-ccw.h" +#include "cio.h" #include "virtio.h" char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
pc-bios/s390-ccw/netboot.mak +1 -1
@@ -1,7 +1,7 @@ SLOF_DIR := $(SRC_PATH)/roms/SLOF -NETOBJS := start.o sclp.o virtio.o virtio-net.o jump2ipl.o netmain.o \ +NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o \ libnet.a libc.a LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
pc-bios/s390-ccw/netmain.c +1 -0
@@ -33,6 +33,7 @@#include <pxelinux.h> #include "s390-ccw.h" +#include "cio.h" #include "virtio.h" #define DEFAULT_BOOT_RETRIES 10
pc-bios/s390-ccw/s390-ccw.h +0 -1
@@ -72,7 +72,6 @@ unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2,bool virtio_is_supported (SubChannelId schid);void virtio_blk_setup_device (SubChannelId schid);int virtio_read (ulong sector,void *load_addr); -int enable_mss_facility (void );u64 get_clock (void );ulong get_second (void );
pc-bios/s390-ccw/virtio.c +2 -25
@@ -10,6 +10,7 @@#include "libc.h" #include "s390-ccw.h" +#include "cio.h" #include "virtio.h" #include "virtio-scsi.h" #include "bswap.h"
@@ -20,8 +21,6 @@ static VRing block[VIRTIO_MAX_VQS]; static char ring_area[VIRTIO_RING_SIZE * VIRTIO_MAX_VQS] __attribute__((__aligned__(PAGE_SIZE))); -static char chsc_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); -static VDev vdev = { .nr_vqs =1 , .vrings = block,
@@ -94,14 +93,9 @@ static int run_ccw(VDev *vdev, int cmd, void *ptr, int len) {Ccw1 ccw = {};CmdOrb orb = {}; -Schib schib;int r; -/* start command processing */ -stsch_err (vdev->schid, &schib); -/* enable the subchannel for IPL device */ - schib.pmcw.ena =1 ; -msch (vdev->schid, &schib); +enable_subchannel (vdev->schid);/* start subchannel command */ orb.fmt =1 ;
@@ -343,20 +337,3 @@ bool virtio_is_supported(SubChannelId schid) }return false; } - -int enable_mss_facility (void ) -{ -int ret; -ChscAreaSda *sda_area = (ChscAreaSda *) chsc_page; - -memset (sda_area,0 ,PAGE_SIZE ); - sda_area->request.length =0x0400 ; - sda_area->request.code =0x0031 ; - sda_area->operation_code =0x2 ; - - ret =chsc (sda_area); -if ((ret ==0 ) && (sda_area->response.code ==0x0001 )) { -return 0 ; - } -return -EIO ; -}
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 07/16] s390-bios: Decouple channel i/o logic from virtio
Quoted 16 lines · On Fri, 1 Mar 2019 13:59:27 -0500 "Jason J. Herne" <[email protected]>…
Create a separate library for channel i/o related code. This decouples channel i/o operations from virtio and allows us to make use of them for the real dasd boot path.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/cio.c | 43 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 3 +++ pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/netboot.mak | 2 +- pc-bios/s390-ccw/netmain.c | 1 + pc-bios/s390-ccw/s390-ccw.h | 1 - pc-bios/s390-ccw/virtio.c | 27 ++------------------------- 8 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 pc-bios/s390-ccw/cio.c
(...)
pc-bios/s390-ccw/cio.c line 4
Quoted 10 lines
pc-bios/s390-ccw/cio.c new file +4
-0@@ -0,0 +1,43 @@ +/* +* S390 Channel I/O +* +* Copyright 2017 Alexander Graf & IBM Corp.
This looks a bit odd. Should probably be two copyright lines (one for agraf, one for IBM) and one author line for you? (Especially as virtio.c has a 2013 copyright, not 2017.)
Quoted 29 lines
pc-bios/s390-ccw/cio.c new file +29
-0+* Author(s): Alexander Graf <[email protected]> +* Jason J. Herne <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#include "libc.h" +#include "s390-ccw.h" +#include "cio.h" + +static char chsc_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); + +int enable_mss_facility (void ) +{ +int ret; +ChscAreaSda *sda_area = (ChscAreaSda *) chsc_page; + +memset (sda_area,0 ,PAGE_SIZE ); + sda_area->request.length =0x0400 ; + sda_area->request.code =0x0031 ; + sda_area->operation_code =0x2 ; + + ret =chsc (sda_area); +if ((ret ==0 ) && (sda_area->response.code ==0x0001 )) { +return 0 ; + } +return -EIO ;
pc-bios/s390-ccw/cio.c line 43
Quoted 10 lines
pc-bios/s390-ccw/cio.c new file +10
-0+} + +void enable_subchannel (SubChannelId schid) +{ +Schib schib; + +stsch_err (schid, &schib); + schib.pmcw.ena =1 ; +msch (schid, &schib); +}
The code movement looks reasonable.
PATCH v3 8/16 s390-bios: Map low core memory
In reply to Jason J. HerneCreate a new header for basic architecture specific definitions and add a mapping of low core memory. This mapping will be used by the real dasd boot process.
--- pc-bios/s390-ccw/main.c | 2 + pc-bios/s390-ccw/s390-arch.h | 102 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 pc-bios/s390-ccw/s390-arch.h
pc-bios/s390-ccw/main.c +2 -0
@@ -9,6 +9,7 @@*/ #include "libc.h" +#include "s390-arch.h" #include "s390-ccw.h" #include "cio.h" #include "virtio.h"
@@ -19,6 +20,7 @@ static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));static bool have_iplb; +const LowCore *lowcore;/* Yes, this *is* a pointer to address 0 */ #define LOADPARM_PROMPT "PROMPT "#define LOADPARM_EMPTY " "
pc-bios/s390-ccw/s390-arch.h new file +102 -0
102 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 08/16] s390-bios: Map low core memory
Quoted 10 lines · On Fri, 1 Mar 2019 13:59:28 -0500 "Jason J. Herne" <[email protected]>…
Create a new header for basic architecture specific definitions and add a mapping of low core memory. This mapping will be used by the real dasd boot process.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/main.c | 2 + pc-bios/s390-ccw/s390-arch.h | 102 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 pc-bios/s390-ccw/s390-arch.h
I did not check all fields, but looks sane.
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 08/16] s390-bios: Map low core memory
In reply to Jason J. HerneQuoted 24 lines · Jason J. Herne
Create a new header for basic architecture specific definitions and add a mapping of low core memory. This mapping will be used by the real dasd boot process.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/main.c | 2 + pc-bios/s390-ccw/s390-arch.h | 102 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 pc-bios/s390-ccw/s390-arch.hpc-bios/s390-ccw/main.c +1
-0@@ -9,6 +9,7 @@*/ #include "libc.h" +#include "s390-arch.h" #include "s390-ccw.h" #include "cio.h" #include "virtio.h"
pc-bios/s390-ccw/main.c static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; · line 23
Quoted 4 lines
pc-bios/s390-ccw/main.c +1
-0@@ -19,6 +20,7 @@ static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));static bool have_iplb; +const LowCore *lowcore;/* Yes, this *is* a pointer to address 0 */
Shouldn't that rather be "LowCore const *lowcore" instead?
Quoted 35 lines
pc-bios/s390-ccw/main.c +0
-0#define LOADPARM_PROMPT "PROMPT "#define LOADPARM_EMPTY " "pc-bios/s390-ccw/s390-arch.h new file +27
-0@@ -0,0 +1,102 @@ +/* +* S390 Basic Architecture +* +* Copyright (c) 2019 Jason J. Herne <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#ifndef S390_ARCH_H +#define S390_ARCH_H + +typedef struct PSW { +uint64_t mask; +uint64_t addr; +} __attribute__ ((aligned (8 )))PSW ; +_Static_assert (sizeof (struct PSW ) ==16 ,"PSW size incorrect" ); + +/* Older PSW format used by LPSW instruction */ +typedef struct PSWLegacy { +uint32_t mask; +uint32_t addr; +} __attribute__ ((aligned (8 )))PSWLegacy ; +_Static_assert (sizeof (struct PSWLegacy ) ==8 ,"PSWLegacy size incorrect" ); + +/* s390 psw bit masks */
pc-bios/s390-ccw/s390-arch.h line 37
Quoted 10 lines
pc-bios/s390-ccw/s390-arch.h new file +10
-0+#define PSW_MASK_IOINT 0x0200000000000000ULL +#define PSW_MASK_WAIT 0x0002000000000000ULL +#define PSW_MASK_EAMODE 0x0000000100000000ULL +#define PSW_MASK_BAMODE 0x0000000080000000ULL +#define PSW_MASK_ZMODE (PSW_MASK_EAMODE | PSW_MASK_BAMODE) + +/* Low core mapping */ +typedef struct LowCore { + /* prefix area: defined by architecture */ + PSWLegacy ipl_psw; /* 0x000 */
Maybe remove some white space between the variable type and name everywhere in this struct?
Quoted 38 lines
pc-bios/s390-ccw/s390-arch.h new file +38
-0+uint32_t ccw1[2 ];/* 0x008 */ +uint32_t ccw2[2 ];/* 0x010 */ +uint8_t pad1[0x80 -0x18 ];/* 0x018 */ +uint32_t ext_params;/* 0x080 */ +uint16_t cpu_addr;/* 0x084 */ +uint16_t ext_int_code;/* 0x086 */ +uint16_t svc_ilen;/* 0x088 */ +uint16_t svc_code;/* 0x08a */ +uint16_t pgm_ilen;/* 0x08c */ +uint16_t pgm_code;/* 0x08e */ +uint32_t data_exc_code;/* 0x090 */ +uint16_t mon_class_num;/* 0x094 */ +uint16_t per_perc_atmid;/* 0x096 */ +uint64_t per_address;/* 0x098 */ +uint8_t exc_access_id;/* 0x0a0 */ +uint8_t per_access_id;/* 0x0a1 */ +uint8_t op_access_id;/* 0x0a2 */ +uint8_t ar_access_id;/* 0x0a3 */ +uint8_t pad2[0xA8 -0xA4 ];/* 0x0a4 */ +uint64_t trans_exc_code;/* 0x0a8 */ +uint64_t monitor_code;/* 0x0b0 */ +uint16_t subchannel_id;/* 0x0b8 */ +uint16_t subchannel_nr;/* 0x0ba */ +uint32_t io_int_parm;/* 0x0bc */ +uint32_t io_int_word;/* 0x0c0 */ +uint8_t pad3[0xc8 -0xc4 ];/* 0x0c4 */ +uint32_t stfl_fac_list;/* 0x0c8 */ +uint8_t pad4[0xe8 -0xcc ];/* 0x0cc */ +uint64_t mcic;/* 0x0e8 */ +uint8_t pad5[0xf4 -0xf0 ];/* 0x0f0 */ +uint32_t external_damage_code;/* 0x0f4 */ +uint64_t failing_storage_address;/* 0x0f8 */ +uint8_t pad6[0x110 -0x100 ];/* 0x100 */ +uint64_t per_breaking_event_addr;/* 0x110 */ +uint8_t pad7[0x120 -0x118 ];/* 0x118 */ +PSW restart_old_psw;/* 0x120 */ +PSW external_old_psw;/* 0x130 */ +PSW svc_old_psw;/* 0x140 */
pc-bios/s390-ccw/s390-arch.h line 85
Quoted 10 lines
pc-bios/s390-ccw/s390-arch.h new file +10
-0+PSW program_old_psw;/* 0x150 */ +PSW mcck_old_psw;/* 0x160 */ +PSW io_old_psw;/* 0x170 */ +uint8_t pad8[0x1a0 -0x180 ];/* 0x180 */ +PSW restart_new_psw;/* 0x1a0 */ +PSW external_new_psw;/* 0x1b0 */ +PSW svc_new_psw;/* 0x1c0 */ +PSW program_new_psw;/* 0x1d0 */ +PSW mcck_new_psw;/* 0x1e0 */ +PSW io_new_psw;/* 0x1f0 */
So far so good ...
pc-bios/s390-ccw/s390-arch.h line 96
Quoted 11 lines
pc-bios/s390-ccw/s390-arch.h new file +11
-0+PSW return_psw;/* 0x200 */ +uint8_t irb[64 ];/* 0x210 */ +uint64_t sync_enter_timer;/* 0x250 */ +uint64_t async_enter_timer;/* 0x258 */ +uint64_t exit_timer;/* 0x260 */ +uint64_t last_update_timer;/* 0x268 */ +uint64_t user_timer;/* 0x270 */ +uint64_t system_timer;/* 0x278 */ +uint64_t last_update_clock;/* 0x280 */ +uint64_t steal_clock;/* 0x288 */ +PSW return_mcck_psw;/* 0x290 */
... but where do these entries between 0x200 and 0x2a0 come from? They do not seem to be defined by the Principles of Operation?
pc-bios/s390-ccw/s390-arch.h line 100
Quoted 4 lines
pc-bios/s390-ccw/s390-arch.h new file +4
-0+uint8_t pad9[0xc00 -0x2a0 ];/* 0x2a0 */ +} __attribute__((packed, aligned(8192))) LowCore; + +extern const LowCore *lowcore;
extern LowCore const *lowcore; ?
pc-bios/s390-ccw/s390-arch.h line 102
Quoted 2 lines
pc-bios/s390-ccw/s390-arch.h new file +1
-0+#endif
Thomas
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 08/16] s390-bios: Map low core memory
Quoted 144 lines · Thomas Huth
Quoted 24 lines · Jason J. Herne
Create a new header for basic architecture specific definitions and add a mapping of low core memory. This mapping will be used by the real dasd boot process.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/main.c | 2 + pc-bios/s390-ccw/s390-arch.h | 102 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+)create mode 100644
pc-bios/s390-ccw/s390-arch.hpc-bios/s390-ccw/main.c +1
-0@@ -9,6 +9,7 @@*/ #include "libc.h" +#include "s390-arch.h" #include "s390-ccw.h" #include "cio.h" #include "virtio.h" pc-bios/s390-ccw/main.c static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; · line 23
Quoted 4 lines
pc-bios/s390-ccw/main.c +1
-0@@ -19,6 +20,7 @@ static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));static bool have_iplb; +const LowCore *lowcore;/* Yes, this *is* a pointer to address 0 */ Shouldn't that rather be "LowCore const *lowcore" instead?
Quoted 35 lines
pc-bios/s390-ccw/main.c +0
-0#define LOADPARM_PROMPT "PROMPT "#define LOADPARM_EMPTY " "pc-bios/s390-ccw/s390-arch.h new file +27
-0@@ -0,0 +1,102 @@ +/* +* S390 Basic Architecture +* +* Copyright (c) 2019 Jason J. Herne <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#ifndef S390_ARCH_H +#define S390_ARCH_H + +typedef struct PSW { +uint64_t mask; +uint64_t addr; +} __attribute__ ((aligned (8 )))PSW ; +_Static_assert (sizeof (struct PSW ) ==16 ,"PSW size incorrect" ); + +/* Older PSW format used by LPSW instruction */ +typedef struct PSWLegacy { +uint32_t mask; +uint32_t addr; +} __attribute__ ((aligned (8 )))PSWLegacy ; +_Static_assert (sizeof (struct PSWLegacy ) ==8 ,"PSWLegacy size incorrect" ); + +/* s390 psw bit masks */ pc-bios/s390-ccw/s390-arch.h line 37
Quoted 10 lines
pc-bios/s390-ccw/s390-arch.h new file +10
-0+#define PSW_MASK_IOINT 0x0200000000000000ULL +#define PSW_MASK_WAIT 0x0002000000000000ULL +#define PSW_MASK_EAMODE 0x0000000100000000ULL +#define PSW_MASK_BAMODE 0x0000000080000000ULL +#define PSW_MASK_ZMODE (PSW_MASK_EAMODE | PSW_MASK_BAMODE) + +/* Low core mapping */ +typedef struct LowCore { + /* prefix area: defined by architecture */ + PSWLegacy ipl_psw; /* 0x000 */Maybe remove some white space between the variable type and name everywhere in this struct?
Quoted 38 lines
pc-bios/s390-ccw/s390-arch.h new file +38
-0+uint32_t ccw1[2 ];/* 0x008 */ +uint32_t ccw2[2 ];/* 0x010 */ +uint8_t pad1[0x80 -0x18 ];/* 0x018 */ +uint32_t ext_params;/* 0x080 */ +uint16_t cpu_addr;/* 0x084 */ +uint16_t ext_int_code;/* 0x086 */ +uint16_t svc_ilen;/* 0x088 */ +uint16_t svc_code;/* 0x08a */ +uint16_t pgm_ilen;/* 0x08c */ +uint16_t pgm_code;/* 0x08e */ +uint32_t data_exc_code;/* 0x090 */ +uint16_t mon_class_num;/* 0x094 */ +uint16_t per_perc_atmid;/* 0x096 */ +uint64_t per_address;/* 0x098 */ +uint8_t exc_access_id;/* 0x0a0 */ +uint8_t per_access_id;/* 0x0a1 */ +uint8_t op_access_id;/* 0x0a2 */ +uint8_t ar_access_id;/* 0x0a3 */ +uint8_t pad2[0xA8 -0xA4 ];/* 0x0a4 */ +uint64_t trans_exc_code;/* 0x0a8 */ +uint64_t monitor_code;/* 0x0b0 */ +uint16_t subchannel_id;/* 0x0b8 */ +uint16_t subchannel_nr;/* 0x0ba */ +uint32_t io_int_parm;/* 0x0bc */ +uint32_t io_int_word;/* 0x0c0 */ +uint8_t pad3[0xc8 -0xc4 ];/* 0x0c4 */ +uint32_t stfl_fac_list;/* 0x0c8 */ +uint8_t pad4[0xe8 -0xcc ];/* 0x0cc */ +uint64_t mcic;/* 0x0e8 */ +uint8_t pad5[0xf4 -0xf0 ];/* 0x0f0 */ +uint32_t external_damage_code;/* 0x0f4 */ +uint64_t failing_storage_address;/* 0x0f8 */ +uint8_t pad6[0x110 -0x100 ];/* 0x100 */ +uint64_t per_breaking_event_addr;/* 0x110 */ +uint8_t pad7[0x120 -0x118 ];/* 0x118 */ +PSW restart_old_psw;/* 0x120 */ +PSW external_old_psw;/* 0x130 */ +PSW svc_old_psw;/* 0x140 */ pc-bios/s390-ccw/s390-arch.h line 85
Quoted 10 lines
pc-bios/s390-ccw/s390-arch.h new file +10
-0+PSW program_old_psw;/* 0x150 */ +PSW mcck_old_psw;/* 0x160 */ +PSW io_old_psw;/* 0x170 */ +uint8_t pad8[0x1a0 -0x180 ];/* 0x180 */ +PSW restart_new_psw;/* 0x1a0 */ +PSW external_new_psw;/* 0x1b0 */ +PSW svc_new_psw;/* 0x1c0 */ +PSW program_new_psw;/* 0x1d0 */ +PSW mcck_new_psw;/* 0x1e0 */ +PSW io_new_psw;/* 0x1f0 */ So far so good ...
pc-bios/s390-ccw/s390-arch.h line 96
Quoted 11 lines
pc-bios/s390-ccw/s390-arch.h new file +11
-0+PSW return_psw;/* 0x200 */ +uint8_t irb[64 ];/* 0x210 */ +uint64_t sync_enter_timer;/* 0x250 */ +uint64_t async_enter_timer;/* 0x258 */ +uint64_t exit_timer;/* 0x260 */ +uint64_t last_update_timer;/* 0x268 */ +uint64_t user_timer;/* 0x270 */ +uint64_t system_timer;/* 0x278 */ +uint64_t last_update_clock;/* 0x280 */ +uint64_t steal_clock;/* 0x288 */ +PSW return_mcck_psw;/* 0x290 */
Quoted 3 lines
... but where do these entries between
0x200and0x2a0come from? They do not seem to be defined by the Principles of Operation?
Taken from target/s390x/internal.h. I stopped at "/* System info area */". Now that I'm looking at it, I'm not sue where these are coming from.... I will remove them in the next version.
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 08/16] s390-bios: Map low core memory
Quoted 15 lines · On Wed, 6 Mar 2019 14:28:42 -0500 "Jason J. Herne" <[email protected]>…
Quoted 14 lines · Thomas Huth
Quoted 11 lines · Jason J. Herne
pc-bios/s390-ccw/s390-arch.h new file +11
-0+PSW return_psw;/* 0x200 */ +uint8_t irb[64 ];/* 0x210 */ +uint64_t sync_enter_timer;/* 0x250 */ +uint64_t async_enter_timer;/* 0x258 */ +uint64_t exit_timer;/* 0x260 */ +uint64_t last_update_timer;/* 0x268 */ +uint64_t user_timer;/* 0x270 */ +uint64_t system_timer;/* 0x278 */ +uint64_t last_update_clock;/* 0x280 */ +uint64_t steal_clock;/* 0x288 */ +PSW return_mcck_psw;/* 0x290 */
Quoted 7 lines
Quoted 3 lines
... but where do these entries between
0x200and0x2a0come from? They do not seem to be defined by the Principles of Operation?Taken from
target/s390x/internal.h. I stopped at "/* System info area */". Now that I'm looking at it, I'm not sue where these are coming from.... I will remove them in the next version.
That was coming from an very old version of the lowcore in the Linux kernel... removed from internal.h with a patch queued on s390-next now :)
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 08/16] s390-bios: Map low core memory
In reply to Thomas HuthQuoted 19 lines · Thomas Huth
Quoted 18 lines · Jason J. Herne
Create a new header for basic architecture specific definitions and add a mapping of low core memory. This mapping will be used by the real dasd boot process.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/main.c | 2 + pc-bios/s390-ccw/s390-arch.h | 102 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+)create mode 100644
pc-bios/s390-ccw/s390-arch.hpc-bios/s390-ccw/main.c +0
-0@@ -9,6 +9,7 @@*/
Quoted 13 lines
pc-bios/s390-ccw/main.c static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; · line 23
Quoted 10 lines
pc-bios/s390-ccw/main.c +2
-0#include "libc.h" +#include "s390-arch.h" #include "s390-ccw.h" #include "cio.h" #include "virtio.h" @@ -19,6 +20,7 @@ static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));static bool have_iplb; +const LowCore *lowcore;/* Yes, this *is* a pointer to address 0 */ Shouldn't that rather be "LowCore const *lowcore" instead?
Yep, will fix this in both places.
...
Quoted 8 lines
pc-bios/s390-ccw/main.c static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Quoted 4 lines
pc-bios/s390-ccw/main.c +4
-0+/* Low core mapping */ +typedef struct LowCore { + /* prefix area: defined by architecture */ + PSWLegacy ipl_psw; /* 0x000 */Maybe remove some white space between the variable type and name everywhere in this struct?
I'd argue to leave this as-is for two reasons. 1) This is how it looks in the original (target/s390x/internal.h). 2) I prefer the alignment, I think it makes it easier to find what you're looking for, given the size of this struct.
Quoted 48 lines
Quoted 48 lines
pc-bios/s390-ccw/main.c +48
-0+uint32_t ccw1[2 ];/* 0x008 */ +uint32_t ccw2[2 ];/* 0x010 */ +uint8_t pad1[0x80 -0x18 ];/* 0x018 */ +uint32_t ext_params;/* 0x080 */ +uint16_t cpu_addr;/* 0x084 */ +uint16_t ext_int_code;/* 0x086 */ +uint16_t svc_ilen;/* 0x088 */ +uint16_t svc_code;/* 0x08a */ +uint16_t pgm_ilen;/* 0x08c */ +uint16_t pgm_code;/* 0x08e */ +uint32_t data_exc_code;/* 0x090 */ +uint16_t mon_class_num;/* 0x094 */ +uint16_t per_perc_atmid;/* 0x096 */ +uint64_t per_address;/* 0x098 */ +uint8_t exc_access_id;/* 0x0a0 */ +uint8_t per_access_id;/* 0x0a1 */ +uint8_t op_access_id;/* 0x0a2 */ +uint8_t ar_access_id;/* 0x0a3 */ +uint8_t pad2[0xA8 -0xA4 ];/* 0x0a4 */ +uint64_t trans_exc_code;/* 0x0a8 */ +uint64_t monitor_code;/* 0x0b0 */ +uint16_t subchannel_id;/* 0x0b8 */ +uint16_t subchannel_nr;/* 0x0ba */ +uint32_t io_int_parm;/* 0x0bc */ +uint32_t io_int_word;/* 0x0c0 */ +uint8_t pad3[0xc8 -0xc4 ];/* 0x0c4 */ +uint32_t stfl_fac_list;/* 0x0c8 */ +uint8_t pad4[0xe8 -0xcc ];/* 0x0cc */ +uint64_t mcic;/* 0x0e8 */ +uint8_t pad5[0xf4 -0xf0 ];/* 0x0f0 */ +uint32_t external_damage_code;/* 0x0f4 */ +uint64_t failing_storage_address;/* 0x0f8 */ +uint8_t pad6[0x110 -0x100 ];/* 0x100 */ +uint64_t per_breaking_event_addr;/* 0x110 */ +uint8_t pad7[0x120 -0x118 ];/* 0x118 */ +PSW restart_old_psw;/* 0x120 */ +PSW external_old_psw;/* 0x130 */ +PSW svc_old_psw;/* 0x140 */ +PSW program_old_psw;/* 0x150 */ +PSW mcck_old_psw;/* 0x160 */ +PSW io_old_psw;/* 0x170 */ +uint8_t pad8[0x1a0 -0x180 ];/* 0x180 */ +PSW restart_new_psw;/* 0x1a0 */ +PSW external_new_psw;/* 0x1b0 */ +PSW svc_new_psw;/* 0x1c0 */ +PSW program_new_psw;/* 0x1d0 */ +PSW mcck_new_psw;/* 0x1e0 */ +PSW io_new_psw;/* 0x1f0 */
Signature · 1 line
-- Jason J. Herne ([email protected])
PATCH v3 9/16 s390-bios: ptr2u32 and u32toptr
In reply to Jason J. HerneIntroduce inline functions to convert between pointers and unsigned 32-bit ints. These are used to hide the ugliness required to avoid compiler warnings.
--- pc-bios/s390-ccw/helper.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pc-bios/s390-ccw/helper.h
pc-bios/s390-ccw/helper.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef S390_CCW_HELPER_H +#define S390_CCW_HELPER_H + +/* Avoids compiler warnings when casting a pointer to a u32 */ +static inline uint32_t ptr2u32 (void *ptr) +{ +return (uint32_t )(uint64_t )ptr; +} + +/* Avoids compiler warnings when casting a u32 to a pointer */ +static inline void *u32toptr (uint32_t n) +{ +return (void *)(uint64_t )n; +} + +#endif
Signature · 1 line
2.7.4
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 09/16] s390-bios: ptr2u32 and u32toptr
Quoted 17 lines · Jason J. Herne
Introduce inline functions to convert between pointers and unsigned 32-bit ints. These are used to hide the ugliness required to avoid compiler warnings.
Signed-off-by Jason J. Herne <[email protected]>Acked-by Cornelia Huck <[email protected]>--- pc-bios/s390-ccw/helper.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pc-bios/s390-ccw/helper.hpc-bios/s390-ccw/helper.h new file +0
-0
pc-bios/s390-ccw/helper.h line 6
Quoted 6 lines
pc-bios/s390-ccw/helper.h new file +6
-0@@ -0,0 +1,16 @@ +#ifndef S390_CCW_HELPER_H +#define S390_CCW_HELPER_H + +/* Avoids compiler warnings when casting a pointer to a u32 */ +static inline uint32_t ptr2u32 (void *ptr) +{
Would it make sense to add an IPL_assert(ptr <= 0xffffffff) here?
pc-bios/s390-ccw/helper.h line 16
Quoted 10 lines
pc-bios/s390-ccw/helper.h new file +10
-0+ return (uint32_t)(uint64_t)ptr; +} + +/* Avoids compiler warnings when casting a u32 to a pointer */ +static inline void *u32toptr (uint32_t n) +{ +return (void *)(uint64_t )n; +} + +#endif
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 09/16] s390-bios: ptr2u32 and u32toptr
Quoted 12 lines · Thomas Huth
Quoted 11 lines · Jason J. Herne
Introduce inline functions to convert between pointers and unsigned 32-bit ints. These are used to hide the ugliness required to avoid compiler warnings.
Signed-off-by Jason J. Herne <[email protected]>Acked-by Cornelia Huck <[email protected]>--- pc-bios/s390-ccw/helper.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)create mode 100644
pc-bios/s390-ccw/helper.h
Quoted 15 lines
pc-bios/s390-ccw/helper.h line 6
Quoted 12 lines
pc-bios/s390-ccw/helper.h new file +6
-0@@ -0,0 +1,16 @@ +#ifndef S390_CCW_HELPER_H +#define S390_CCW_HELPER_H + +/* Avoids compiler warnings when casting a pointer to a u32 */ +static inline uint32_t ptr2u32 (void *ptr) +{Would it make sense to add an
IPL_assert(ptr <= 0xffffffff)here?
I'm not sure... I remember something about the bios always having to be below the 2^32 memory line. But I suppose it doesn't hurt to add the assert anyway. Then, someday, if my assumption proves not to be true or someone changes that assumption we are still covered.
Signature · 1 line
-- Jason J. Herne ([email protected])
PATCH v3 10/16 s390-bios: Support for running format-0/1 channel programs
In reply to Jason J. HerneAdd struct for format-0 ccws. Support executing format-0 channel programs and waiting for their completion before continuing execution. This will be used for real dasd ipl.
Add cu_type() to channel io library. This will be used to query control unit type which is used to determine if we are booting a virtio device or a real dasd device.
--- pc-bios/s390-ccw/cio.c | 141 ++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 127 ++++++++++++++++++++++++++++++++++++++- pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/start.S | 31 ++++++++++ 4 files changed, 297 insertions(+), 3 deletions(-)
pc-bios/s390-ccw/cio.c +141 -0
@@ -12,6 +12,8 @@#include "libc.h" #include "s390-ccw.h" +#include "s390-arch.h" +#include "helper.h" #include "cio.h" static char chsc_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
@@ -41,3 +43,142 @@ void enable_subchannel(SubChannelId schid) schib.pmcw.ena =1 ;msch (schid, &schib); } + +uint16_t cu_type (SubChannelId schid) +{ +Ccw1 sense_id_ccw; +SenseId sense_data; + + sense_id_ccw.cmd_code =CCW_CMD_SENSE_ID ; + sense_id_ccw.cda =ptr2u32 (&sense_data); + sense_id_ccw.count =sizeof (sense_data); + sense_id_ccw.flags |=CCW_FLAG_SLI ; + +if (do_cio (schid,ptr2u32 (&sense_id_ccw),CCW_FMT1 )) { +panic ("Failed to run SenseID CCw\n" ); + } + +return sense_data.cu_type; +} + +void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +{ +Ccw1 senseCcw; + + senseCcw.cmd_code =CCW_CMD_BASIC_SENSE ; + senseCcw.cda =ptr2u32 (sense_data); + senseCcw.count = data_size; + +if (do_cio (schid,ptr2u32 (&senseCcw),CCW_FMT1 )) { +panic ("Failed to run Basic Sense CCW\n" ); + } +} + +static bool irb_error (Irb *irb) +{ +if (irb->scsw.cstat) { +return true; + } +return irb->scsw.dstat != (SCSW_DSTAT_DEVEND |SCSW_DSTAT_CHEND ); +} + +/* +* Handles executing ssch, tsch and returns the irb obtained from tsch. +* Returns 0 on success, -1 if unexpected status pending and we need to retry, +* otherwse returns condition code from ssch/tsch for error cases. +*/ +static int __do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt,Irb *irb) +{ +CmdOrb orb = {}; +int rc; + +IPL_assert (fmt ==0 || fmt ==1 ,"Invalid ccw format" ); + +/* ccw_addr must be <= 24 bits and point to at least one whole ccw. */ +if (fmt ==0 ) { +IPL_assert (ccw_addr <=0xFFFFFF -8 ,"Invalid ccw address" ); + } + + orb.fmt = fmt ; + orb.pfch =1 ;/* QEMU's cio implementation requires prefetch */ + orb.c64 =1 ;/* QEMU's cio implementation requires 64-bit idaws */ + orb.lpm =0xFF ;/* All paths allowed */ + orb.cpa = ccw_addr; + + rc =ssch (schid, &orb); +if (rc ==1 ) { +/* Status pending, not sure why. Eat status and ask for retry. */ +tsch (schid, irb); +return -1 ; + } +if (rc) { +print_int ("ssch failed with rc=" , rc); +return rc; + } + +consume_io_int (); + +/* collect status */ + rc =tsch (schid, irb); +if (rc) { +print_int ("tsch failed with rc=" , rc); + } + +return rc; +} + +/* +* Executes a channel program at a given subchannel. The request to run the +* channel program is sent to the subchannel, we then wait for the interrupt +* signaling completion of the I/O operation(s) performed by the channel +* program. Lastly we verify that the i/o operation completed without error and +* that the interrupt we received was for the subchannel used to run the +* channel program. +* +* Note: This function assumes it is running in an environment where no other +* cpus are generating or receiving I/O interrupts. So either run it in a +* single-cpu environment or make sure all other cpus are not doing I/O and +* have I/O interrupts masked off. +* +* Returns non-zero on error. +*/ +int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +{ +Irb irb = {}; +SenseDataEckdDasd sd; +int rc, retries =0 ; + +while (true) { + rc =__do_cio (schid, ccw_addr, fmt, &irb); + +if (rc ==-1 ) { + retries++; +continue ; + } +if (rc) { +/* ssch/tsch error. Message already reported by __do_cio */ +break ; + } + +if (!irb_error (&irb)) { +break ; + } + +/* +* Unexpected unit check, or interface-control-check. Use sense to +* clear (unit check only) then retry. +*/ +if ((unit_check (&irb) ||iface_ctrl_check (&irb)) && retries <=2 ) { +if (unit_check (&irb)) { +basic_sense (schid, &sd,sizeof (sd)); + } + retries++; +continue ; + } + + rc =-1 ; +break ; + } + +return rc; +}
pc-bios/s390-ccw/cio.h +124 -3
164 lines not on this page · raw message
pc-bios/s390-ccw/s390-ccw.h +1 -0
@@ -52,6 +52,7 @@ typedef unsigned long long __u64;/* start.s */ void disabled_wait (void );void consume_sclp_int (void ); +void consume_io_int (void );/* main.c */ void panic (const char *string);
pc-bios/s390-ccw/start.S +31 -0
@@ -71,6 +71,26 @@ consume_sclp_int: larl %r1, enabled_wait_psw lpswe 0(%r1) +/* + * void consume_io_int(void) + * + * eats one I/O interrupt + */ + .globl consume_io_int +consume_io_int: + /* enable I/O interrupts in cr6 */ + stctg 6,6,0(15) + oi 4(15), 0xff + lctlg 6,6,0(15) + /* prepare i/o call handler */ + larl %r1, io_new_code + stg %r1, 0x1f8 + larl %r1, io_new_mask + mvc 0x1f0(8),0(%r1) + /* load enabled wait PSW */ + larl %r1, enabled_wait_psw + lpswe 0(%r1) + external_new_code: /* disable service interrupts in cr0 */ stctg %c0,%c0,0(%r15)
@@ -78,6 +98,15 @@ external_new_code: lctlg %c0,%c0,0(%r15) br %r14 +io_new_code: + /* disable I/O interrupts in cr6 */ + stctg 6,6,0(15) + ni 4(15), 0x00 + lctlg 6,6,0(15) + br 14 + + + .align 8 disabled_wait_psw: .quad 0x0002000180000000,0x0000000000000000
@@ -85,3 +114,5 @@ enabled_wait_psw: .quad 0x0302000180000000,0x0000000000000000 external_new_mask: .quad 0x0000000180000000 +io_new_mask: + .quad 0x0000000180000000
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 10/16] s390-bios: Support for running format-0/1 channel programs
Quoted 2 lines · On Fri, 1 Mar 2019 13:59:30 -0500 "Jason J. Herne" <[email protected]>…
Add struct for format-0 ccws. Support executing format-0 channel programs and waiting for their completion before continuing execution.
That sentence is a bit confusing. What about:
"Introduce a library function for executing format-0 and format-1 channel programs..."
Quoted 1 line
This will be used for real dasd ipl.
But also for virtio in the follow-on patches, won't it?
Quoted 13 lines
Add
cu_type()to channel io library. This will be used to query control unit type which is used to determine if we are booting a virtio device or a real dasd device.Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 141 ++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 127 ++++++++++++++++++++++++++++++++++++++- pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/start.S | 31 ++++++++++ 4 files changed, 297 insertions(+), 3 deletions(-)
(...)
Quoted 4 lines
+/*
+ * Handles executing ssch, tsch and returns the irb obtained from tsch.
+ * Returns 0 on success, -1 if unexpected status pending and we need to retry,
+ * otherwse returns condition code from ssch/tsch for error cases.
s/otherwse/otherwise/
Quoted 4 lines
+ */
pc-bios/s390-ccw/cio.c +3
-0+static int __do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt,Irb *irb) +{ +CmdOrb orb = {};
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 102
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+int rc; + +IPL_assert (fmt ==0 || fmt ==1 ,"Invalid ccw format" ); + +/* ccw_addr must be <= 24 bits and point to at least one whole ccw. */ +if (fmt ==0 ) { +IPL_assert (ccw_addr <=0xFFFFFF -8 ,"Invalid ccw address" ); + } + + orb.fmt = fmt ;
extra ' ' before ';'
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 115
Quoted 13 lines
pc-bios/s390-ccw/cio.c +13
-0+ orb.pfch =1 ;/* QEMU's cio implementation requires prefetch */ + orb.c64 =1 ;/* QEMU's cio implementation requires 64-bit idaws */ + orb.lpm =0xFF ;/* All paths allowed */ + orb.cpa = ccw_addr; + + rc =ssch (schid, &orb); +if (rc ==1 ) { +/* Status pending, not sure why. Eat status and ask for retry. */ +tsch (schid, irb); +return -1 ; + } +if (rc) { +print_int ("ssch failed with rc=" , rc);
Better 'cc' than 'rc' in the message?
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 125
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+return rc; + } + +consume_io_int (); + +/* collect status */ + rc =tsch (schid, irb); +if (rc) { +print_int ("tsch failed with rc=" , rc); + }
Hm. The whole code flow relies on the fact that not only no more than one cpu is enabled for I/O interrupts, but also only one subchannel. Otherwise, you could get an interrupt for another subchannel, which would be the only way you'd get cc 1 on the tsch for this subchannel here (no status pending). Maybe peek at the interruption information stored into the lowcore first?
Won't be a problem with the code as it is now, though, AFAICS.
Quoted 24 lines
pc-bios/s390-ccw/cio.c +24
-0+ +return rc; +} + +/* +* Executes a channel program at a given subchannel. The request to run the +* channel program is sent to the subchannel, we then wait for the interrupt +* signaling completion of the I/O operation(s) performed by the channel +* program. Lastly we verify that the i/o operation completed without error and +* that the interrupt we received was for the subchannel used to run the +* channel program. +* +* Note: This function assumes it is running in an environment where no other +* cpus are generating or receiving I/O interrupts. So either run it in a +* single-cpu environment or make sure all other cpus are not doing I/O and +* have I/O interrupts masked off. +* +* Returns non-zero on error. +*/ +int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +{ +Irb irb = {}; +SenseDataEckdDasd sd; +int rc, retries =0 ;
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 159
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+ +while (true) { + rc =__do_cio (schid, ccw_addr, fmt, &irb); + +if (rc ==-1 ) { + retries++; +continue ; + } +if (rc) { +/* ssch/tsch error. Message already reported by __do_cio */
You might also want to consider retrying on cc 2. Not very likely, though.
Quoted 4 lines
pc-bios/s390-ccw/cio.c +4
-0+break ; + } + +if (!irb_error (&irb)) {
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 173
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+break ; + } + +/* +* Unexpected unit check, or interface-control-check. Use sense to +* clear (unit check only) then retry. +*/ +if ((unit_check (&irb) ||iface_ctrl_check (&irb)) && retries <=2 ) { +if (unit_check (&irb)) { +basic_sense (schid, &sd,sizeof (sd));
Unless I'm confused: I think you can still descend into the unit check rabbit hole here. basic_sense() calls do_cio(), which calls basic_sense(),... and we don't even get to the retries check.
Maybe call __do_cio() from basic_sense() instead and make that return an error instead of panicking? Then you could just bump retries here and give up after some retries...
Quoted 11 lines
pc-bios/s390-ccw/cio.c +11
-0+ } + retries++; +continue ; + } + + rc =-1 ; +break ; + } + +return rc; +}
Re: [Qemu-devel] [PATCH v3 10/16] s390-bios: Support for running format-0/1 channel programs
Quoted 11 lines · Cornelia Huck
Quoted 2 lines · On Fri, 1 Mar 2019 13:59:30 -0500 "Jason J. Herne" <[email protected]>…
Add struct for format-0 ccws. Support executing format-0 channel programs and waiting for their completion before continuing execution.
That sentence is a bit confusing. What about:
"Introduce a library function for executing format-0 and format-1 channel programs..."
Agreed. Fixed.
Quoted 4 lines
Quoted 1 line
This will be used for real dasd ipl.
But also for virtio in the follow-on patches, won't it?
True. I removed that line. It is obvious and not really useful anyway.
...
Quoted 4 lines
Quoted 1 line
+ orb.fmt = fmt ;
extra ' ' before ';'
Fixed.
Quoted 14 lines
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 115
Quoted 13 lines
pc-bios/s390-ccw/cio.c +13
-0+ orb.pfch =1 ;/* QEMU's cio implementation requires prefetch */ + orb.c64 =1 ;/* QEMU's cio implementation requires 64-bit idaws */ + orb.lpm =0xFF ;/* All paths allowed */ + orb.cpa = ccw_addr; + + rc =ssch (schid, &orb); +if (rc ==1 ) { +/* Status pending, not sure why. Eat status and ask for retry. */ +tsch (schid, irb); +return -1 ; + } +if (rc) { +print_int ("ssch failed with rc=" , rc);
Quoted 2 lines
Better 'cc' than 'rc' in the message?
Fixed here and for tsch as well.
Quoted 18 lines
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 125
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+return rc; + } + +consume_io_int (); + +/* collect status */ + rc =tsch (schid, irb); +if (rc) { +print_int ("tsch failed with rc=" , rc); + }Hm. The whole code flow relies on the fact that not only no more than one cpu is enabled for I/O interrupts, but also only one subchannel. Otherwise, you could get an interrupt for another subchannel, which would be the only way you'd get cc 1 on the tsch for this subchannel here (no status pending). Maybe peek at the interruption information stored into the lowcore first?
Quoted 2 lines
Won't be a problem with the code as it is now, though, AFAICS.
Agreed, voting to leave as is. Perhaps a comment to explain that we rely on only one "Active" i/o device?
Quoted 29 lines
Quoted 29 lines
pc-bios/s390-ccw/cio.c +29
-0+ +return rc; +} + +/* +* Executes a channel program at a given subchannel. The request to run the +* channel program is sent to the subchannel, we then wait for the interrupt +* signaling completion of the I/O operation(s) performed by the channel +* program. Lastly we verify that the i/o operation completed without error and +* that the interrupt we received was for the subchannel used to run the +* channel program. +* +* Note: This function assumes it is running in an environment where no other +* cpus are generating or receiving I/O interrupts. So either run it in a +* single-cpu environment or make sure all other cpus are not doing I/O and +* have I/O interrupts masked off. +* +* Returns non-zero on error. +*/ +int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +{ +Irb irb = {}; +SenseDataEckdDasd sd; +int rc, retries =0 ; + +while (true) { + rc =__do_cio (schid, ccw_addr, fmt, &irb); + +if (rc ==-1 ) {
Quoted 9 lines
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 159
Quoted 5 lines
pc-bios/s390-ccw/cio.c +5
-0+ retries++; +continue ; + } +if (rc) { +/* ssch/tsch error. Message already reported by __do_cio */ You might also want to consider retrying on cc 2. Not very likely, though.
It is easy to retry on cc=2, fixed.
Quoted 19 lines
Quoted 4 lines
pc-bios/s390-ccw/cio.c +4
-0+break ; + } + +if (!irb_error (&irb)) {pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 173
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+break ; + } + +/* +* Unexpected unit check, or interface-control-check. Use sense to +* clear (unit check only) then retry. +*/ +if ((unit_check (&irb) ||iface_ctrl_check (&irb)) && retries <=2 ) { +if (unit_check (&irb)) { +basic_sense (schid, &sd,sizeof (sd));Unless I'm confused: I think you can still descend into the unit check rabbit hole here.
basic_sense()callsdo_cio(), which callsbasic_sense(),... and we don't even get to the retries check.
Quoted 4 lines
Maybe call
__do_cio()frombasic_sense()instead and make that return an error instead of panicking? Then you could just bump retries here and give up after some retries...
Yes, good point. This is now fixed.
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 10/16] s390-bios: Support for running format-0/1 channel programs
Quoted 19 lines · On Thu, 7 Mar 2019 14:25:00 -0500 "Jason J. Herne" <[email protected]>…
Quoted 18 lines · Cornelia Huck
pc-bios/s390-ccw/cio.c void enable_subchannel(SubChannelId schid) · line 125
Quoted 7 lines · On Fri, 1 Mar 2019 13:59:30 -0500 "Jason J. Herne" <[email protected]>…
pc-bios/s390-ccw/cio.c +7
-0+consume_io_int (); + +/* collect status */ + rc =tsch (schid, irb); +if (rc) { +print_int ("tsch failed with rc=" , rc); + }Hm. The whole code flow relies on the fact that not only no more than one cpu is enabled for I/O interrupts, but also only one subchannel. Otherwise, you could get an interrupt for another subchannel, which would be the only way you'd get cc 1 on the tsch for this subchannel here (no status pending). Maybe peek at the interruption information stored into the lowcore first?
Quoted 4 lines
Quoted 2 lines
Won't be a problem with the code as it is now, though, AFAICS.
Agreed, voting to leave as is. Perhaps a comment to explain that we rely on only one "Active" i/o device?
Yes, sounds good.
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 10/16] s390-bios: Support for running format-0/1 channel programs
In reply to Jason J. HerneQuoted 10 lines · Jason J. Herne
Add struct for format-0 ccws. Support executing format-0 channel programs and waiting for their completion before continuing execution. This will be used for real dasd ipl.
Add
cu_type()to channel io library. This will be used to query control unit type which is used to determine if we are booting a virtio device or a real dasd device.Signed-off-by Jason J. Herne <[email protected]>---
[...]
Quoted 9 lines
pc-bios/s390-ccw/start.S +1
-0@@ -71,6 +71,26 @@ consume_sclp_int: larl %r1, enabled_wait_psw lpswe 0(%r1) +/*
pc-bios/s390-ccw/start.S consume_sclp_int: · line 84
Quoted 10 lines
pc-bios/s390-ccw/start.S +10
-0+ * void consume_io_int(void) + * + * eats one I/O interrupt + */ + .globl consume_io_int +consume_io_int: + /* enable I/O interrupts in cr6 */ + stctg 6,6,0(15) + oi 4(15), 0xff + lctlg 6,6,0(15)
Could you please use %-register names? If we ever want to compile the code with Clang again, this will likely be required (see commit 0d3a76139827f7d08f1b for example). I.e.:
stctg %c6,%c6,0(%r15)
oi 4(%r15),0xff
lctlg %c6,%c6,0(%r15)(indenting the parameters of the instruction would also be nice)
Quoted 13 lines
pc-bios/s390-ccw/start.S +9
-0+ /* prepare i/o call handler */ + larl %r1, io_new_code + stg %r1, 0x1f8 + larl %r1, io_new_mask + mvc 0x1f0(8),0(%r1) + /* load enabled wait PSW */ + larl %r1, enabled_wait_psw + lpswe 0(%r1) + external_new_code: /* disable service interrupts in cr0 */ stctg %c0,%c0,0(%r15)
pc-bios/s390-ccw/start.S external_new_code: · line 105
Quoted 8 lines
pc-bios/s390-ccw/start.S +5
-0@@ -78,6 +98,15 @@ external_new_code: lctlg %c0,%c0,0(%r15) br %r14 +io_new_code: + /* disable I/O interrupts in cr6 */ + stctg 6,6,0(15) + ni 4(15), 0x00 + lctlg 6,6,0(15)
dito
Thanks,
Thomas
PATCH v3 11/16 s390-bios: cio error handling
In reply to Jason J. HerneAdd verbose error output for when unexpected i/o errors happen. This eases the burden of debugging and reporting i/o errors. No error information is printed in the success case, here is an example of what is output on error:
cio device error
ssid : 0x0000000000000000
cssid : 0x0000000000000000
sch_no: 0x0000000000000000
Interrupt Response Block Data:
Function Ctrl : [Start]
Activity Ctrl : [Start-Pending]
Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending] Device Status : [Unit-Check]
Channel Status :
cpa=: 0x000000007f8d6038
prev_ccw=: 0x0000000000000000
this_ccw=: 0x0000000000000000
Eckd Dasd Sense Data (fmt 32-bytes):
Sense Condition Flags :
Residual Count =: 0x0000000000000000
Phys Drive ID =: 0x000000000000009e
low cyl address =: 0x0000000000000000
head addr & hi cyl =: 0x0000000000000000
format/message =: 0x0000000000000008
fmt-dependent[0-7] =: 0x0000000000000004
fmt-dependent[8-15]=: 0xe561282305082fff
prog action code =: 0x0000000000000016
Configuration info =: 0x00000000000040e0
mcode / hi-cyl =: 0x0000000000000000
cyl & head addr [0]=: 0x0000000000000000
cyl & head addr [1]=: 0x0000000000000000
cyl & head addr [2]=: 0x0000000000000000--- pc-bios/s390-ccw/cio.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/libc.h | 11 +++ 2 files changed, 241 insertions(+)
pc-bios/s390-ccw/cio.c +230 -0
@@ -82,6 +82,228 @@ static bool irb_error(Irb *irb)return irb->scsw.dstat != (SCSW_DSTAT_DEVEND |SCSW_DSTAT_CHEND ); } +static void print_eckd_dasd_sense_data (SenseDataEckdDasd *sd) +{ +char msgline[512 ]; + +if (sd->config_info &0x8000 ) { +sclp_print ("Eckd Dasd Sense Data (fmt 24-bytes):\n" ); + }else { +sclp_print ("Eckd Dasd Sense Data (fmt 32-bytes):\n" ); + } + +strcat (msgline," Sense Condition Flags :" ); +if (sd->status[0 ] &SNS_STAT0_CMD_REJECT ) { +strcat (msgline," [Cmd-Reject]" ); + } +if (sd->status[0 ] &SNS_STAT0_INTERVENTION_REQ ) { +strcat (msgline," [Intervention-Required]" ); + } +if (sd->status[0 ] &SNS_STAT0_BUS_OUT_CHECK ) { +strcat (msgline," [Bus-Out-Parity-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_EQUIPMENT_CHECK ) { +strcat (msgline," [Equipment-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_DATA_CHECK ) { +strcat (msgline," [Data-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_OVERRUN ) { +strcat (msgline," [Overrun]" ); + } +if (sd->status[0 ] &SNS_STAT0_INCOMPL_DOMAIN ) { +strcat (msgline," [Incomplete-Domain]" ); + } + +if (sd->status[1 ] &SNS_STAT1_PERM_ERR ) { +strcat (msgline," [Permanent-Error]" ); + } +if (sd->status[1 ] &SNS_STAT1_INV_TRACK_FORMAT ) { +strcat (msgline," [Invalid-Track-Fmt]" ); + } +if (sd->status[1 ] &SNS_STAT1_EOC ) { +strcat (msgline," [End-of-Cyl]" ); + } +if (sd->status[1 ] &SNS_STAT1_MESSAGE_TO_OPER ) { +strcat (msgline," [Operator-Msg]" ); + } +if (sd->status[1 ] &SNS_STAT1_NO_REC_FOUND ) { +strcat (msgline," [No-Record-Found]" ); + } +if (sd->status[1 ] &SNS_STAT1_FILE_PROTECTED ) { +strcat (msgline," [File-Protected]" ); + } +if (sd->status[1 ] &SNS_STAT1_WRITE_INHIBITED ) { +strcat (msgline," [Write-Inhibited]" ); + } +if (sd->status[1 ] &SNS_STAT1_IMPRECISE_END ) { +strcat (msgline," [Imprecise-Ending]" ); + } + +if (sd->status[2 ] &SNS_STAT2_REQ_INH_WRITE ) { +strcat (msgline," [Req-Inhibit-Write]" ); + } +if (sd->status[2 ] &SNS_STAT2_CORRECTABLE ) { +strcat (msgline," [Correctable-Data-Check]" ); + } +if (sd->status[2 ] &SNS_STAT2_FIRST_LOG_ERR ) { +strcat (msgline," [First-Error-Log]" ); + } +if (sd->status[2 ] &SNS_STAT2_ENV_DATA_PRESENT ) { +strcat (msgline," [Env-Data-Present]" ); + } +if (sd->status[2 ] &SNS_STAT2_IMPRECISE_END ) { +strcat (msgline," [Imprecise-End]" ); + } +strcat (msgline,"\n" ); +sclp_print (msgline); + +print_int (" Residual Count =" , sd->res_count); +print_int (" Phys Drive ID =" , sd->phys_drive_id); +print_int (" low cyl address =" , sd->low_cyl_addr); +print_int (" head addr & hi cyl =" , sd->head_high_cyl_addr); +print_int (" format/message =" , sd->fmt_msg); +print_int (" fmt-dependent[0-7] =" , sd->fmt_dependent_info[0 ]); +print_int (" fmt-dependent[8-15]=" , sd->fmt_dependent_info[1 ]); +print_int (" prog action code =" , sd->program_action_code); +print_int (" Configuration info =" , sd->config_info); +print_int (" mcode / hi-cyl =" , sd->mcode_hicyl); +print_int (" cyl & head addr [0]=" , sd->cyl_head_addr[0 ]); +print_int (" cyl & head addr [1]=" , sd->cyl_head_addr[1 ]); +print_int (" cyl & head addr [2]=" , sd->cyl_head_addr[2 ]); +} + +static void print_irb_err (Irb *irb) +{ +uint64_t this_ccw = *(uint64_t *)u32toptr (irb->scsw.cpa); +uint64_t prev_ccw = *(uint64_t *)u32toptr (irb->scsw.cpa -8 ); +char msgline[256 ]; + +sclp_print ("Interrupt Response Block Data:\n" ); + +strcat (msgline," Function Ctrl :" ); +if (irb->scsw.ctrl &SCSW_FCTL_START_FUNC ) { +strcat (msgline," [Start]" ); + } +if (irb->scsw.ctrl &SCSW_FCTL_HALT_FUNC ) { +strcat (msgline," [Halt]" ); + } +if (irb->scsw.ctrl &SCSW_FCTL_CLEAR_FUNC ) { +strcat (msgline," [Clear]" ); + } +strcat (msgline,"\n" ); +sclp_print (msgline); + + msgline[0 ] ='\0' ; +strcat (msgline," Activity Ctrl :" ); +if (irb->scsw.ctrl &SCSW_ACTL_RESUME_PEND ) { +strcat (msgline," [Resume-Pending]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_START_PEND ) { +strcat (msgline," [Start-Pending]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_HALT_PEND ) { +strcat (msgline," [Halt-Pending]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_CLEAR_PEND ) { +strcat (msgline," [Clear-Pending]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_CH_ACTIVE ) { +strcat (msgline," [Channel-Active]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_DEV_ACTIVE ) { +strcat (msgline," [Device-Active]" ); + } +if (irb->scsw.ctrl &SCSW_ACTL_SUSPENDED ) { +strcat (msgline," [Suspended]" ); + } +strcat (msgline,"\n" ); +sclp_print (msgline); + + msgline[0 ] ='\0' ; +strcat (msgline," Status Ctrl :" ); +if (irb->scsw.ctrl &SCSW_SCTL_ALERT ) { +strcat (msgline," [Alert]" ); + } +if (irb->scsw.ctrl &SCSW_SCTL_INTERMED ) { +strcat (msgline," [Intermediate]" ); + } +if (irb->scsw.ctrl &SCSW_SCTL_PRIMARY ) { +strcat (msgline," [Primary]" ); + } +if (irb->scsw.ctrl &SCSW_SCTL_SECONDARY ) { +strcat (msgline," [Secondary]" ); + } +if (irb->scsw.ctrl &SCSW_SCTL_STATUS_PEND ) { +strcat (msgline," [Status-Pending]" ); + } + +strcat (msgline,"\n" ); +sclp_print (msgline); + + msgline[0 ] ='\0' ; +strcat (msgline," Device Status :" ); +if (irb->scsw.dstat &SCSW_DSTAT_ATTN ) { +strcat (msgline," [Attention]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_STATMOD ) { +strcat (msgline," [Status-Modifier]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_CUEND ) { +strcat (msgline," [Ctrl-Unit-End]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_BUSY ) { +strcat (msgline," [Busy]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_CHEND ) { +strcat (msgline," [Channel-End]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_DEVEND ) { +strcat (msgline," [Device-End]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_UCHK ) { +strcat (msgline," [Unit-Check]" ); + } +if (irb->scsw.dstat &SCSW_DSTAT_UEXCP ) { +strcat (msgline," [Unit-Exception]" ); + } +strcat (msgline,"\n" ); +sclp_print (msgline); + + msgline[0 ] ='\0' ; +strcat (msgline," Channel Status :" ); +if (irb->scsw.cstat &SCSW_CSTAT_PCINT ) { +strcat (msgline," [Program-Ctrl-Interruption]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_BADLEN ) { +strcat (msgline," [Incorrect-Length]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_PROGCHK ) { +strcat (msgline," [Program-Check]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_PROTCHK ) { +strcat (msgline," [Protection-Check]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_CHDCHK ) { +strcat (msgline," [Channel-Data-Check]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_CHCCHK ) { +strcat (msgline," [Channel-Ctrl-Check]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_ICCHK ) { +strcat (msgline," [Interface-Ctrl-Check]" ); + } +if (irb->scsw.cstat &SCSW_CSTAT_CHAINCHK ) { +strcat (msgline," [Chaining-Check]" ); + } +strcat (msgline,"\n" ); +sclp_print (msgline); + +print_int (" cpa=" , irb->scsw.cpa); +print_int (" prev_ccw=" , prev_ccw); +print_int (" this_ccw=" , this_ccw); +} +/* * Handles executing ssch, tsch and returns the irb obtained from tsch. * Returns 0 on success, -1 if unexpected status pending and we need to retry,
@@ -176,6 +398,14 @@ int do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt)continue ; } +sclp_print ("cio device error\n" ); +print_int (" ssid " , schid.ssid); +print_int (" cssid " , schid.cssid); +print_int (" sch_no" , schid.sch_no); +sclp_print ("\n" ); +print_irb_err (&irb); +basic_sense (schid, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); rc =-1 ;break ; }
pc-bios/s390-ccw/libc.h +11 -0
@@ -67,6 +67,17 @@ static inline size_t strlen(const char *str)return i; } +static inline char *strcat (char *dest,const char *src) +{ +int i; +char *dest_end = dest +strlen (dest); + +for (i =0 ; i <=strlen (src); i++) { + dest_end[i] = src[i]; + } +return dest; +} +static inline int isdigit (int c) {return (c >='0' ) && (c <='9' );
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 11/16] s390-bios: cio error handling
Quoted 63 lines · On Fri, 1 Mar 2019 13:59:31 -0500 "Jason J. Herne" <[email protected]>…
Add verbose error output for when unexpected i/o errors happen. This eases the burden of debugging and reporting i/o errors. No error information is printed in the success case, here is an example of what is output on error:
cio device error
ssid :0x0000000000000000
cssid :0x0000000000000000
sch_no:0x0000000000000000Interrupt Response Block Data:
Function Ctrl : [Start]
Activity Ctrl : [Start-Pending]
Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending] Device Status : [Unit-Check]
Channel Status :
cpa=:0x000000007f8d6038
prev_ccw=:0x0000000000000000
this_ccw=:0x0000000000000000
Eckd Dasd Sense Data (fmt 32-bytes):Sense Condition Flags : Residual Count =: 0x0000000000000000 Phys Drive ID =: 0x000000000000009e low cyl address =: 0x0000000000000000 head addr & hi cyl =: 0x0000000000000000 format/message =: 0x0000000000000008 fmt-dependent[0-7] =: 0x0000000000000004 fmt-dependent[8-15]=: 0xe561282305082fff prog action code =: 0x0000000000000016 Configuration info =: 0x00000000000040e0 mcode / hi-cyl =: 0x0000000000000000 cyl & head addr [0]=: 0x0000000000000000 cyl & head addr [1]=: 0x0000000000000000 cyl & head addr [2]=: 0x0000000000000000Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/libc.h | 11 +++ 2 files changed, 241 insertions(+)pc-bios/s390-ccw/cio.c +15
-0@@ -82,6 +82,228 @@ static bool irb_error(Irb *irb)return irb->scsw.dstat != (SCSW_DSTAT_DEVEND |SCSW_DSTAT_CHEND ); } +static void print_eckd_dasd_sense_data (SenseDataEckdDasd *sd) +{ +char msgline[512 ]; + +if (sd->config_info &0x8000 ) { +sclp_print ("Eckd Dasd Sense Data (fmt 24-bytes):\n" ); + }else { +sclp_print ("Eckd Dasd Sense Data (fmt 32-bytes):\n" ); + } + +strcat (msgline," Sense Condition Flags :" ); +if (sd->status[0 ] &SNS_STAT0_CMD_REJECT ) { +strcat (msgline," [Cmd-Reject]" ); + } +if (sd->status[0 ] &SNS_STAT0_INTERVENTION_REQ ) {
pc-bios/s390-ccw/cio.c static bool irb_error(Irb *irb) · line 109
Quoted 10 lines
pc-bios/s390-ccw/cio.c +10
-0+strcat (msgline," [Intervention-Required]" ); + } +if (sd->status[0 ] &SNS_STAT0_BUS_OUT_CHECK ) { +strcat (msgline," [Bus-Out-Parity-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_EQUIPMENT_CHECK ) { +strcat (msgline," [Equipment-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_DATA_CHECK ) { +strcat (msgline," [Data-Check]" );
I'm wondering whether it would make sense to factor the common bits out. Might be overkill, though.
Quoted 7 lines
pc-bios/s390-ccw/cio.c +7
-0+ } +if (sd->status[0 ] &SNS_STAT0_OVERRUN ) { +strcat (msgline," [Overrun]" ); + } +if (sd->status[0 ] &SNS_STAT0_INCOMPL_DOMAIN ) { +strcat (msgline," [Incomplete-Domain]" ); + }
(...)
pc-bios/s390-ccw/cio.c int do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt) · line 406
Quoted 6 lines
pc-bios/s390-ccw/cio.c +6
-0+sclp_print ("cio device error\n" ); +print_int (" ssid " , schid.ssid); +print_int (" cssid " , schid.cssid); +print_int (" sch_no" , schid.sch_no); +sclp_print ("\n" ); +print_irb_err (&irb);
Maybe do basic_sense + print sense data only if there's actually a unit check?
(Also, I'm not sure if you can even do a basic_sense in case e.g. of unexpected busy.)
Quoted 5 lines
pc-bios/s390-ccw/cio.c +2
-0+basic_sense (schid, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); rc =-1 ;break ; }
Re: [Qemu-devel] [PATCH v3 11/16] s390-bios: cio error handling
Quoted 71 lines · Cornelia Huck
Quoted 68 lines · On Fri, 1 Mar 2019 13:59:31 -0500 "Jason J. Herne" <[email protected]>…
Add verbose error output for when unexpected i/o errors happen. This eases the burden of debugging and reporting i/o errors. No error information is printed in the success case, here is an example of what is output on error:
cio device error
ssid :0x0000000000000000
cssid :0x0000000000000000
sch_no:0x0000000000000000Interrupt Response Block Data:
Function Ctrl : [Start]
Activity Ctrl : [Start-Pending]
Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending] Device Status : [Unit-Check]
Channel Status :
cpa=:0x000000007f8d6038
prev_ccw=:0x0000000000000000
this_ccw=:0x0000000000000000
Eckd Dasd Sense Data (fmt 32-bytes):Sense Condition Flags : Residual Count =: 0x0000000000000000 Phys Drive ID =: 0x000000000000009e low cyl address =: 0x0000000000000000 head addr & hi cyl =: 0x0000000000000000 format/message =: 0x0000000000000008 fmt-dependent[0-7] =: 0x0000000000000004 fmt-dependent[8-15]=: 0xe561282305082fff prog action code =: 0x0000000000000016 Configuration info =: 0x00000000000040e0 mcode / hi-cyl =: 0x0000000000000000 cyl & head addr [0]=: 0x0000000000000000 cyl & head addr [1]=: 0x0000000000000000 cyl & head addr [2]=: 0x0000000000000000Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/libc.h | 11 +++ 2 files changed, 241 insertions(+)pc-bios/s390-ccw/cio.c +20
-0@@ -82,6 +82,228 @@ static bool irb_error(Irb *irb)return irb->scsw.dstat != (SCSW_DSTAT_DEVEND |SCSW_DSTAT_CHEND ); } +static void print_eckd_dasd_sense_data (SenseDataEckdDasd *sd) +{ +char msgline[512 ]; + +if (sd->config_info &0x8000 ) { +sclp_print ("Eckd Dasd Sense Data (fmt 24-bytes):\n" ); + }else { +sclp_print ("Eckd Dasd Sense Data (fmt 32-bytes):\n" ); + } + +strcat (msgline," Sense Condition Flags :" ); +if (sd->status[0 ] &SNS_STAT0_CMD_REJECT ) { +strcat (msgline," [Cmd-Reject]" ); + } +if (sd->status[0 ] &SNS_STAT0_INTERVENTION_REQ ) { +strcat (msgline," [Intervention-Required]" ); + } +if (sd->status[0 ] &SNS_STAT0_BUS_OUT_CHECK ) { +strcat (msgline," [Bus-Out-Parity-Check]" ); + }
Quoted 9 lines
pc-bios/s390-ccw/cio.c static bool irb_error(Irb *irb) · line 109
Quoted 5 lines
pc-bios/s390-ccw/cio.c +5
-0+if (sd->status[0 ] &SNS_STAT0_EQUIPMENT_CHECK ) { +strcat (msgline," [Equipment-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_DATA_CHECK ) { +strcat (msgline," [Data-Check]" );I'm wondering whether it would make sense to factor the common bits out. Might be overkill, though.
I'm not huge fan of this error code myself. It looks nice in output and may be useful for debugging which is why I decided to submit it. I did think about ways to make it look cleaner but didn't come up with anything great. I'd be open to suggestions, but I also think going too deep is overkill.
...
Quoted 11 lines
Maybe do
basic_sense+ print sense data only if there's actually a unit check?(Also, I'm not sure if you can even do a
basic_sensein case e.g. of unexpected busy.)Quoted 5 lines
pc-bios/s390-ccw/cio.c +2
-0+basic_sense (schid, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); rc =-1 ;break ; }
I've made a change that should address both issues. Preview:
if (cutype == CU_TYPE_DASD_3990 || cutype == CU_TYPE_UNKNOWN) {
if (!basic_sense(schid, cutype, &sd, sizeof(sd))) {
print_eckd_dasd_sense_data(&sd);
}
}Now we only print sense data if basic sense works. So if it fails because of a busy status (or any reason) we won't try to print.
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 11/16] s390-bios: cio error handling
Quoted 102 lines · On Thu, 7 Mar 2019 14:31:23 -0500 "Jason J. Herne" <[email protected]>…
Quoted 71 lines · Cornelia Huck
Quoted 68 lines · On Fri, 1 Mar 2019 13:59:31 -0500 "Jason J. Herne" <[email protected]>…
Add verbose error output for when unexpected i/o errors happen. This eases the burden of debugging and reporting i/o errors. No error information is printed in the success case, here is an example of what is output on error:
cio device error
ssid :0x0000000000000000
cssid :0x0000000000000000
sch_no:0x0000000000000000Interrupt Response Block Data:
Function Ctrl : [Start]
Activity Ctrl : [Start-Pending]
Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending] Device Status : [Unit-Check]
Channel Status :
cpa=:0x000000007f8d6038
prev_ccw=:0x0000000000000000
this_ccw=:0x0000000000000000
Eckd Dasd Sense Data (fmt 32-bytes):Sense Condition Flags : Residual Count =: 0x0000000000000000 Phys Drive ID =: 0x000000000000009e low cyl address =: 0x0000000000000000 head addr & hi cyl =: 0x0000000000000000 format/message =: 0x0000000000000008 fmt-dependent[0-7] =: 0x0000000000000004 fmt-dependent[8-15]=: 0xe561282305082fff prog action code =: 0x0000000000000016 Configuration info =: 0x00000000000040e0 mcode / hi-cyl =: 0x0000000000000000 cyl & head addr [0]=: 0x0000000000000000 cyl & head addr [1]=: 0x0000000000000000 cyl & head addr [2]=: 0x0000000000000000Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/libc.h | 11 +++ 2 files changed, 241 insertions(+)pc-bios/s390-ccw/cio.c +20
-0@@ -82,6 +82,228 @@ static bool irb_error(Irb *irb)return irb->scsw.dstat != (SCSW_DSTAT_DEVEND |SCSW_DSTAT_CHEND ); } +static void print_eckd_dasd_sense_data (SenseDataEckdDasd *sd) +{ +char msgline[512 ]; + +if (sd->config_info &0x8000 ) { +sclp_print ("Eckd Dasd Sense Data (fmt 24-bytes):\n" ); + }else { +sclp_print ("Eckd Dasd Sense Data (fmt 32-bytes):\n" ); + } + +strcat (msgline," Sense Condition Flags :" ); +if (sd->status[0 ] &SNS_STAT0_CMD_REJECT ) { +strcat (msgline," [Cmd-Reject]" ); + } +if (sd->status[0 ] &SNS_STAT0_INTERVENTION_REQ ) { +strcat (msgline," [Intervention-Required]" ); + } +if (sd->status[0 ] &SNS_STAT0_BUS_OUT_CHECK ) { +strcat (msgline," [Bus-Out-Parity-Check]" ); + }Quoted 9 lines
pc-bios/s390-ccw/cio.c static bool irb_error(Irb *irb) · line 109
Quoted 5 lines
pc-bios/s390-ccw/cio.c +5
-0+if (sd->status[0 ] &SNS_STAT0_EQUIPMENT_CHECK ) { +strcat (msgline," [Equipment-Check]" ); + } +if (sd->status[0 ] &SNS_STAT0_DATA_CHECK ) { +strcat (msgline," [Data-Check]" );I'm wondering whether it would make sense to factor the common bits out. Might be overkill, though.
I'm not huge fan of this error code myself. It looks nice in output and may be useful for debugging which is why I decided to submit it. I did think about ways to make it look cleaner but didn't come up with anything great. I'd be open to suggestions, but I also think going too deep is overkill.
...
Quoted 11 lines
Maybe do
basic_sense+ print sense data only if there's actually a unit check?(Also, I'm not sure if you can even do a
basic_sensein case e.g. of unexpected busy.)Quoted 5 lines
pc-bios/s390-ccw/cio.c +2
-0+basic_sense (schid, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); rc =-1 ;break ; }I've made a change that should address both issues. Preview:
Quoted 9 lines
if (cutype == CU_TYPE_DASD_3990 || cutype == CU_TYPE_UNKNOWN) { if (!basic_sense(schid, cutype, &sd, sizeof(sd))) { print_eckd_dasd_sense_data(&sd); } }Now we only print sense data if basic sense works. So if it fails because of a busy status (or any reason) we won't try to print.
Sounds good!
PATCH v3 12/16 s390-bios: Refactor virtio to run channel programs via cio
In reply to Jason J. HerneNow that we have a Channel I/O library let's modify virtio boot code to make use of it for running channel programs.
--- pc-bios/s390-ccw/virtio.c | 49 +++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 29 deletions(-)
pc-bios/s390-ccw/virtio.c +20 -29
@@ -14,6 +14,7 @@#include "virtio.h" #include "virtio-scsi.h" #include "bswap.h" +#include "helper.h" #define VRING_WAIT_REPLY_TIMEOUT 30
@@ -89,33 +90,20 @@ int drain_irqs(SubChannelId schid) } } -static int run_ccw (VDev *vdev,int cmd,void *ptr,int len) +static int run_ccw (VDev *vdev,int cmd,void *ptr,int len,bool sli) {Ccw1 ccw = {}; -CmdOrb orb = {}; -int r; - -enable_subchannel (vdev->schid); - -/* start subchannel command */ - orb.fmt =1 ; - orb.cpa = (u32)(long)&ccw; - orb.lpm =0x80 ; ccw.cmd_code = cmd; ccw.cda = (long )ptr; ccw.count = len; - r =ssch (vdev->schid, &orb); -/* -* XXX Wait until device is done processing the CCW. For now we can -* assume that a simple tsch will have finished the CCW processing, -* but the architecture allows for asynchronous operation -*/ -if (!r) { - r =drain_irqs (vdev->schid); +if (sli) { + ccw.flags |=CCW_FLAG_SLI ; } -return r; + +enable_subchannel (vdev->schid); +return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)
@@ -257,7 +245,7 @@ void virtio_setup_ccw(VDev *vdev) vdev->config.blk.blk_size =0 ;/* mark "illegal" - setup started... */ vdev->guessed_disk_nature =VIRTIO_GDN_NONE ; -run_ccw (vdev,CCW_CMD_VDEV_RESET ,NULL ,0 ); +run_ccw (vdev,CCW_CMD_VDEV_RESET ,NULL ,0 , false);switch (vdev->senseid.cu_model) {case VIRTIO_ID_NET :
@@ -278,18 +266,19 @@ void virtio_setup_ccw(VDev *vdev)default :panic ("Unsupported virtio device\n" ); } -IPL_assert (run_ccw (vdev,CCW_CMD_READ_CONF , &vdev->config, cfg_size) ==0 , -"Could not get block device configuration" ); +IPL_assert ( +run_ccw (vdev,CCW_CMD_READ_CONF , &vdev->config, cfg_size, false) ==0 , +"Could not get block device configuration" );/* Feature negotiation */ for (i =0 ; i <ARRAY_SIZE (vdev->guest_features); i++) { feats.features =0 ; feats.index = i; - rc =run_ccw (vdev,CCW_CMD_READ_FEAT , &feats,sizeof (feats)); + rc =run_ccw (vdev,CCW_CMD_READ_FEAT , &feats,sizeof (feats), false);IPL_assert (rc ==0 ,"Could not get features bits" ); vdev->guest_features[i] &=bswap32 (feats.features); feats.features =bswap32 (vdev->guest_features[i]); - rc =run_ccw (vdev,CCW_CMD_WRITE_FEAT , &feats,sizeof (feats)); + rc =run_ccw (vdev,CCW_CMD_WRITE_FEAT , &feats,sizeof (feats), false);IPL_assert (rc ==0 ,"Could not set features bits" ); }
@@ -306,16 +295,17 @@ void virtio_setup_ccw(VDev *vdev) };IPL_assert ( -run_ccw (vdev,CCW_CMD_READ_VQ_CONF , &config,sizeof (config)) ==0 , +run_ccw (vdev,CCW_CMD_READ_VQ_CONF , &config,sizeof (config), false) ==0 ,"Could not get block device VQ configuration" ); info.num = config.num;vring_init (&vdev->vrings[i], &info); vdev->vrings[i].schid = vdev->schid; -IPL_assert (run_ccw (vdev,CCW_CMD_SET_VQ , &info,sizeof (info)) ==0 , -"Cannot set VQ info" ); +IPL_assert ( +run_ccw (vdev,CCW_CMD_SET_VQ , &info,sizeof (info), false) ==0 , +"Cannot set VQ info" ); }IPL_assert ( -run_ccw (vdev,CCW_CMD_WRITE_STATUS , &status,sizeof (status)) ==0 , +run_ccw (vdev,CCW_CMD_WRITE_STATUS , &status,sizeof (status), false) ==0 ,"Could not write status to host" ); }
@@ -324,7 +314,8 @@ bool virtio_is_supported(SubChannelId schid) vdev.schid = schid;memset (&vdev.senseid,0 ,sizeof (vdev.senseid));/* run sense id command */ -if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid))) { +if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid), + true)) {return false; }if (vdev.senseid.cu_type ==0x3832 ) {
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 12/16] s390-bios: Refactor virtio to run channel programs via cio
Quoted 46 lines · On Fri, 1 Mar 2019 13:59:32 -0500 "Jason J. Herne" <[email protected]>…
Now that we have a Channel I/O library let's modify virtio boot code to make use of it for running channel programs.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/virtio.c | 49 +++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 29 deletions(-)pc-bios/s390-ccw/virtio.c +2
-14@@ -14,6 +14,7 @@#include "virtio.h" #include "virtio-scsi.h" #include "bswap.h" +#include "helper.h" #define VRING_WAIT_REPLY_TIMEOUT 30@@ -89,33 +90,20 @@ int drain_irqs(SubChannelId schid) } } -static int run_ccw (VDev *vdev,int cmd,void *ptr,int len) +static int run_ccw (VDev *vdev,int cmd,void *ptr,int len,bool sli) {Ccw1 ccw = {}; -CmdOrb orb = {}; -int r; - -enable_subchannel (vdev->schid); - -/* start subchannel command */ - orb.fmt =1 ; - orb.cpa = (u32)(long)&ccw; - orb.lpm =0x80 ; ccw.cmd_code = cmd; ccw.cda = (long )ptr; ccw.count = len; - r =ssch (vdev->schid, &orb); -/* -* XXX Wait until device is done processing the CCW. For now we can -* assume that a simple tsch will have finished the CCW processing,
pc-bios/s390-ccw/virtio.c int drain_irqs(SubChannelId schid) · line 105
Quoted 10 lines
pc-bios/s390-ccw/virtio.c +4
-5-* but the architecture allows for asynchronous operation -*/ -if (!r) { - r =drain_irqs (vdev->schid); +if (sli) { + ccw.flags |=CCW_FLAG_SLI ; } -return r; + +enable_subchannel (vdev->schid);
As said, maybe just move this to the main routine, instead of having to call this here again and again.
Quoted 4 lines
pc-bios/s390-ccw/virtio.c +1
-0+return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)
(...)
pc-bios/s390-ccw/virtio.c bool virtio_is_supported(SubChannelId schid) · line 321
Quoted 10 lines
pc-bios/s390-ccw/virtio.c +2
-1@@ -324,7 +314,8 @@ bool virtio_is_supported(SubChannelId schid) vdev.schid = schid;memset (&vdev.senseid,0 ,sizeof (vdev.senseid));/* run sense id command */ -if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid))) { +if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid), + true)) {return false; }if (vdev.senseid.cu_type ==0x3832 ) {
Can't you use the new routine for obtaining the cu type here?
Re: [Qemu-devel] [PATCH v3 12/16] s390-bios: Refactor virtio to run channel programs via cio
Quoted 54 lines · Cornelia Huck
Quoted 51 lines · On Fri, 1 Mar 2019 13:59:32 -0500 "Jason J. Herne" <[email protected]>…
Now that we have a Channel I/O library let's modify virtio boot code to make use of it for running channel programs.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/virtio.c | 49 +++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 29 deletions(-)pc-bios/s390-ccw/virtio.c +3
-18@@ -14,6 +14,7 @@#include "virtio.h" #include "virtio-scsi.h" #include "bswap.h" +#include "helper.h" #define VRING_WAIT_REPLY_TIMEOUT 30@@ -89,33 +90,20 @@ int drain_irqs(SubChannelId schid) } } -static int run_ccw (VDev *vdev,int cmd,void *ptr,int len) +static int run_ccw (VDev *vdev,int cmd,void *ptr,int len,bool sli) {Ccw1 ccw = {}; -CmdOrb orb = {}; -int r; - -enable_subchannel (vdev->schid); - -/* start subchannel command */ - orb.fmt =1 ; - orb.cpa = (u32)(long)&ccw; - orb.lpm =0x80 ; ccw.cmd_code = cmd; ccw.cda = (long )ptr; ccw.count = len; - r =ssch (vdev->schid, &orb); -/* -* XXX Wait until device is done processing the CCW. For now we can -* assume that a simple tsch will have finished the CCW processing, -* but the architecture allows for asynchronous operation -*/ -if (!r) { - r =drain_irqs (vdev->schid); +if (sli) {
Quoted 9 lines
pc-bios/s390-ccw/virtio.c int drain_irqs(SubChannelId schid) · line 105
Quoted 5 lines
pc-bios/s390-ccw/virtio.c +3
-1+ ccw.flags |=CCW_FLAG_SLI ; } -return r; + +enable_subchannel (vdev->schid);As said, maybe just move this to the main routine, instead of having to call this here again and again.
I can just remove this call all together, but because of the netboot case I'll need to add a call to enable_subchannel to virtio_is_supported() or find_net_dev().
netmain.c: main -> virtio_setup-> find_net_dev-> virtio_is_supported
Let me know if you like this idea or not. If you're okay with it, I'll queue it up for v4. IMHO, adding the call to find_net_dev makes more sense than virtio_is_supported.
Quoted 7 lines
Quoted 4 lines
pc-bios/s390-ccw/virtio.c +1
-0+return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)(...)
Quoted 13 lines
pc-bios/s390-ccw/virtio.c bool virtio_is_supported(SubChannelId schid) · line 321
Quoted 10 lines
pc-bios/s390-ccw/virtio.c +2
-1@@ -324,7 +314,8 @@ bool virtio_is_supported(SubChannelId schid) vdev.schid = schid;memset (&vdev.senseid,0 ,sizeof (vdev.senseid));/* run sense id command */ -if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid))) { +if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid), + true)) {return false; }if (vdev.senseid.cu_type ==0x3832 ) {Can't you use the new routine for obtaining the cu type here?
cu_type only returns the control unit type. This code goes on to look at the model number as well. In hind sight, I could have noticed this and simply structured my code to return the whole sense_id data structure. I'm not against making this change, but things seem pretty clean as they are. :)
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 12/16] s390-bios: Refactor virtio to run channel programs via cio
Quoted 65 lines · On Thu, 7 Mar 2019 10:09:46 -0500 "Jason J. Herne" <[email protected]>…
Quoted 54 lines · Cornelia Huck
Quoted 51 lines · On Fri, 1 Mar 2019 13:59:32 -0500 "Jason J. Herne" <[email protected]>…
Now that we have a Channel I/O library let's modify virtio boot code to make use of it for running channel programs.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/virtio.c | 49 +++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 29 deletions(-)pc-bios/s390-ccw/virtio.c +3
-18@@ -14,6 +14,7 @@#include "virtio.h" #include "virtio-scsi.h" #include "bswap.h" +#include "helper.h" #define VRING_WAIT_REPLY_TIMEOUT 30@@ -89,33 +90,20 @@ int drain_irqs(SubChannelId schid) } } -static int run_ccw (VDev *vdev,int cmd,void *ptr,int len) +static int run_ccw (VDev *vdev,int cmd,void *ptr,int len,bool sli) {Ccw1 ccw = {}; -CmdOrb orb = {}; -int r; - -enable_subchannel (vdev->schid); - -/* start subchannel command */ - orb.fmt =1 ; - orb.cpa = (u32)(long)&ccw; - orb.lpm =0x80 ; ccw.cmd_code = cmd; ccw.cda = (long )ptr; ccw.count = len; - r =ssch (vdev->schid, &orb); -/* -* XXX Wait until device is done processing the CCW. For now we can -* assume that a simple tsch will have finished the CCW processing, -* but the architecture allows for asynchronous operation -*/ -if (!r) { - r =drain_irqs (vdev->schid); +if (sli) {Quoted 9 lines
pc-bios/s390-ccw/virtio.c int drain_irqs(SubChannelId schid) · line 105
Quoted 5 lines
pc-bios/s390-ccw/virtio.c +3
-1+ ccw.flags |=CCW_FLAG_SLI ; } -return r; + +enable_subchannel (vdev->schid);As said, maybe just move this to the main routine, instead of having to call this here again and again.
Quoted 7 lines
I can just remove this call all together, but because of the netboot case I'll need to add a call to
enable_subchanneltovirtio_is_supported()orfind_net_dev().
netmain.c: main -> virtio_setup-> find_net_dev->virtio_is_supportedLet me know if you like this idea or not. If you're okay with it, I'll queue it up for v4. IMHO, adding the call to
find_net_devmakes more sense thanvirtio_is_supported.
I think adding the call to find_net_dev() would make sense.
Quoted 23 lines
Quoted 9 lines
Quoted 6 lines
pc-bios/s390-ccw/virtio.c +1
-0+return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)(...)
Quoted 13 lines
pc-bios/s390-ccw/virtio.c bool virtio_is_supported(SubChannelId schid) · line 321
Quoted 10 lines
pc-bios/s390-ccw/virtio.c +2
-1@@ -324,7 +314,8 @@ bool virtio_is_supported(SubChannelId schid) vdev.schid = schid;memset (&vdev.senseid,0 ,sizeof (vdev.senseid));/* run sense id command */ -if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid))) { +if (run_ccw (&vdev,CCW_CMD_SENSE_ID , &vdev.senseid,sizeof (vdev.senseid), + true)) {return false; }if (vdev.senseid.cu_type ==0x3832 ) {Can't you use the new routine for obtaining the cu type here?
Quoted 4 lines
cu_typeonly returns the control unit type. This code goes on to look at the model number as well. In hind sight, I could have noticed this and simply structured my code to return the wholesense_iddata structure. I'm not against making this change, but things seem pretty clean as they are. :)
I find having two different places that do SENSE_ID a bit odd :)
But no really strong opinion here; I'll happily leave the decision to the boot code maintainers.
PATCH v3 13/16 s390-bios: Use control unit type to determine boot method
In reply to Jason J. HerneThe boot method is different depending on which device type we are booting from. Let's examine the control unit type to determine if we're a virtio device. We'll eventually add a case to check for a real dasd device here as well.
Since we have to call enable_subchannel() in main now, might as well remove that call from virtio.c : run_ccw().
--- pc-bios/s390-ccw/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
pc-bios/s390-ccw/main.c +13 -2
@@ -198,13 +198,24 @@ static void virtio_setup(void)int main (void ) { +uint16_t cutype; +sclp_setup ();css_setup ();boot_setup ();find_boot_device (); +enable_subchannel (blk_schid); -virtio_setup (); -zipl_load ();/* no return */ + cutype =cu_type (blk_schid); +switch (cutype) { +case CU_TYPE_VIRTIO : +virtio_setup (); +zipl_load ();/* no return */ +break ; +default : +print_int ("Attempting to boot from unexpected device type" , cutype); +panic ("" ); + }panic ("Failed to load OS from hard disk\n" );return 0 ;/* make compiler happy */
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 13/16] s390-bios: Use control unit type to determine boot method
Quoted 7 lines · On Fri, 1 Mar 2019 13:59:33 -0500 "Jason J. Herne" <[email protected]>…
The boot method is different depending on which device type we are booting from. Let's examine the control unit type to determine if we're a virtio device. We'll eventually add a case to check for a real dasd device here as well.
Since we have to call
enable_subchannel()in main now, might as well remove that call fromvirtio.c:run_ccw().
Any reason you cannot add the enable_subchannel() in the previous patch? Then you never need to introduce it in run_ccw() :)
Quoted 37 lines
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)pc-bios/s390-ccw/main.c +13
-2@@ -198,13 +198,24 @@ static void virtio_setup(void)int main (void ) { +uint16_t cutype; +sclp_setup ();css_setup ();boot_setup ();find_boot_device (); +enable_subchannel (blk_schid); -virtio_setup (); -zipl_load ();/* no return */ + cutype =cu_type (blk_schid); +switch (cutype) { +case CU_TYPE_VIRTIO : +virtio_setup (); +zipl_load ();/* no return */ +break ; +default : +print_int ("Attempting to boot from unexpected device type" , cutype); +panic ("" ); + }panic ("Failed to load OS from hard disk\n" );return 0 ;/* make compiler happy */
Re: [Qemu-devel] [PATCH v3 13/16] s390-bios: Use control unit type to determine boot method
Quoted 8 lines · Cornelia Huck
Quoted 5 lines · On Fri, 1 Mar 2019 13:59:33 -0500 "Jason J. Herne" <[email protected]>…
The boot method is different depending on which device type we are booting from. Let's examine the control unit type to determine if we're a virtio device. We'll eventually add a case to check for a real dasd device here as well.
Quoted 6 lines
Quoted 2 lines
Since we have to call
enable_subchannel()in main now, might as well remove that call fromvirtio.c:run_ccw().Any reason you cannot add the
enable_subchannel()in the previous patch? Then you never need to introduce it inrun_ccw():)
Just for clarity, the enablement of the subchannel has always been done in run_ccw. I merely encapsulated the logic into a function in patch #7. I do end up removing it here in #13, but this will actually break the netboot case I pointed out in my previous reply. I agree that we can remove the call to enable_subchannel here if we add it to find_net_dev() but it is not a matter of never having introduced it in the first place.
Signature · 1 line
-- Jason J. Herne ([email protected])
PATCH v3 14/16 s390-bios: Add channel command codes/structs needed for dasd-ipl
In reply to Jason J. HerneThe dasd IPL procedure needs to execute a few previously unused channel commands. Let's define them and their associated data structures.
--- pc-bios/s390-ccw/cio.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
pc-bios/s390-ccw/cio.h +23 -0
@@ -200,11 +200,14 @@ typedef struct ccw1 {#define CCW_FLAG_IDA 0x04#define CCW_FLAG_SUSPEND 0x02 +/* Common CCW commands */ +#define CCW_CMD_READ_IPL 0x02#define CCW_CMD_NOOP 0x03#define CCW_CMD_BASIC_SENSE 0x04#define CCW_CMD_TIC 0x08#define CCW_CMD_SENSE_ID 0xe4 +/* Virtio CCW commands */ #define CCW_CMD_SET_VQ 0x13#define CCW_CMD_VDEV_RESET 0x33#define CCW_CMD_READ_FEAT 0x12
@@ -216,6 +219,12 @@ typedef struct ccw1 {#define CCW_CMD_SET_CONF_IND 0x53#define CCW_CMD_READ_VQ_CONF 0x32 +/* DASD CCW commands */ +#define CCW_CMD_DASD_READ 0x06 +#define CCW_CMD_DASD_SEEK 0x07 +#define CCW_CMD_DASD_SEARCH_ID_EQ 0x31 +#define CCW_CMD_DASD_READ_MT 0x86 +/* * Command-mode operation request block */
@@ -331,6 +340,20 @@ typedef struct irb {__u32 emw[8 ]; } __attribute__ ((packed, aligned(4))) Irb; +/* Used for SEEK ccw commands */ +typedef struct CcwSeekData { +uint16_t reserved; +uint16_t cyl; +uint16_t head; +} __attribute__((packed))CcwSeekData ; + +/* Used for SEARCH ID ccw commands */ +typedef struct CcwSearchIdData { +uint16_t cyl; +uint16_t head; +uint8_t record; +} __attribute__((packed))CcwSearchIdData ; +int enable_mss_facility (void );void enable_subchannel (SubChannelId schid);uint16_t cu_type (SubChannelId schid);
Signature · 1 line
2.7.4
PATCH v3 15/16 s390-bios: Support booting from real dasd device
In reply to Jason J. HerneAllows guest to boot from a vfio configured real dasd device.
--- MAINTAINERS | 1 + docs/devel/s390-dasd-ipl.txt | 133 +++++++++++++++++++++++ pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 249 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/dasd-ipl.h | 16 +++ pc-bios/s390-ccw/main.c | 4 + pc-bios/s390-ccw/s390-arch.h | 13 +++ 7 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 docs/devel/s390-dasd-ipl.txt create mode 100644 pc-bios/s390-ccw/dasd-ipl.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.h
MAINTAINERS +1 -0
@@ -1138,6 +1138,7 @@ S: Supported F: hw/s390x/ipl.* F: pc-bios/s390-ccw/ F: pc-bios/s390-ccw.img +F: docs/devel/s390-dasd-ipl.txt T: git https://github.com/borntraeger/qemu.git s390-next L: [email protected]
docs/devel/s390-dasd-ipl.txt new file +133 -0
133 lines not on this page · raw message
pc-bios/s390-ccw/Makefile +1 -1
@@ -10,7 +10,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) .PHONY : all clean build-all OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o + virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
pc-bios/s390-ccw/dasd-ipl.c new file +249 -0
249 lines not on this page · raw message
pc-bios/s390-ccw/dasd-ipl.h new file +16 -0
@@ -0,0 +1,16 @@ +/* +* S390 IPL (boot) from a real DASD device via vfio framework. +* +* Copyright (c) 2018 Jason J. Herne <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#ifndef DASD_IPL_H +#define DASD_IPL_H + +void dasd_ipl (SubChannelId schid); + +#endif /* DASD_IPL_H */
pc-bios/s390-ccw/main.c +4 -0
@@ -13,6 +13,7 @@#include "s390-ccw.h" #include "cio.h" #include "virtio.h" +#include "dasd-ipl.h" char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));static SubChannelId blk_schid = { .one =1 };
@@ -208,6 +209,9 @@ int main(void) cutype =cu_type (blk_schid);switch (cutype) { +case CU_TYPE_DASD_3990 : +dasd_ipl (blk_schid);/* no return */ +break ;case CU_TYPE_VIRTIO :virtio_setup ();zipl_load ();/* no return */
pc-bios/s390-ccw/s390-arch.h +13 -0
@@ -99,4 +99,17 @@ typedef struct LowCore {extern const LowCore *lowcore; +static inline void set_prefix (uint32_t address) +{ + asmvolatile ("spx %0" : :"m" (address) :"memory" ); +} + +static inline uint32_t store_prefix (void ) +{ +uint32_t address; + + asmvolatile ("stpx %0" :"=m" (address)); +return address; +} +#endif
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v3 15/16] s390-bios: Support booting from real dasd device
Quoted 23 lines · On Fri, 1 Mar 2019 13:59:35 -0500 "Jason J. Herne" <[email protected]>…
Allows guest to boot from a vfio configured real dasd device.
Signed-off-by Jason J. Herne <[email protected]>--- MAINTAINERS | 1 + docs/devel/s390-dasd-ipl.txt | 133 +++++++++++++++++++++++ pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 249 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/dasd-ipl.h | 16 +++ pc-bios/s390-ccw/main.c | 4 + pc-bios/s390-ccw/s390-arch.h | 13 +++ 7 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 docs/devel/s390-dasd-ipl.txt create mode 100644 pc-bios/s390-ccw/dasd-ipl.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.hpc-bios/s390-ccw/dasd-ipl.c new file +0
-0
pc-bios/s390-ccw/dasd-ipl.c line 4
Quoted 4 lines
pc-bios/s390-ccw/dasd-ipl.c new file +4
-0@@ -0,0 +1,249 @@ +/* +* S390 IPL (boot) from a real DASD device via vfio framework. +* +* Copyright (c) 2018 Jason J. Herne <[email protected]>
2019?
Quoted 5 lines
pc-bios/s390-ccw/dasd-ipl.c new file +5
-0+* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/
(...)
Quoted 2 lines
+/*
+ * Limitations in QEMU's CCW support complicate the IPL process. Details can
s/QEMU's CCW support/vfio-ccw/ ?
Quoted 33 lines
+ * be found in
docs/devel/s390-dasd-ipl.txt
+ */pc-bios/s390-ccw/dasd-ipl.c new file +25
-0+void dasd_ipl (SubChannelId schid) +{ +uint32_t ipl2_addr; + +/* Construct Read IPL CCW and run it to read IPL1 from boot disk */ +make_readipl (); +run_readipl (schid); + ipl2_addr =read_ipl2_addr (); +check_ipl1 (); + +/* +* Fixup IPL1 channel program to account for QEMU limitations, then run it +* to read IPL2 channel program from boot disk. +*/ +ipl1_fixup (); +run_ipl1 (schid); +check_ipl2 (ipl2_addr); + +/* +* Run IPL2 channel program to read operating system code from boot disk +* then transfer control to the guest operating system +*/ +run_ipl2 (schid, ipl2_addr); +lpsw (0 ); +}pc-bios/s390-ccw/dasd-ipl.h new file +0
-0
pc-bios/s390-ccw/dasd-ipl.h line 4
Quoted 4 lines
pc-bios/s390-ccw/dasd-ipl.h new file +4
-0@@ -0,0 +1,16 @@ +/* +* S390 IPL (boot) from a real DASD device via vfio framework. +* +* Copyright (c) 2018 Jason J. Herne <[email protected]>
2019?
pc-bios/s390-ccw/dasd-ipl.h line 16
Quoted 12 lines
pc-bios/s390-ccw/dasd-ipl.h new file +12
-0+* +* This work is licensed under the terms of the GNU GPL, version 2 or (at +* your option) any later version. See the COPYING file in the top-level +* directory. +*/ + +#ifndef DASD_IPL_H +#define DASD_IPL_H + +void dasd_ipl (SubChannelId schid); + +#endif /* DASD_IPL_H */
Otherwise, looks good to me.
PATCH v3 16/16 s390-bios: dasd-ipl: Use control unit type to customize error data
In reply to Jason J. HernePropagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
--- pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++-- pc-bios/s390-ccw/dasd-ipl.c | 25 +++++++++++++------------ pc-bios/s390-ccw/dasd-ipl.h | 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- 6 files changed, 30 insertions(+), 23 deletions(-)
pc-bios/s390-ccw/cio.c +10 -6
@@ -54,14 +54,15 @@ uint16_t cu_type(SubChannelId schid) sense_id_ccw.count =sizeof (sense_data); sense_id_ccw.flags |=CCW_FLAG_SLI ; -if (do_cio (schid,ptr2u32 (&sense_id_ccw),CCW_FMT1 )) { +if (do_cio (schid,CU_TYPE_UNKNOWN ,ptr2u32 (&sense_id_ccw),CCW_FMT1 )) {panic ("Failed to run SenseID CCw\n" ); }return sense_data.cu_type; } -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, +uint16_t data_size) {Ccw1 senseCcw;
@@ -69,7 +70,7 @@ void basic_sense(SubChannelId schid, void *sense_data, uint16_t data_size) senseCcw.cda =ptr2u32 (sense_data); senseCcw.count = data_size; -if (do_cio (schid,ptr2u32 (&senseCcw),CCW_FMT1 )) { +if (do_cio (schid, cutype,ptr2u32 (&senseCcw),CCW_FMT1 )) {panic ("Failed to run Basic Sense CCW\n" ); } }
@@ -364,7 +365,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb)* * Returns non-zero on error. */ -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt) {Irb irb = {};SenseDataEckdDasd sd;
@@ -402,10 +403,13 @@ int do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt)print_int (" ssid " , schid.ssid);print_int (" cssid " , schid.cssid);print_int (" sch_no" , schid.sch_no); +print_int (" ctrl-unit type" , cutype);sclp_print ("\n" );print_irb_err (&irb); -basic_sense (schid, &sd,sizeof (sd)); -print_eckd_dasd_sense_data (&sd); +if (cutype ==CU_TYPE_DASD_3990 || cutype ==CU_TYPE_UNKNOWN ) { +basic_sense (schid, cutype, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); + } rc =-1 ;break ; }
pc-bios/s390-ccw/cio.h +4 -2
@@ -256,6 +256,7 @@ struct ciw {__u16 count; }; +#define CU_TYPE_UNKNOWN 0x0000#define CU_TYPE_VIRTIO 0x3832#define CU_TYPE_DASD_3990 0x3990
@@ -357,8 +358,9 @@ typedef struct CcwSearchIdData {int enable_mss_facility (void );void enable_subchannel (SubChannelId schid);uint16_t cu_type (SubChannelId schid); -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size); -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt); +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, +uint16_t data_size); +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt);/* * Some S390 specific IO instructions as inline
pc-bios/s390-ccw/dasd-ipl.c +13 -12
@@ -72,7 +72,8 @@ static bool dynamic_cp_fixup(uint32_t ccw_addr, uint32_t *next_cpa)return false; } -static int run_dynamic_ccw_program (SubChannelId schid,uint32_t cpa) +static int run_dynamic_ccw_program (SubChannelId schid,uint16_t cutype, +uint32_t cpa) {bool has_next;uint32_t next_cpa =0 ;
@@ -83,7 +84,7 @@ static int run_dynamic_ccw_program(SubChannelId schid, uint32_t cpa)print_int ("executing ccw chain at " , cpa);enable_prefixing (); - rc =do_cio (schid, cpa,CCW_FMT0 ); + rc =do_cio (schid, cutype, cpa,CCW_FMT0 );disable_prefixing ();if (rc) {
@@ -106,9 +107,9 @@ static void make_readipl(void) ccwIplRead->count =0x18 ;/* Read 0x18 bytes of data */ } -static void run_readipl (SubChannelId schid) +static void run_readipl (SubChannelId schid,uint16_t cutype) { -if (do_cio (schid,0x00 ,CCW_FMT0 )) { +if (do_cio (schid, cutype,0x00 ,CCW_FMT0 )) {panic ("dasd-ipl: Failed to run Read IPL channel program" ); } }
@@ -183,19 +184,19 @@ static void ipl1_fixup(void) ccwSearchTic->cda =ptr2u32 (ccwSearchID); } -static void run_ipl1 (SubChannelId schid) +static void run_ipl1 (SubChannelId schid,uint16_t cutype) {uint32_t startAddr =0x08 ; -if (do_cio (schid, startAddr,CCW_FMT0 )) { +if (do_cio (schid, cutype, startAddr,CCW_FMT0 )) {panic ("dasd-ipl: Failed to run IPL1 channel program" ); } } -static void run_ipl2 (SubChannelId schid,uint32_t addr) +static void run_ipl2 (SubChannelId schid,uint16_t cutype,uint32_t addr) { -if (run_dynamic_ccw_program (schid, addr)) { +if (run_dynamic_ccw_program (schid, cutype, addr)) {panic ("dasd-ipl: Failed to run IPL2 channel program" ); } }
@@ -222,13 +223,13 @@ static void lpsw(void *psw_addr)* Limitations in QEMU's CCW support complicate the IPL process. Details can * be found in docs/devel/s390-dasd-ipl.txt */ -void dasd_ipl (SubChannelId schid) +void dasd_ipl (SubChannelId schid,uint16_t cutype) {uint32_t ipl2_addr;/* Construct Read IPL CCW and run it to read IPL1 from boot disk */ make_readipl (); -run_readipl (schid); +run_readipl (schid, cutype); ipl2_addr =read_ipl2_addr ();check_ipl1 ();
@@ -237,13 +238,13 @@ void dasd_ipl(SubChannelId schid)* to read IPL2 channel program from boot disk. */ ipl1_fixup (); -run_ipl1 (schid); +run_ipl1 (schid, cutype);check_ipl2 (ipl2_addr);/* * Run IPL2 channel program to read operating system code from boot disk * then transfer control to the guest operating system */ -run_ipl2 (schid, ipl2_addr); +run_ipl2 (schid, cutype, ipl2_addr);lpsw (0 ); }
pc-bios/s390-ccw/dasd-ipl.h +1 -1
@@ -11,6 +11,6 @@#ifndef DASD_IPL_H #define DASD_IPL_H -void dasd_ipl (SubChannelId schid); +void dasd_ipl (SubChannelId schid,uint16_t cutype);#endif /* DASD_IPL_H */
pc-bios/s390-ccw/main.c +1 -1
@@ -210,7 +210,7 @@ int main(void) cutype =cu_type (blk_schid);switch (cutype) {case CU_TYPE_DASD_3990 : -dasd_ipl (blk_schid);/* no return */ +dasd_ipl (blk_schid, cutype);/* no return */ break ;case CU_TYPE_VIRTIO :virtio_setup ();
pc-bios/s390-ccw/virtio.c +1 -1
@@ -103,7 +103,7 @@ static int run_ccw(VDev *vdev, int cmd, void *ptr, int len, bool sli) }enable_subchannel (vdev->schid); -return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); +return do_cio (vdev->schid, vdev->senseid.cu_type,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)
Signature · 1 line
2.7.4
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data
Quoted 55 lines · Jason J. Herne
Propagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++-- pc-bios/s390-ccw/dasd-ipl.c | 25 +++++++++++++------------ pc-bios/s390-ccw/dasd-ipl.h | 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- 6 files changed, 30 insertions(+), 23 deletions(-)pc-bios/s390-ccw/cio.c +4
-3@@ -54,14 +54,15 @@ uint16_t cu_type(SubChannelId schid) sense_id_ccw.count =sizeof (sense_data); sense_id_ccw.flags |=CCW_FLAG_SLI ; -if (do_cio (schid,ptr2u32 (&sense_id_ccw),CCW_FMT1 )) { +if (do_cio (schid,CU_TYPE_UNKNOWN ,ptr2u32 (&sense_id_ccw),CCW_FMT1 )) {panic ("Failed to run SenseID CCw\n" ); }return sense_data.cu_type; } -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, +uint16_t data_size) {Ccw1 senseCcw;@@ -69,7 +70,7 @@ void basic_sense(SubChannelId schid, void *sense_data, uint16_t data_size) senseCcw.cda =ptr2u32 (sense_data); senseCcw.count = data_size; -if (do_cio (schid,ptr2u32 (&senseCcw),CCW_FMT1 )) { +if (do_cio (schid, cutype,ptr2u32 (&senseCcw),CCW_FMT1 )) {panic ("Failed to run Basic Sense CCW\n" ); } }
pc-bios/s390-ccw/cio.c static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb) · line 371
Quoted 8 lines
pc-bios/s390-ccw/cio.c +1
-1@@ -364,7 +365,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb)* * Returns non-zero on error. */ -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt) {Irb irb = {};SenseDataEckdDasd sd;
Missed this one? :)
pc-bios/s390-ccw/cio.c +0 -0
@@ -393,7 +393,7 @@ int do_cio(SubChannelId schid, uint16_t cutype, uint32_t ccw_addr, int fmt)*/ if ((unit_check(&irb) || iface_ctrl_check(&irb)) && retries <=
2) {
if (unit_check(&irb)) {
- basic_sense(schid, &sd, sizeof(sd));
+ basic_sense(schid, cutype, &sd, sizeof(sd));
}
retries++;
continue;Quoted 170 lines
pc-bios/s390-ccw/cio.c +5
-2@@ -402,10 +403,13 @@ int do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt)print_int (" ssid " , schid.ssid);print_int (" cssid " , schid.cssid);print_int (" sch_no" , schid.sch_no); +print_int (" ctrl-unit type" , cutype);sclp_print ("\n" );print_irb_err (&irb); -basic_sense (schid, &sd,sizeof (sd)); -print_eckd_dasd_sense_data (&sd); +if (cutype ==CU_TYPE_DASD_3990 || cutype ==CU_TYPE_UNKNOWN ) { +basic_sense (schid, cutype, &sd,sizeof (sd)); +print_eckd_dasd_sense_data (&sd); + } rc =-1 ;break ; }pc-bios/s390-ccw/cio.h +4
-2@@ -256,6 +256,7 @@ struct ciw {__u16 count; }; +#define CU_TYPE_UNKNOWN 0x0000#define CU_TYPE_VIRTIO 0x3832#define CU_TYPE_DASD_3990 0x3990@@ -357,8 +358,9 @@ typedef struct CcwSearchIdData {int enable_mss_facility (void );void enable_subchannel (SubChannelId schid);uint16_t cu_type (SubChannelId schid); -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size); -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt); +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, +uint16_t data_size); +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt);/* * Some S390 specific IO instructions as inline pc-bios/s390-ccw/dasd-ipl.c +13
-12@@ -72,7 +72,8 @@ static bool dynamic_cp_fixup(uint32_t ccw_addr, uint32_t *next_cpa)return false; } -static int run_dynamic_ccw_program (SubChannelId schid,uint32_t cpa) +static int run_dynamic_ccw_program (SubChannelId schid,uint16_t cutype, +uint32_t cpa) {bool has_next;uint32_t next_cpa =0 ;@@ -83,7 +84,7 @@ static int run_dynamic_ccw_program(SubChannelId schid, uint32_t cpa)print_int ("executing ccw chain at " , cpa);enable_prefixing (); - rc =do_cio (schid, cpa,CCW_FMT0 ); + rc =do_cio (schid, cutype, cpa,CCW_FMT0 );disable_prefixing ();if (rc) {@@ -106,9 +107,9 @@ static void make_readipl(void) ccwIplRead->count =0x18 ;/* Read 0x18 bytes of data */ } -static void run_readipl (SubChannelId schid) +static void run_readipl (SubChannelId schid,uint16_t cutype) { -if (do_cio (schid,0x00 ,CCW_FMT0 )) { +if (do_cio (schid, cutype,0x00 ,CCW_FMT0 )) {panic ("dasd-ipl: Failed to run Read IPL channel program" ); } }@@ -183,19 +184,19 @@ static void ipl1_fixup(void) ccwSearchTic->cda =ptr2u32 (ccwSearchID); } -static void run_ipl1 (SubChannelId schid) +static void run_ipl1 (SubChannelId schid,uint16_t cutype) {uint32_t startAddr =0x08 ; -if (do_cio (schid, startAddr,CCW_FMT0 )) { +if (do_cio (schid, cutype, startAddr,CCW_FMT0 )) {panic ("dasd-ipl: Failed to run IPL1 channel program" ); } } -static void run_ipl2 (SubChannelId schid,uint32_t addr) +static void run_ipl2 (SubChannelId schid,uint16_t cutype,uint32_t addr) { -if (run_dynamic_ccw_program (schid, addr)) { +if (run_dynamic_ccw_program (schid, cutype, addr)) {panic ("dasd-ipl: Failed to run IPL2 channel program" ); } }@@ -222,13 +223,13 @@ static void lpsw(void *psw_addr)* Limitations in QEMU's CCW support complicate the IPL process. Details can * be found in docs/devel/s390-dasd-ipl.txt */ -void dasd_ipl (SubChannelId schid) +void dasd_ipl (SubChannelId schid,uint16_t cutype) {uint32_t ipl2_addr;/* Construct Read IPL CCW and run it to read IPL1 from boot disk */ make_readipl (); -run_readipl (schid); +run_readipl (schid, cutype); ipl2_addr =read_ipl2_addr ();check_ipl1 ();@@ -237,13 +238,13 @@ void dasd_ipl(SubChannelId schid)* to read IPL2 channel program from boot disk. */ ipl1_fixup (); -run_ipl1 (schid); +run_ipl1 (schid, cutype);check_ipl2 (ipl2_addr);/* * Run IPL2 channel program to read operating system code from boot disk * then transfer control to the guest operating system */ -run_ipl2 (schid, ipl2_addr); +run_ipl2 (schid, cutype, ipl2_addr);lpsw (0 ); }pc-bios/s390-ccw/dasd-ipl.h +1
-1@@ -11,6 +11,6 @@#ifndef DASD_IPL_H #define DASD_IPL_H -void dasd_ipl (SubChannelId schid); +void dasd_ipl (SubChannelId schid,uint16_t cutype);#endif /* DASD_IPL_H */ pc-bios/s390-ccw/main.c +1
-1@@ -210,7 +210,7 @@ int main(void) cutype =cu_type (blk_schid);switch (cutype) {case CU_TYPE_DASD_3990 : -dasd_ipl (blk_schid);/* no return */ +dasd_ipl (blk_schid, cutype);/* no return */ break ;case CU_TYPE_VIRTIO :virtio_setup ();pc-bios/s390-ccw/virtio.c +1
-1@@ -103,7 +103,7 @@ static int run_ccw(VDev *vdev, int cmd, void *ptr, int len, bool sli) }enable_subchannel (vdev->schid); -return do_cio (vdev->schid,ptr2u32 (&ccw),CCW_FMT1 ); +return do_cio (vdev->schid, vdev->senseid.cu_type,ptr2u32 (&ccw),CCW_FMT1 ); }static void vring_init (VRing *vr,VqInfo *info)
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data
Quoted 57 lines · Eric Farman
Quoted 54 lines · Jason J. Herne
Propagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
Signed-off-by Jason J. Herne <[email protected]>---
pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++--pc-bios/s390-ccw/dasd-ipl.c| 25 +++++++++++++------------pc-bios/s390-ccw/dasd-ipl.h| 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +-6 files changed, 30 insertions(+), 23 deletions(-)pc-bios/s390-ccw/cio.c +4
-3@@ -54,14 +54,15 @@ uint16_t cu_type(SubChannelId schid) sense_id_ccw.count = sizeof(sense_data); sense_id_ccw.flags |= CCW_FLAG_SLI; - if (do_cio(schid, ptr2u32(&sense_id_ccw), CCW_FMT1)) { + if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { panic("Failed to run SenseID CCw\n"); } return sense_data.cu_type; } -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, + uint16_t data_size) { Ccw1 senseCcw;@@ -69,7 +70,7 @@ void basic_sense(SubChannelId schid, void *sense_data, uint16_t data_size) senseCcw.cda = ptr2u32(sense_data); senseCcw.count = data_size; - if (do_cio(schid, ptr2u32(&senseCcw), CCW_FMT1)) { + if (do_cio(schid, cutype, ptr2u32(&senseCcw), CCW_FMT1)) { panic("Failed to run Basic Sense CCW\n"); } }@@ -364,7 +365,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb) * * Returns non-zero on error.
Quoted 9 lines
Quoted 6 lines
pc-bios/s390-ccw/cio.c +1
-1*/ -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt) { Irb irb = {};SenseDataEckdDasd sd;
Missed this one? :)
This field is used in two places. 1) For an ECKD Dasd only path. 2) In an error recovery path where we need to issue a basic sense to clear status but we never examine the data. So I guess having the struct named "SenseDataEckdDasd" and using it in a potentially generic path *might* be slightly misleading, it seems superior to allocating a new chunk of memory we'll never use. I assume this is the issue you are hinting at?
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [qemu-s390x] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data
Quoted 70 lines · Jason J. Herne
Quoted 60 lines · Eric Farman
Quoted 57 lines · Jason J. Herne
Propagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
Signed-off-by Jason J. Herne <[email protected]>---
pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++--pc-bios/s390-ccw/dasd-ipl.c| 25 +++++++++++++------------pc-bios/s390-ccw/dasd-ipl.h| 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +-6 files changed, 30 insertions(+), 23 deletions(-)pc-bios/s390-ccw/cio.c +4
-3@@ -54,14 +54,15 @@ uint16_t cu_type(SubChannelId schid) sense_id_ccw.count = sizeof(sense_data); sense_id_ccw.flags |= CCW_FLAG_SLI; - if (do_cio(schid, ptr2u32(&sense_id_ccw), CCW_FMT1)) { + if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw),CCW_FMT1 )) { panic("Failed to run SenseID CCw\n"); } return sense_data.cu_type; } -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, + uint16_t data_size) { Ccw1 senseCcw;@@ -69,7 +70,7 @@ void basic_sense(SubChannelId schid, void *sense_data, uint16_t data_size) senseCcw.cda = ptr2u32(sense_data); senseCcw.count = data_size; - if (do_cio(schid, ptr2u32(&senseCcw), CCW_FMT1)) { + if (do_cio(schid, cutype, ptr2u32(&senseCcw), CCW_FMT1)) { panic("Failed to run Basic Sense CCW\n"); } }@@ -364,7 +365,7 @@ static int __do_cio(SubChannelId schid, uint32_tccw_addr, int fmt, Irb *irb) * * Returns non-zero on error. */ Quoted 9 lines
Quoted 6 lines
pc-bios/s390-ccw/cio.c +1
-1-int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt) {Irb irb = {};
SenseDataEckdDasd sd;Missed this one? :)
Quoted 2 lines
This field is used in two places. 1) For an ECKD Dasd only path. 2) In an error recovery path where we need to issue a basic sense to clear status but we never examine the data. So I guess having the struct named "SenseDataEckdDasd" and using it in a potentially generic path *might* be slightly misleading, it seems superior to allocating a new chunk of memory we'll never use. I assume this is the issue you are hinting at?
Nope... I guess my git hunk got cut off... I get a compile error for the basic_sense() call with only three parameters in this function. (if (unit_check(&irb)) ...
pc-bios/s390-ccw/cio.c +0 -0
@@ -393,7 +393,7 @@ int do_cio(SubChannelId schid, uint16_t cutype, uint32_t ccw_addr, int fmt)*/ if ((unit_check(&irb) || iface_ctrl_check(&irb)) && retries <=
2) {
if (unit_check(&irb)) {
- basic_sense(schid, &sd, sizeof(sd));
+ basic_sense(schid, cutype, &sd, sizeof(sd));
}
retries++;
continue;Re: [Qemu-devel] [qemu-s390x] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data
Quoted 70 lines · Eric Farman
Quoted 67 lines · Jason J. Herne
Quoted 66 lines · Eric Farman
Quoted 59 lines · Jason J. Herne
Propagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
Signed-off-by Jason J. Herne <[email protected]>---
pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++--pc-bios/s390-ccw/dasd-ipl.c| 25 +++++++++++++------------pc-bios/s390-ccw/dasd-ipl.h| 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +-6 files changed, 30 insertions(+), 23 deletions(-)pc-bios/s390-ccw/cio.c +5
-4@@ -54,14 +54,15 @@ uint16_t cu_type(SubChannelId schid) sense_id_ccw.count = sizeof(sense_data); sense_id_ccw.flags |= CCW_FLAG_SLI; - if (do_cio(schid, ptr2u32(&sense_id_ccw), CCW_FMT1)) { + if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { panic("Failed to run SenseID CCw\n"); } return sense_data.cu_type; } -void basic_sense (SubChannelId schid,void *sense_data,uint16_t data_size) +void basic_sense (SubChannelId schid,uint16_t cutype,void *sense_data, + uint16_t data_size) { Ccw1 senseCcw;@@ -69,7 +70,7 @@ void basic_sense(SubChannelId schid, void *sense_data, uint16_t data_size) senseCcw.cda = ptr2u32(sense_data); senseCcw.count = data_size; - if (do_cio(schid, ptr2u32(&senseCcw), CCW_FMT1)) { + if (do_cio(schid, cutype, ptr2u32(&senseCcw), CCW_FMT1)) { panic("Failed to run Basic Sense CCW\n"); } }@@ -364,7 +365,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, intfmt, Irb *irb) * * Returns non-zero on error. */ -int do_cio (SubChannelId schid,uint32_t ccw_addr,int fmt) +int do_cio (SubChannelId schid,uint16_t cutype,uint32_t ccw_addr,int fmt) { Irb irb = {};Quoted 1 line
SenseDataEckdDasd sd;
Missed this one? :)
Quoted 5 lines
Quoted 2 lines
This field is used in two places. 1) For an ECKD Dasd only path. 2) In an error recovery path where we need to issue a basic sense to clear status but we never examine the data. So I guess having the struct named "SenseDataEckdDasd" and using it in a potentially generic path *might* be slightly misleading, it seems superior to allocating a new chunk of memory we'll never use. I assume this is the issue you are hinting at?
Nope... I guess my git hunk got cut off... I get a compile error for the
basic_sense()call with only three parameters in this function. (if (unit_check(&irb)) ...
Ahh, yep! Found and fixed :) Thanks.
Signature · 1 line
-- Jason J. Herne ([email protected])
Re: [Qemu-devel] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data
In reply to Jason J. HerneQuoted 6 lines · On Fri, 1 Mar 2019 13:59:36 -0500 "Jason J. Herne" <[email protected]>…
Propagate control unit type from main through the dasd ipl call chain. The control unit type can be used to determine if we are attempting to boot from a real dasd device. If something goes wrong we'll want to print detailed dasd sense data (for diagnostic use) but only if we're attempting to boot from a real dasd device.
Quoted 6 lines
Note: We also query and print the dasd sense data if we fail while attempting to determine the control unit type. In this case, we don't know if we're dealing with a real dasd device yet, but if we are, then the sense data may be useful for figuring out what went wrong. Since determining the control unit type is the very first thing we do with any real dasd device, this is our most likely point of failure.
Yeah, it probably does not hurt to print it out, even if it isn't correct. If there's a non-dasd specific error, it's likely in the first sense byte anyway.
Quoted 10 lines
Signed-off-by Jason J. Herne <[email protected]>--- pc-bios/s390-ccw/cio.c | 16 ++++++++++------ pc-bios/s390-ccw/cio.h | 6 ++++-- pc-bios/s390-ccw/dasd-ipl.c | 25 +++++++++++++------------ pc-bios/s390-ccw/dasd-ipl.h | 2 +- pc-bios/s390-ccw/main.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- 6 files changed, 30 insertions(+), 23 deletions(-)
I think it would make sense to squash this into the patches you mentioned in the cover letter in the next version.
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'2b789b1c10 s390-bios: dasd-ipl: Use control unit type to customize error data f91457aeef s390-bios: Support booting from real dasd device 3071ef3fd7 s390-bios: Add channel command codes/structs needed for dasd-ipl bd9ebd495d s390-bios: Use control unit type to determine boot method 72c5351cf3 s390-bios: Refactor virtio to run channel programs via cio 48463c91d1 s390-bios: cio error handling5a6410ee3c s390-bios: Support for running format-0/1 channel programs 87b21a627b s390-bios: ptr2u32 and u32toptr6b4c168d0b s390-bios: Map low core memory
1579052645 s390-bios: Decouple channel i/o logic from virtio 6ed6d43be1 s390-bios: Clean up cio.h49cafd73b0 s390-bios: Factor finding boot device out of virtio code path 9bcc2ca566 s390-bios: Extend find_dev() for non-virtio devices 9baff8187e s390-bios: decouple common boot logic from virtio 8ea363fa83 s390-bios: decouple cio setup from virtio8ddaab89e7 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 8ddaab89e767 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 8ea363fa8353 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 9baff8187ec5 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 9bcc2ca566bc (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 49cafd73b044 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 6ed6d43be161 (s390-bios: Clean up cio.h)
7/16 Checking commit 1579052645a0 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 6b4c168d0bba (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 87b21a627bda (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 5a6410ee3ce0 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 48463c91d1ab (s390-bios: cio error handling)
12/16 Checking commit 72c5351cf34d (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit bd9ebd495d0b (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 3071ef3fd73d (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit f91457aeef9b (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 2b789b1c108a (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'0a9e3c7c9c s390-bios: dasd-ipl: Use control unit type to customize error data 7ef97319b7 s390-bios: Support booting from real dasd device ba2ef41e10 s390-bios: Add channel command codes/structs needed for dasd-ipl 33263b448e s390-bios: Use control unit type to determine boot method 24fc2d1e7d s390-bios: Refactor virtio to run channel programs via cio b1dca5b66a s390-bios: cio error handling5a87891a44 s390-bios: Support for running format-0/1 channel programs c1e4f88640 s390-bios: ptr2u32 and u32toptr2cc70e81c6 s390-bios: Map low core memory62a450c7a8 s390-bios: Decouple channel i/o logic from virtio d907f80f02 s390-bios: Clean up cio.h0dda9ad2ae s390-bios: Factor finding boot device out of virtio code path d91d27f0bf s390-bios: Extend find_dev() for non-virtio devices 8d085339e8 s390-bios: decouple common boot logic from virtio f698064311 s390-bios: decouple cio setup from virtio7a8011e385 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 7a8011e38589 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit f6980643114b (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 8d085339e8d1 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit d91d27f0bf15 (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 0dda9ad2aee5 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit d907f80f026e (s390-bios: Clean up cio.h)
7/16 Checking commit 62a450c7a85d (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 2cc70e81c6ae (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit c1e4f886404f (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 5a87891a44c6 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit b1dca5b66a3e (s390-bios: cio error handling)
12/16 Checking commit 24fc2d1e7d93 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 33263b448e9e (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit ba2ef41e1004 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 7ef97319b7d1 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 0a9e3c7c9c20 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'9b84ebcc24 s390-bios: dasd-ipl: Use control unit type to customize error data c9372490a1 s390-bios: Support booting from real dasd device 47171b2cdd s390-bios: Add channel command codes/structs needed for dasd-ipl 6f2050908e s390-bios: Use control unit type to determine boot method 0f97bb921e s390-bios: Refactor virtio to run channel programs via cio d2c9f6cce7 s390-bios: cio error handlingf298cecd8f s390-bios: Support for running format-0/1 channel programs dfdc554721 s390-bios: ptr2u32 and u32toptr1b096b1bf8 s390-bios: Map low core memory3be0b00270 s390-bios: Decouple channel i/o logic from virtio e6032c6187 s390-bios: Clean up cio.h12d9848de1 s390-bios: Factor finding boot device out of virtio code path db71bdf357 s390-bios: Extend find_dev() for non-virtio devices 80c8b669bd s390-bios: decouple common boot logic from virtio cdd504e999 s390-bios: decouple cio setup from virtiobc57bb5989 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit bc57bb598935 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit cdd504e99929 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 80c8b669bd0a (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit db71bdf3578b (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 12d9848de1f4 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit e6032c61879f (s390-bios: Clean up cio.h)
7/16 Checking commit 3be0b0027017 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 1b096b1bf8e3 (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit dfdc55472161 (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit f298cecd8f83 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit d2c9f6cce7ce (s390-bios: cio error handling)
12/16 Checking commit 0f97bb921e27 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 6f2050908e93 (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 47171b2cddcf (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit c9372490a158 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 9b84ebcc2486 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'f500a324be s390-bios: dasd-ipl: Use control unit type to customize error data 61683f31fd s390-bios: Support booting from real dasd device 59e5199d22 s390-bios: Add channel command codes/structs needed for dasd-ipl 9add6dde7e s390-bios: Use control unit type to determine boot method 45b1810ae5 s390-bios: Refactor virtio to run channel programs via cio f7fff67468 s390-bios: cio error handling88f0121304 s390-bios: Support for running format-0/1 channel programs c689028ed0 s390-bios: ptr2u32 and u32toptr6753adcac4 s390-bios: Map low core memory13ab2fb569 s390-bios: Decouple channel i/o logic from virtio 634aaae0e9 s390-bios: Clean up cio.h983db7d6f6 s390-bios: Factor finding boot device out of virtio code path 37c8283d8b s390-bios: Extend find_dev() for non-virtio devices 986462d0c6 s390-bios: decouple common boot logic from virtio 6eecc37451 s390-bios: decouple cio setup from virtiobab9fd0907 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit bab9fd090720 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 6eecc3745137 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 986462d0c69c (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 37c8283d8bde (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 983db7d6f6e6 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 634aaae0e93d (s390-bios: Clean up cio.h)
7/16 Checking commit 13ab2fb56962 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 6753adcac48a (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit c689028ed00a (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 88f012130413 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit f7fff67468f5 (s390-bios: cio error handling)
12/16 Checking commit 45b1810ae5c8 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 9add6dde7e5b (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 59e5199d2251 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 61683f31fd6f (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit f500a324bed9 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'30a1fa38c4 s390-bios: dasd-ipl: Use control unit type to customize error data 2989c319fd s390-bios: Support booting from real dasd device b2085c405e s390-bios: Add channel command codes/structs needed for dasd-ipl f322225324 s390-bios: Use control unit type to determine boot method c6f03bc84f s390-bios: Refactor virtio to run channel programs via cio 65864585c0 s390-bios: cio error handling097bccecd0 s390-bios: Support for running format-0/1 channel programs c8b8481de0 s390-bios: ptr2u32 and u32toptr2b710b5d43 s390-bios: Map low core memory16d1882b5f s390-bios: Decouple channel i/o logic from virtio 7a28a2573e s390-bios: Clean up cio.hb18ab082b0 s390-bios: Factor finding boot device out of virtio code path 67e5e992d6 s390-bios: Extend find_dev() for non-virtio devices 5f215da4ce s390-bios: decouple common boot logic from virtio b76737ee14 s390-bios: decouple cio setup from virtioe2d6b7499a s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit e2d6b7499af4 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit b76737ee14b7 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 5f215da4ce76 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 67e5e992d625 (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit b18ab082b084 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 7a28a2573eba (s390-bios: Clean up cio.h)
7/16 Checking commit 16d1882b5f7d (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 2b710b5d436c (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit c8b8481de0ac (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 097bccecd0e1 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 65864585c097 (s390-bios: cio error handling)
12/16 Checking commit c6f03bc84fcb (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit f32222532490 (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit b2085c405e83 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 2989c319fd28 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 30a1fa38c42e (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'73739b0cc6 s390-bios: dasd-ipl: Use control unit type to customize error data 8733330492 s390-bios: Support booting from real dasd device 5a5c4b01ef s390-bios: Add channel command codes/structs needed for dasd-ipl d23ff47a3d s390-bios: Use control unit type to determine boot method 2af24581b4 s390-bios: Refactor virtio to run channel programs via cio 631002c644 s390-bios: cio error handling44d5259870 s390-bios: Support for running format-0/1 channel programs 7244df5a79 s390-bios: ptr2u32 and u32toptraf222f5618 s390-bios: Map low core memory281f64b37a s390-bios: Decouple channel i/o logic from virtio 4ac96c2c10 s390-bios: Clean up cio.h06ea714695 s390-bios: Factor finding boot device out of virtio code path a99947c33d s390-bios: Extend find_dev() for non-virtio devices 9b82cabb3b s390-bios: decouple common boot logic from virtio 2e4c88a8ae s390-bios: decouple cio setup from virtio648c3648c7 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 648c3648c73b (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 2e4c88a8ae84 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 9b82cabb3b40 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit a99947c33d4a (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 06ea71469510 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 4ac96c2c105e (s390-bios: Clean up cio.h)
7/16 Checking commit 281f64b37a69 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit af222f561810 (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 7244df5a79fa (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 44d52598706f (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 631002c64417 (s390-bios: cio error handling)
12/16 Checking commit 2af24581b441 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit d23ff47a3d3c (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 5a5c4b01efbc (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 8733330492f4 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 73739b0cc6e1 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Quoted 8 lines · On Fri, 1 Mar 2019 13:59:20 -0500 "Jason J. Herne" <[email protected]>…
This is to support booting from vfio-ccw dasd devices. We basically implement the real hardware ipl procedure. This allows for booting Linux guests on vfio-ccw devices.
vfio-ccw's channel program prefetch algorithm complicates ipl because most ipl channel programs dynamically modify themselves. Details on the ipl process and how we worked around this issue can be found in
docs/devel/s390-dasd-ipl.txt.
Quoted 5 lines
Note to Connie: In the v2 review you mentioned some issues with the error handling code involving printing of the eckd dasd sense data. I've addressed those concerns in a new patch just to make those changes clearly stand out from the rest of the code. I can squash them into patches 10, 11, and 15 if you prefer that to having it as a separate patch.
Whatever makes sense... but I'll let the s390 bios maintainers decide.
Speaking of which: Please do keep Thomas on cc:...
[This is probably a bit late for 4.0, as softfreeze is next Tuesday and pull requests for master need to be on-list by then... speaking of pull
requests: I'd prefer to queue this via a pull request from the bios maintainers rather than picking the patches myself, if possible.]
Quoted 11 lines · Cornelia Huck
Quoted 8 lines · On Fri, 1 Mar 2019 13:59:20 -0500 "Jason J. Herne" <[email protected]>…
This is to support booting from vfio-ccw dasd devices. We basically implement the real hardware ipl procedure. This allows for booting Linux guests on vfio-ccw devices.
vfio-ccw's channel program prefetch algorithm complicates ipl because most ipl channel programs dynamically modify themselves. Details on the ipl process and how we worked around this issue can be found in
docs/devel/s390-dasd-ipl.txt.
Quoted 7 lines
Quoted 5 lines
Note to Connie: In the v2 review you mentioned some issues with the error handling code involving printing of the eckd dasd sense data. I've addressed those concerns in a new patch just to make those changes clearly stand out from the rest of the code. I can squash them into patches 10, 11, and 15 if you prefer that to having it as a separate patch.
Whatever makes sense... but I'll let the s390 bios maintainers decide.
Both variants are fine with me.
Quoted 7 lines
Speaking of which: Please do keep Thomas on cc:...
[This is probably a bit late for 4.0, as softfreeze is next Tuesday and pull requests for master need to be on-list by then... speaking of pull
requests: I'd prefer to queue this via a pull request from the bios maintainers rather than picking the patches myself, if possible.]
there are still some minor discussions on the patch set, but I (or Thomas) can certainly pick up the next version and send a pull request. Thomas do you want to do it or shall I take care about it?
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'a5193e6d29 s390-bios: dasd-ipl: Use control unit type to customize error data ad12cecc19 s390-bios: Support booting from real dasd device 9c01c8fb4e s390-bios: Add channel command codes/structs needed for dasd-ipl fa18355faa s390-bios: Use control unit type to determine boot method aeee35ab15 s390-bios: Refactor virtio to run channel programs via cio d78017247a s390-bios: cio error handling585ae5fd4b s390-bios: Support for running format-0/1 channel programs 87ce30846b s390-bios: ptr2u32 and u32toptrdafea5d56b s390-bios: Map low core memory3b4a91b886 s390-bios: Decouple channel i/o logic from virtio 0ffabfab9e s390-bios: Clean up cio.h95328bb6bc s390-bios: Factor finding boot device out of virtio code path 387a9d2875 s390-bios: Extend find_dev() for non-virtio devices e2bcf15817 s390-bios: decouple common boot logic from virtio 9402b93fa5 s390-bios: decouple cio setup from virtio3167d5b7cb s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 3167d5b7cbdb (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 9402b93fa53a (s390-bios: decouple cio setup from virtio) 3/16 Checking commit e2bcf15817d2 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 387a9d287506 (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 95328bb6bcf7 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 0ffabfab9e57 (s390-bios: Clean up cio.h)
7/16 Checking commit 3b4a91b88650 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit dafea5d56b0a (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #35:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 87ce30846b71 (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 585ae5fd4b46 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit d78017247ac4 (s390-bios: cio error handling)
12/16 Checking commit aeee35ab152a (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit fa18355faaab (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 9c01c8fb4e3a (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit ad12cecc1953 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit a5193e6d297b (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
88687719c8..b6179aaff9 master -> master
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'1255bffda9 s390-bios: dasd-ipl: Use control unit type to customize error data c5cbb3e0e3 s390-bios: Support booting from real dasd device 94998e8aef s390-bios: Add channel command codes/structs needed for dasd-ipl 8cab135f1f s390-bios: Use control unit type to determine boot method 0839e39d7e s390-bios: Refactor virtio to run channel programs via cio 47ecb89929 s390-bios: cio error handling6ed51be6e9 s390-bios: Support for running format-0/1 channel programs e91f12a0e8 s390-bios: ptr2u32 and u32toptrddb9098d6a s390-bios: Map low core memoryfcbe10b9a4 s390-bios: Decouple channel i/o logic from virtio 7054d8f76c s390-bios: Clean up cio.h8dd54ea4db s390-bios: Factor finding boot device out of virtio code path b2c9cd304a s390-bios: Extend find_dev() for non-virtio devices bc538e2273 s390-bios: decouple common boot logic from virtio 5921529560 s390-bios: decouple cio setup from virtio771e74f350 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 771e74f3508a (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 592152956073 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit bc538e2273cc (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit b2c9cd304a79 (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 8dd54ea4dbb8 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 7054d8f76cdc (s390-bios: Clean up cio.h)
7/16 Checking commit fcbe10b9a4ce (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit ddb9098d6af2 (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #36:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit e91f12a0e82d (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 6ed51be6e9de (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 47ecb89929ac (s390-bios: cio error handling)
12/16 Checking commit 0839e39d7ed3 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 8cab135f1f9a (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 94998e8aef86 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit c5cbb3e0e34d (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 1255bffda9a8 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'46caf3a119 s390-bios: dasd-ipl: Use control unit type to customize error data 14cba76f6c s390-bios: Support booting from real dasd device 67b3fe266d s390-bios: Add channel command codes/structs needed for dasd-ipl db787040a4 s390-bios: Use control unit type to determine boot method 97556e4f3e s390-bios: Refactor virtio to run channel programs via cio 9449a3f1e8 s390-bios: cio error handling8204170c3a s390-bios: Support for running format-0/1 channel programs 476cd55407 s390-bios: ptr2u32 and u32toptr86ab42c2f9 s390-bios: Map low core memory299f41be09 s390-bios: Decouple channel i/o logic from virtio e944d771e7 s390-bios: Clean up cio.hd3d079f955 s390-bios: Factor finding boot device out of virtio code path 10bc58cea4 s390-bios: Extend find_dev() for non-virtio devices 1e45cd7e92 s390-bios: decouple common boot logic from virtio 382aadfbb2 s390-bios: decouple cio setup from virtio007b05756b s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 007b05756bc0 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 382aadfbb2ca (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 1e45cd7e926a (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 10bc58cea47a (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit d3d079f9558e (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit e944d771e779 (s390-bios: Clean up cio.h)
7/16 Checking commit 299f41be09f9 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 86ab42c2f93a (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #36:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 476cd554074a (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 8204170c3a2f (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 9449a3f1e8fd (s390-bios: cio error handling)
12/16 Checking commit 97556e4f3e7f (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit db787040a465 (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 67b3fe266da2 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 14cba76f6cd2 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 46caf3a119e2 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'9dceea1b14 s390-bios: dasd-ipl: Use control unit type to customize error data 32e8d139b3 s390-bios: Support booting from real dasd device 938b0da771 s390-bios: Add channel command codes/structs needed for dasd-ipl 4be4aaf6e1 s390-bios: Use control unit type to determine boot method 842817499f s390-bios: Refactor virtio to run channel programs via cio 2b2e643070 s390-bios: cio error handling559e1945f8 s390-bios: Support for running format-0/1 channel programs 83b111ce4a s390-bios: ptr2u32 and u32toptre05b6c3ada s390-bios: Map low core memory6f706c8864 s390-bios: Decouple channel i/o logic from virtio 1f9f7b59a6 s390-bios: Clean up cio.ha4238c176e s390-bios: Factor finding boot device out of virtio code path d692e619f6 s390-bios: Extend find_dev() for non-virtio devices 0217b7e4a4 s390-bios: decouple common boot logic from virtio 5963e0293d s390-bios: decouple cio setup from virtioac242eb901 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit ac242eb90150 (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 5963e0293dc3 (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 0217b7e4a4e6 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit d692e619f6cc (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit a4238c176e9c (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 1f9f7b59a60f (s390-bios: Clean up cio.h)
7/16 Checking commit 6f706c886483 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit e05b6c3adab4 (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #36:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 83b111ce4ae6 (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #17:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 559e1945f8de (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 2b2e6430704d (s390-bios: cio error handling)
12/16 Checking commit 842817499f32 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 4be4aaf6e1a9 (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 938b0da7715b (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 32e8d139b336 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit 9dceea1b14bc (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'b7aaa9c703 s390-bios: dasd-ipl: Use control unit type to customize error data 52085b8f83 s390-bios: Support booting from real dasd device 69408610f4 s390-bios: Add channel command codes/structs needed for dasd-ipl cc0aaac6c7 s390-bios: Use control unit type to determine boot method 434eec95bf s390-bios: Refactor virtio to run channel programs via cio 66dd80c18c s390-bios: cio error handling657592efa5 s390-bios: Support for running format-0/1 channel programs 1375c50da1 s390-bios: ptr2u32 and u32toptr637b957361 s390-bios: Map low core memory66e4245468 s390-bios: Decouple channel i/o logic from virtio 31d8ec0aff s390-bios: Clean up cio.h88c8d0052e s390-bios: Factor finding boot device out of virtio code path fe2b50f585 s390-bios: Extend find_dev() for non-virtio devices ad96715604 s390-bios: decouple common boot logic from virtio 2541ee0520 s390-bios: decouple cio setup from virtioe08dc9e136 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit e08dc9e1365f (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 2541ee05208e (s390-bios: decouple cio setup from virtio) 3/16 Checking commit ad967156046b (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit fe2b50f585af (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 88c8d0052e0c (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit 31d8ec0aff5d (s390-bios: Clean up cio.h)
7/16 Checking commit 66e424546827 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 637b95736185 (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #36:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 1375c50da1bd (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #17:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit 657592efa58a (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit 66dd80c18cec (s390-bios: cio error handling)
12/16 Checking commit 434eec95bf37 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit cc0aaac6c7f4 (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit 69408610f403 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 52085b8f83c6 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit b7aaa9c703e1 (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'ea3f849172 s390-bios: dasd-ipl: Use control unit type to customize error data 861af1f24c s390-bios: Support booting from real dasd device cc519e5366 s390-bios: Add channel command codes/structs needed for dasd-ipl 931e58a5f0 s390-bios: Use control unit type to determine boot method f01741d9b4 s390-bios: Refactor virtio to run channel programs via cio afa1f9f876 s390-bios: cio error handlingf33e472d62 s390-bios: Support for running format-0/1 channel programs 24afeab7ac s390-bios: ptr2u32 and u32toptr511f57aef9 s390-bios: Map low core memoryf8c6f0def0 s390-bios: Decouple channel i/o logic from virtio fd0a84ecad s390-bios: Clean up cio.h063cbb9411 s390-bios: Factor finding boot device out of virtio code path 9c186bd53e s390-bios: Extend find_dev() for non-virtio devices 5badca2943 s390-bios: decouple common boot logic from virtio 8ceea012c1 s390-bios: decouple cio setup from virtio1142cb1195 s390 vfio-ccw: Add bootindex property and IPLB data
=== OUTPUT BEGIN ===
1/16 Checking commit 1142cb11950a (s390 vfio-ccw: Add bootindex property and IPLB data)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #205:
new file mode 100644
total: 0 errors, 1 warnings, 181 lines checked
Patch 1/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/16 Checking commit 8ceea012c10e (s390-bios: decouple cio setup from virtio) 3/16 Checking commit 5badca294319 (s390-bios: decouple common boot logic from virtio)
ERROR: externs should be avoided in .c files
#31: FILE: pc-bios/s390-ccw/main.c:19:
+IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
total: 1 errors, 0 warnings, 65 lines checked
Patch 3/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/16 Checking commit 9c186bd53ea2 (s390-bios: Extend find_dev() for non-virtio devices) 5/16 Checking commit 063cbb9411a3 (s390-bios: Factor finding boot device out of virtio code path) 6/16 Checking commit fd0a84ecadb1 (s390-bios: Clean up cio.h)
7/16 Checking commit f8c6f0def094 (s390-bios: Decouple channel i/o logic from virtio)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28:
new file mode 100644
total: 0 errors, 1 warnings, 122 lines checked
Patch 7/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
8/16 Checking commit 511f57aef9bb (s390-bios: Map low core memory)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #36:
new file mode 100644
total: 0 errors, 1 warnings, 116 lines checked
Patch 8/16 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
9/16 Checking commit 24afeab7ac9a (s390-bios: ptr2u32 and u32toptr)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #17:
new file mode 100644
total: 0 errors, 1 warnings, 16 lines checked
Patch 9/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/16 Checking commit f33e472d6271 (s390-bios: Support for running format-0/1 channel programs) 11/16 Checking commit afa1f9f87611 (s390-bios: cio error handling)
12/16 Checking commit f01741d9b4b1 (s390-bios: Refactor virtio to run channel programs via cio)
WARNING: line over 80 characters
#103: FILE: pc-bios/s390-ccw/virtio.c:298:
+ run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
WARNING: line over 80 characters
#116: FILE: pc-bios/s390-ccw/virtio.c:308:
+ run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
total: 0 errors, 2 warnings, 107 lines checked
Patch 12/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/16 Checking commit 931e58a5f0dc (s390-bios: Use control unit type to determine boot method) 14/16 Checking commit cc519e5366c0 (s390-bios: Add channel command codes/structs needed for dasd-ipl) 15/16 Checking commit 861af1f24cd1 (s390-bios: Support booting from real dasd device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#26:
new file mode 100644
total: 0 errors, 1 warnings, 446 lines checked
Patch 15/16 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/16 Checking commit ea3f8491728b (s390-bios: dasd-ipl: Use control unit type to customize error data) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]