Re: [PATCH] vfio/pci: Some buggy virtual functions incorrectly report 1 for intx.

From: Alex Williamson
Date: Wed Sep 19 2018 - 18:47:46 EST


On Wed, 19 Sep 2018 22:25:03 +0000
"Eads, Gage" <gage.eads@xxxxxxxxx> wrote:

> > This looks good and also addresses Alan's concern that don't
> > silently hide under the rug for all devices. We'll also queue it
> > for testing just to confirm and keep you posted.
> >
> > Reviewed-by: Ashok Raj <ashok.raj@xxxxxxxxx>
> >
>
> Hi Alex,
>
> I've confirmed that the patch works as intended for the 8086:270c
> device, and negative tested the warning by commenting out the
> device's entry in known_bogus_vf_intx_pin.
>
> For what it's worth, my positive test case - launching a QEMU VM with
> a VFIO-owned 0x270c device - did not trigger the warning. This is
> because the change to vfio_pci_config.c caused QEMU to read a
> PCI_INTERRUPT_PIN value of 0, and so didn't execute a codepath that
> calls vfio_pci_get_irq_count(). Instead, I used a simple C program
> that calls the VFIO_DEVICE_GET_IRQ_INFO ioctl for negative testing.
>
> Also, there's one typo in the comment: 'quite' -> 'quiet'
>
> Tested-by: Gage Eads <gage.eads@xxxxxxxxx>

Thanks for the thorough testing, Gage! So it sounds like we're not
quite generating the desired result. We'd really like QEMU, as the
predominant userspace driver for VFIO, to generate the warning,
otherwise there's hardly any purpose to having it. That suggests I
should have put the warning where the config space emulation is setup
rather than the irq count path. Thanks,

Alex