summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2015-07-16 10:42:18 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2015-09-07 16:10:42 +0200
commitfa4463e0432ab66432a28d6b975f8eed99b3f4fa (patch)
treecac0f7e174049dda0d49b47136b0722f6da14f78
parentfde8206b8061f808c880709c2ac26a645b11c211 (diff)
downloadqemu-fa4463e0432ab66432a28d6b975f8eed99b3f4fa.tar.gz
qemu-fa4463e0432ab66432a28d6b975f8eed99b3f4fa.tar.bz2
qemu-fa4463e0432ab66432a28d6b975f8eed99b3f4fa.zip
s390x/css: ccw-0 enforces count > 0
Type-0 ccws need to have a count > 0 for any command other than TIC. Generate a channel-program check if this is not the case. Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
-rw-r--r--hw/s390x/css.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 2c0782cc6a..95962808de 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -290,6 +290,10 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr)
((ccw.cmd_code & 0xf0) != 0)) {
return -EINVAL;
}
+ if (!sch->ccw_fmt_1 && (ccw.count == 0) &&
+ (ccw.cmd_code != CCW_CMD_TIC)) {
+ return -EINVAL;
+ }
if (ccw.flags & CCW_FLAG_SUSPEND) {
return -EINPROGRESS;