From patchwork Thu Oct 4 22:18:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 189365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C96D92C00C2 for ; Fri, 5 Oct 2012 08:55:25 +1000 (EST) Received: from localhost ([::1]:39547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJuKC-0003eJ-1q for incoming@patchwork.ozlabs.org; Thu, 04 Oct 2012 18:55:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJtkY-00005Z-Em for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJtkX-0004ej-Bw for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJtkX-0004dz-4M for qemu-devel@nongnu.org; Thu, 04 Oct 2012 18:18:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q94MIWif001728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Oct 2012 18:18:32 -0400 Received: from bling.home (ovpn-113-153.phx2.redhat.com [10.3.113.153]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q94MIWW5021968; Thu, 4 Oct 2012 18:18:32 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Thu, 04 Oct 2012 16:18:31 -0600 Message-ID: <20121004221830.3189.73788.stgit@bling.home> In-Reply-To: <20121004220545.3189.52569.stgit@bling.home> References: <20121004220545.3189.52569.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH 09/11] vfio-pci: Remove setting of MSI qsize 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 This was a misinterpretation of the spec, hardware doesn't get to specify how many were actually enabled through this field. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 0ca77cf..a554e7c 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -508,20 +508,6 @@ static MSIMessage msi_get_msg(PCIDevice *pdev, unsigned int vector) return msg; } -/* So should this */ -static void msi_set_qsize(PCIDevice *pdev, uint8_t size) -{ - uint8_t *config = pdev->config + pdev->msi_cap; - uint16_t flags; - - flags = pci_get_word(config + PCI_MSI_FLAGS); - flags = le16_to_cpu(flags); - flags &= ~PCI_MSI_FLAGS_QSIZE; - flags |= (size & 0x7) << 4; - flags = cpu_to_le16(flags); - pci_set_word(config + PCI_MSI_FLAGS, flags); -} - static void vfio_enable_msix(VFIODevice *vdev) { vfio_disable_interrupts(vdev); @@ -609,8 +595,6 @@ retry: return; } - msi_set_qsize(&vdev->pdev, vdev->nr_vectors); - vdev->interrupt = VFIO_INT_MSI; DPRINTF("%s(%04x:%02x:%02x.%x) Enabled %d MSI vectors\n", __func__, @@ -671,8 +655,6 @@ static void vfio_disable_msi(VFIODevice *vdev) vfio_disable_msi_common(vdev); - msi_set_qsize(&vdev->pdev, 0); /* Actually still means 1 vector */ - DPRINTF("%s(%04x:%02x:%02x.%x)\n", __func__, vdev->host.domain, vdev->host.bus, vdev->host.slot, vdev->host.function); }