Re: [PATCH] qemu-kvm: device assignment: add 82599 PCIe Cap struct quirk
Michael S. Tsirkin <mst <at> redhat.com>
2011-10-02 09:56:35 GMT
On Wed, Sep 28, 2011 at 08:20:33PM -0400, Donald Dutile wrote:
> commit f9c29774d2174df6ffc20becec20928948198914
> changed the PCIe Capability structure version check
> from if > 2 fail, to if ==1, size=x, if ==2, size=y,
> else fail.
> Turns out the 82599's VF has an errata where it's
> PCIe Cap struct version is 0, which now fails device assignment
> due to the else fallout, where before, it would blissfully work.
>
> Add a quirk if version=0, & intel-82599, set size to version 2 struct.
>
> Signed-off-by: Donald_Dutile <ddutile <at> redhat.com>
Makes sense.
Nit: please use PCI_VENDOR_ID_INTEL instead of 0x8086 below.
> ---
> hw/device-assignment.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index 288f80c..ed2a883 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> <at> <at> -1261,12 +1261,20 <at> <at> static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
>
> if ((pos = pci_find_cap_offset(pci_dev, PCI_CAP_ID_EXP, 0))) {
> uint8_t version, size;
> - uint16_t type, devctl, lnkcap, lnksta;
(Continue reading)