From fa4463e0432ab66432a28d6b975f8eed99b3f4fa Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Thu, 16 Jul 2015 10:42:18 +0200 Subject: 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 --- hw/s390x/css.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/s390x/css.c') 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; -- cgit v1.2.3