From patchwork Wed Nov 25 08:16:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 39294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 63321B6EEF for ; Wed, 25 Nov 2009 20:12:30 +1100 (EST) Received: from localhost ([127.0.0.1]:57533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDDvH-0000Yb-6f for incoming@patchwork.ozlabs.org; Wed, 25 Nov 2009 04:12:27 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDDud-0000VY-Fi for qemu-devel@nongnu.org; Wed, 25 Nov 2009 04:11:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDDuY-0000PS-67 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 04:11:46 -0500 Received: from [199.232.76.173] (port=35654 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDDuX-0000OF-6c for qemu-devel@nongnu.org; Wed, 25 Nov 2009 04:11:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20145) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDDuW-0003n4-Q7 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 04:11:41 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAP8Grqa029629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Nov 2009 03:16:53 -0500 Received: from zweiblum.home.kraxel.org (vpn1-4-184.ams2.redhat.com [10.36.4.184]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nAP8Gp9J018718; Wed, 25 Nov 2009 03:16:52 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 615A0700B9; Wed, 25 Nov 2009 09:16:49 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 25 Nov 2009 09:16:48 +0100 Message-Id: <1259137008-9669-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1259137008-9669-1-git-send-email-kraxel@redhat.com> References: <1259137008-9669-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/2] virtio: enable msi-x for console+balloon X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Enable MSI-X for virtio-console-pci and virtio-balloon-pci. Add entries to the compatibility machine types so MSI-X will be disabled for pc-0.10 and pc-0.11. Signed-off-by: Gerd Hoffmann --- hw/pc.c | 16 ++++++++++++++++ hw/virtio-pci.c | 11 +++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index fdaa52c..cb78923 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1297,6 +1297,14 @@ static QEMUMachine pc_machine_v0_11 = { .driver = "virtio-blk-pci", .property = "vectors", .value = stringify(0), + },{ + .driver = "virtio-balloon-pci", + .property = "vectors", + .value = stringify(0), + },{ + .driver = "virtio-console-pci", + .property = "vectors", + .value = stringify(0), }, { /* end of list */ } } @@ -1324,6 +1332,14 @@ static QEMUMachine pc_machine_v0_10 = { .driver = "virtio-blk-pci", .property = "vectors", .value = stringify(0), + },{ + .driver = "virtio-balloon-pci", + .property = "vectors", + .value = stringify(0), + },{ + .driver = "virtio-console-pci", + .property = "vectors", + .value = stringify(0), }, { /* end of list */ } }, diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index aebcf9d..cb8ab21 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -483,10 +483,13 @@ static int virtio_console_init_pci(PCIDevice *pci_dev) if (!vdev) { return -1; } + vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, proxy->class_code, 0x00); + /* make the actual value visible */ + proxy->nvectors = vdev->nvectors; return 0; } @@ -531,11 +534,14 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev) VirtIODevice *vdev; vdev = virtio_balloon_init(&pci_dev->qdev); + vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BALLOON, PCI_CLASS_MEMORY_RAM, 0x00); + /* make the actual value visible */ + proxy->nvectors = vdev->nvectors; return 0; } @@ -569,6 +575,7 @@ static PCIDeviceInfo virtio_info[] = { .init = virtio_console_init_pci, .exit = virtio_exit_pci, .qdev.props = (Property[]) { + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_END_OF_LIST(), }, @@ -579,6 +586,10 @@ static PCIDeviceInfo virtio_info[] = { .init = virtio_balloon_init_pci, .exit = virtio_exit_pci, .qdev.reset = virtio_pci_reset, + .qdev.props = (Property[]) { + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3), + DEFINE_PROP_END_OF_LIST(), + }, },{ /* end of list */ }