From: Alex Williamson <alex.williamson@redhat.com>
To: pugs@cisco.com
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
kvm@vger.kernel.org, alex.williamson@redhat.com
Subject: [PATCH] vfio: Extended capability fixes
Date: Mon, 01 Nov 2010 23:08:35 -0600 [thread overview]
Message-ID: <20101102050835.2963.63375.stgit@s20.home> (raw)
- Virtual channel position gets truncated as a u8
- Print the ecap that's unknown, not the last cap we saw
- Print actual config offset, which provides enough info to make
some sense of the error.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/vfio/vfio_pci_config.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
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;
}
next reply other threads:[~2010-11-02 5:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 5:08 Alex Williamson [this message]
2010-11-02 19:11 ` [PATCH] vfio: Extended capability fixes Michael S. Tsirkin
2010-11-02 22:19 ` Tom Lyon
2010-11-02 22:18 ` Tom Lyon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101102050835.2963.63375.stgit@s20.home \
--to=alex.williamson@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pugs@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox