Skip to contentSkip to conversation

virtio-ccw/css: bugfixes

PATCH New Cornelia Huck 1 participant 3 messages Jun 6, 2013

lore
Share & tools
lore
#0 lore raw

cover virtio-ccw/css: bugfixes

Two bugfixes for problems that lurked in the virtual css and virtio-ccw code since the beginning: Concurrent sense data was indicated by the wrong bit, and un-setting indicators never worked due to a thinko.

Cornelia Huck (2):
s390x/css: Fix concurrent sense.
virtio-ccw: Fix unsetting of indicators.

 hw/s390x/css.c        |    2 +-
 hw/s390x/virtio-ccw.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 s390x/css: Fix concurrent sense.

Fix an off-by-one error when indicating availablity of concurrent sense data.

---
 hw/s390x/css.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/css.c +1 -1
index e526a1c..f82abfe 100644
@@ -777,7 +777,7 @@ int css_do_tsch(SubchDev *sch, IRB *target_irb)
             (p->chars & PMCW_CHARS_MASK_CSENSE)) {
             irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF | SCSW_FLAGS_MASK_ECTL;
             memcpy(irb.ecw, sch->sense_data, sizeof(sch->sense_data));
-            irb.esw[1] = 0x02000000 | (sizeof(sch->sense_data) << 8);
+            irb.esw[1] = 0x01000000 | (sizeof(sch->sense_data) << 8);
         }
     }
     /* Store the irb to the guest. */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 virtio-ccw: Fix unsetting of indicators.

In reply to Cornelia Huck

Interpretation of the ccws to register (configuration) indicators contained a thinko: We want to disallow reading from 0, but setting the indicator pointer to 0 is fine.

Let's fix the handling for CCW_CMD_SET{,_CONF}_IND.

---
 hw/s390x/virtio-ccw.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/s390x/virtio-ccw.c +4 -4
index 5f5e267..44f5772 100644
@@ -328,10 +328,10 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
             ret = -EINVAL;
             break;
         }
-        indicators = ldq_phys(ccw.cda);
-        if (!indicators) {
+        if (!ccw.cda) {
             ret = -EFAULT;
         } else {
+            indicators = ldq_phys(ccw.cda);
             dev->indicators = indicators;
             sch->curr_status.scsw.count = ccw.count - sizeof(indicators);
             ret = 0;
@@ -348,10 +348,10 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
             ret = -EINVAL;
             break;
         }
-        indicators = ldq_phys(ccw.cda);
-        if (!indicators) {
+        if (!ccw.cda) {
             ret = -EFAULT;
         } else {
+            indicators = ldq_phys(ccw.cda);
             dev->indicators2 = indicators;
             sch->curr_status.scsw.count = ccw.count - sizeof(indicators);
             ret = 0;
Signature · 1 line
1.7.9.5