aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2021-06-18 01:25:37 +0200
committerCornelia Huck <cohuck@redhat.com>2021-06-21 08:48:21 +0200
commitc626710fc755628d0d6b88aab0514c9238a84522 (patch)
tree12b49376ebb489dd0b28394e724b0825446fbf70 /hw/s390x
parent0599a046acf1b625e97cef0aa702b5d86528c642 (diff)
s390x/css: Add passthrough IRB
Wire in the subchannel callback for building the IRB ESW and ECW space for passthrough devices, and copy the hardware's ESW into the IRB we are building. If the hardware presented concurrent sense, then copy that sense data into the IRB's ECW space. Signed-off-by: Eric Farman <farman@linux.ibm.com> Message-Id: <20210617232537.1337506-5-farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/css.c16
-rw-r--r--hw/s390x/s390-ccw.c1
2 files changed, 16 insertions, 1 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 1a3aad5163..133ddea575 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -1335,7 +1335,7 @@ static void copy_schib_to_guest(SCHIB *dest, const SCHIB *src)
}
}
-static void copy_esw_to_guest(ESW *dest, const ESW *src)
+void copy_esw_to_guest(ESW *dest, const ESW *src)
{
dest->word0 = cpu_to_be32(src->word0);
dest->erw = cpu_to_be32(src->erw);
@@ -1650,6 +1650,20 @@ static void build_irb_sense_data(SubchDev *sch, IRB *irb)
}
}
+void build_irb_passthrough(SubchDev *sch, IRB *irb)
+{
+ /* Copy ESW from hardware */
+ irb->esw = sch->esw;
+
+ /*
+ * If (irb->esw.erw & ESW_ERW_SENSE) is true, then the contents
+ * of the ECW is sense data. If false, then it is model-dependent
+ * information. Either way, copy it into the IRB for the guest to
+ * read/decide what to do with.
+ */
+ build_irb_sense_data(sch, irb);
+}
+
void build_irb_virtual(SubchDev *sch, IRB *irb)
{
SCHIB *schib = &sch->curr_status;
diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c
index c227c77984..2fc8bb9c23 100644
--- a/hw/s390x/s390-ccw.c
+++ b/hw/s390x/s390-ccw.c
@@ -124,6 +124,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **errp)
}
sch->driver_data = cdev;
sch->do_subchannel_work = do_subchannel_work_passthrough;
+ sch->irb_cb = build_irb_passthrough;
ccw_dev->sch = sch;
ret = css_sch_build_schib(sch, &cdev->hostid);