@@ -94,6 +94,7 @@ static void vfio_ccw_io_notifier_handler(void *opaque)
CcwDevice *ccw_dev = CCW_DEVICE(cdev);
SubchDev *sch = ccw_dev->sch;
SCSW *s = &sch->curr_status.scsw;
+ PMCW *p = &sch->curr_status.pmcw;
IRB irb;
int size;
@@ -143,6 +144,12 @@ static void vfio_ccw_io_notifier_handler(void *opaque)
/* Update control block via irb. */
copy_scsw_to_guest(s, &irb.scsw);
+ /* If a uint check is pending, copy sense data. */
+ if ((s->dstat & SCSW_DSTAT_UNIT_CHECK) &&
+ (p->chars & PMCW_CHARS_MASK_CSENSE)) {
+ memcpy(sch->sense_data, irb.ecw, sizeof(irb.ecw));
+ }
+
read_err:
css_inject_io_interrupt(sch);
}