Received: from eggs.gnu.org ([2001:4830:134:3::10]:34790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHAkl-0004gT-5r for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHAkh-0001Ss-1s for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:23 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:58473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHAkg-0001SW-Nq for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:18 -0500 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Jan 2016 13:37:17 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id CFDF017D8056 for ; Thu, 7 Jan 2016 13:38:00 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u07DbFBQ6619396 for ; Thu, 7 Jan 2016 13:37:15 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u07DbEmm026699 for ; Thu, 7 Jan 2016 06:37:14 -0700 From: Cornelia Huck Date: Thu, 7 Jan 2016 14:36:57 +0100 Message-Id: <1452173818-13661-9-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1452173818-13661-1-git-send-email-cornelia.huck@de.ibm.com> References: <1452173818-13661-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH v2 8/9] virtio-ccw: fix sanity check for vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, Halil Pasic , agraf@suse.de 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.6.4