From patchwork Fri Nov 19 23:20:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 72334 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 6BDE9B7120 for ; Sat, 20 Nov 2010 10:30:33 +1100 (EST) Received: from localhost ([127.0.0.1]:45091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJaOs-0005ds-3h for incoming@patchwork.ozlabs.org; Fri, 19 Nov 2010 18:29:50 -0500 Received: from [140.186.70.92] (port=57773 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJaFU-0000jy-NU for qemu-devel@nongnu.org; Fri, 19 Nov 2010 18:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJaFT-0001fg-2N for qemu-devel@nongnu.org; Fri, 19 Nov 2010 18:20:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJaFS-0001fT-Mq for qemu-devel@nongnu.org; Fri, 19 Nov 2010 18:20:07 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAJNK538023123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Nov 2010 18:20:05 -0500 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAJNK4hc025446; Fri, 19 Nov 2010 18:20:04 -0500 From: Alex Williamson To: kvm@vger.kernel.org, mst@redhat.com Date: Fri, 19 Nov 2010 16:20:04 -0700 Message-ID: <20101119231955.22162.29035.stgit@s20.home> In-Reply-To: <20101119231138.22162.93647.stgit@s20.home> References: <20101119231138.22162.93647.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: chrisw@redhat.com, alex.williamson@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v3 5/9] pci: Remove cap.length, cap.start, cap.supported 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 Capabilities aren't required to be contiguous, so cap.length never really made much sense. Likewise, cap.start is mostly meaningless too. Both of these are better served by the capability map. We can also get rid of cap.supported, since it's really now unused and redundant with flag in the status word anyway. Signed-off-by: Alex Williamson --- hw/device-assignment.c | 4 ---- hw/pci.c | 3 --- hw/pci.h | 2 -- 3 files changed, 0 insertions(+), 9 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index a4fad60..975d3cb 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1292,8 +1292,6 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev) pci_get_word(pci_dev->config + PCI_STATUS) & ~PCI_STATUS_CAP_LIST); - pci_dev->cap.length = 0; - #ifdef KVM_CAP_IRQ_ROUTING #ifdef KVM_CAP_DEVICE_MSI /* Expose MSI capability @@ -1320,7 +1318,6 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev) PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE); pci_set_long(pci_dev->wmask + vpos + PCI_MSI_ADDRESS_LO, 0xfffffffc); pci_set_long(pci_dev->wmask + vpos + PCI_MSI_DATA_32, 0xffff); - pci_dev->cap.length += PCI_CAPABILITY_CONFIG_MSI_LENGTH; } #endif #ifdef KVM_CAP_DEVICE_MSIX @@ -1356,7 +1353,6 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev) bar_nr = msix_table_entry & PCI_MSIX_BIR; msix_table_entry &= ~PCI_MSIX_BIR; dev->msix_table_addr = pci_region[bar_nr].base_addr + msix_table_entry; - pci_dev->cap.length += PCI_CAPABILITY_CONFIG_MSIX_LENGTH; } #endif #endif diff --git a/hw/pci.c b/hw/pci.c index cbe6fb7..1cf62b6 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1909,8 +1909,6 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id, memset(pdev->cmask + offset, 0xFF, size); pdev->config[PCI_STATUS] |= PCI_STATUS_CAP_LIST; - pdev->cap.supported = 1; - pdev->cap.start = pdev->cap.start ? MIN(pdev->cap.start, offset) : offset; return offset; } @@ -1931,7 +1929,6 @@ void pci_del_capability(PCIDevice *pdev, uint8_t cap_id, uint8_t size) if (!pdev->config[PCI_CAPABILITY_LIST]) { pdev->config[PCI_STATUS] &= ~PCI_STATUS_CAP_LIST; - pdev->cap.start = pdev->cap.length = 0; } } diff --git a/hw/pci.h b/hw/pci.h index bd15b43..146f81d 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -220,8 +220,6 @@ struct PCIDevice { /* Device capability configuration space */ struct { - int supported; - unsigned int start, length; PCICapConfigReadFunc *config_read; PCICapConfigWriteFunc *config_write; } cap;