From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMw8-0002OW-7Y for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:02:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJMvq-0006Cw-GH for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:02:12 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:45202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMvq-0006Cn-5J for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:01:54 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jan 2016 15:01:53 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id DDBEA17D8056 for ; Wed, 13 Jan 2016 15:01:52 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0DF1oIZ4456836 for ; Wed, 13 Jan 2016 15:01:50 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0DF1nB1011801 for ; Wed, 13 Jan 2016 08:01:50 -0700 From: Cornelia Huck Date: Wed, 13 Jan 2016 16:01:43 +0100 Message-Id: <1452697304-29695-9-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1452697304-29695-1-git-send-email-cornelia.huck@de.ibm.com> References: <1452697304-29695-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 8/9] virtio-ccw: fix sanity check for vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Halil Pasic , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, Cornelia Huck From: Halil Pasic The commit 8dfbaa6ac ("virtio-ccw: introduce ccw specific queue limit") did not touch the sanity check for the vector argument of the method virtio_ccw_notify, despite intended as seen from https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg02705.html To be able to scale number of virtqueues using the constant this sanity check needs to be altered. Fixes: 8dfbaa6ac ("virtio-ccw: introduce ccw specific queue limit") Reviewed-by: Cornelia Huck Signed-off-by: Halil Pasic Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 63da303..95a6c14 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1177,7 +1177,8 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t vector) SubchDev *sch = dev->sch; uint64_t indicators; - if (vector >= 128) { + /* queue indicators + secondary indicators */ + if (vector >= VIRTIO_CCW_QUEUE_MAX + 64) { return; } -- 2.7.0