aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/css.c
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/css.c
parent0599a046acf1b625e97cef0aa702b5d86528c642 (diff)
downloadqemu-c626710fc755628d0d6b88aab0514c9238a84522.zip
qemu-c626710fc755628d0d6b88aab0514c9238a84522.tar.gz
qemu-c626710fc755628d0d6b88aab0514c9238a84522.tar.bz2
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/css.c')
-rw-r--r--hw/s390x/css.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 1a3aad5..133ddea 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;