From: Cornelia Huck Date: Thu, 16 Jul 2015 08:42:18 +0000 (+0200) Subject: s390x/css: ccw-0 enforces count > 0 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fa4463e0432ab66432a28d6b975f8eed99b3f4fa;p=qemu.git 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 Signed-off-by: Cornelia Huck --- 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;