s390x/css: fence off MIDA
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 24 May 2017 12:06:12 +0000 (14:06 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 6 Jun 2017 08:17:11 +0000 (10:17 +0200)
MIDA (modified indirect data addressing) is an optional facility, and
we (currently) don't support it. Let's post an operand exception if
the guest tries to set it in the orb and a channel program check
if it is set in a ccw, as specified in the Principles of Operation.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
hw/s390x/css.c
include/hw/s390x/ioinst.h
target/s390x/ioinst.c

index cc76c537dac8b08776b762e19afc76ad0d991939..599805d2759a2548cdb0e44ab98934052f78165d 100644 (file)
@@ -433,6 +433,11 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,
         return -EINVAL;
     }
 
+    /* We don't support MIDA. */
+    if (ccw.flags & CCW_FLAG_MIDA) {
+        return -EINVAL;
+    }
+
     if (ccw.flags & CCW_FLAG_SUSPEND) {
         return suspend_allowed ? -EINPROGRESS : -EINVAL;
     }
index c559f53426d0d6543542b793b9bf6252c3319ffe..92d15655e43477844b1a3b30676e245c6330d8ea 100644 (file)
@@ -182,6 +182,7 @@ typedef struct CCW1 {
 #define CCW_FLAG_PCI             0x08
 #define CCW_FLAG_IDA             0x04
 #define CCW_FLAG_SUSPEND         0x02
+#define CCW_FLAG_MIDA            0x01
 
 #define CCW_CMD_NOOP             0x03
 #define CCW_CMD_BASIC_SENSE      0x04
index 62a777100c06220dd515dea27050a9ae1d45bbc5..d5e6b8066bd8c0dc622f400eca24aef7be573ff6 100644 (file)
@@ -201,6 +201,10 @@ static int ioinst_orb_valid(ORB *orb)
         (orb->ctrl1 & ORB_CTRL1_MASK_INVALID)) {
         return 0;
     }
+    /* We don't support MIDA. */
+    if (orb->ctrl1 & ORB_CTRL1_MASK_MIDAW) {
+        return 0;
+    }
     if ((orb->cpa & HIGH_ORDER_BIT) != 0) {
         return 0;
     }