From patchwork Thu Feb 26 07:04:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 443811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8F45C14008F for ; Thu, 26 Feb 2015 18:06:22 +1100 (AEDT) Received: from localhost ([::1]:57586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQsWa-0002OF-CU for incoming@patchwork.ozlabs.org; Thu, 26 Feb 2015 02:06:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQsVo-0000pX-5Y for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQsVj-0006C0-T1 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQsVj-0006Bm-L6 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:27 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1Q75Pqi017791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Feb 2015 02:05:25 -0500 Received: from jason-ThinkPad-T430s.redhat.com (vpn1-4-223.pek2.redhat.com [10.72.4.223]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1Q74l2M029074; Thu, 26 Feb 2015 02:05:22 -0500 From: Jason Wang To: qemu-devel@nongnu.org Date: Thu, 26 Feb 2015 15:04:42 +0800 Message-Id: <1424934286-7099-8-git-send-email-jasowang@redhat.com> In-Reply-To: <1424934286-7099-1-git-send-email-jasowang@redhat.com> References: <1424934286-7099-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , Anthony Liguori , mst@redhat.com Subject: [Qemu-devel] [PATCH V2 07/11] virtio-mmio: switch to bus specific queue limit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Cc: Anthony Liguori Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/virtio/virtio-mmio.c | 6 +++--- include/hw/virtio/virtio.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index ad03218..3be2ce8 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -237,7 +237,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, proxy->guest_page_shift); break; case VIRTIO_MMIO_QUEUESEL: - if (value < VIRTIO_PCI_QUEUE_MAX) { + if (value < virtio_get_queue_max(vdev)) { vdev->queue_sel = value; } break; @@ -257,7 +257,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, } break; case VIRTIO_MMIO_QUEUENOTIFY: - if (value < VIRTIO_PCI_QUEUE_MAX) { + if (value < virtio_get_queue_max(vdev)) { virtio_queue_notify(vdev, value); } break; @@ -403,7 +403,7 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data) k->device_plugged = virtio_mmio_device_plugged; k->has_variable_vring_alignment = true; bus_class->max_dev = 1; - k->queue_max = VIRTIO_PCI_QUEUE_MAX; + k->queue_max = VIRTIO_MMIO_QUEUE_MAX; } static const TypeInfo virtio_mmio_bus_info = { diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 8f4da77..e538f5a 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -95,6 +95,7 @@ typedef struct VirtQueueElement #define VIRTIO_PCI_QUEUE_MAX 64 #define VIRTIO_CCW_QUEUE_MAX 64 #define VIRTIO_S390_QUEUE_MAX 64 +#define VIRTIO_MMIO_QUEUE_MAX 64 #define VIRTIO_NO_VECTOR 0xffff