From patchwork Tue Nov 2 05:08:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 296622 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA258xe0021186 for ; Tue, 2 Nov 2010 05:09:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935276Ab0KBFIl (ORCPT ); Tue, 2 Nov 2010 01:08:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283Ab0KBFIi (ORCPT ); Tue, 2 Nov 2010 01:08:38 -0400 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 oA258aV0029850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Nov 2010 01:08:36 -0400 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA258Zg8013140; Tue, 2 Nov 2010 01:08:35 -0400 From: Alex Williamson Subject: [PATCH] vfio: Extended capability fixes To: pugs@cisco.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, alex.williamson@redhat.com Date: Mon, 01 Nov 2010 23:08:35 -0600 Message-ID: <20101102050835.2963.63375.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Nov 2010 05:09:01 +0000 (UTC) diff --git a/drivers/vfio/vfio_pci_config.c b/drivers/vfio/vfio_pci_config.c index 8af995d..8304316 100644 --- a/drivers/vfio/vfio_pci_config.c +++ b/drivers/vfio/vfio_pci_config.c @@ -410,7 +410,7 @@ static int vfio_msi_cap_len(struct vfio_dev *vdev, u8 pos) * Determine extended capability length for VC (2 & 9) and * MFVC capabilities */ -static int vfio_vc_cap_len(struct vfio_dev *vdev, u8 pos) +static int vfio_vc_cap_len(struct vfio_dev *vdev, u16 pos) { struct pci_dev *pdev = vdev->pdev; u32 dw; @@ -580,7 +580,7 @@ int vfio_build_config_map(struct vfio_dev *vdev) printk(KERN_WARNING "%s: pci config conflict at %x, " "caps %x %x\n", - __func__, i, map[pos+i], cap); + __func__, pos+i, map[pos+i], cap); map[pos+i] = cap; } ret = pci_read_config_byte(pdev, pos + PCI_CAP_LIST_NEXT, &pos); @@ -683,7 +683,7 @@ int vfio_build_config_map(struct vfio_dev *vdev) if (len == 0 || len == 0xFF) { printk(KERN_WARNING "%s: unknown length for pci ext cap %x\n", - __func__, cap); + __func__, ecap); len = PCI_CAP_SIZEOF; } for (i = 0; i < len; i++) { @@ -691,7 +691,7 @@ int vfio_build_config_map(struct vfio_dev *vdev) printk(KERN_WARNING "%s: pci config conflict at %x, " "caps %x %x\n", - __func__, i, map[epos+i], ecap); + __func__, epos+i, map[epos+i], ecap); map[epos+i] = ecap; }