On Fri, Jun 18 2021, Eric Farman <far...@linux.ibm.com> wrote: > The Interrupt Response Block is comprised of several other > structures concatenated together, but only the 12-byte > Subchannel-Status Word (SCSW) is defined as a proper struct. > Everything else is a simple array of 32-bit words. > > Let's define a proper struct for the 20-byte Extended-Status > Word (ESW) so that we can make good decisions about the sense > data that would go into the ECW area for virtual vs > passthrough devices. > > Signed-off-by: Eric Farman <far...@linux.ibm.com> > --- > hw/s390x/css.c | 19 +++++++++++++------ > include/hw/s390x/ioinst.h | 12 +++++++++++- > 2 files changed, 24 insertions(+), 7 deletions(-)
(...) > diff --git a/include/hw/s390x/ioinst.h b/include/hw/s390x/ioinst.h > index c6737a30d4..e7ab401781 100644 > --- a/include/hw/s390x/ioinst.h > +++ b/include/hw/s390x/ioinst.h > @@ -123,10 +123,20 @@ typedef struct SCHIB { > uint8_t mda[4]; > } QEMU_PACKED SCHIB; > > +/* format-0 extended-status word */ > +typedef struct ESW { > + uint32_t word0; Maybe append /* subchannel logout for format 0 */? Can do when applying. > + uint32_t erw; > + uint64_t f_addr; /* Zeros for other ESW formats */ > + uint32_t s_addr; /* Zeros for other ESW formats */ > +} QEMU_PACKED ESW; > + > +#define ESW_ERW_SENSE 0x01000000 > + > /* interruption response block */ > typedef struct IRB { > SCSW scsw; > - uint32_t esw[5]; > + ESW esw; > uint32_t ecw[8]; > uint32_t emw[8]; > } IRB;