aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/vfio/ccw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index 007ce43..12d0262 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -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);
}