[Qemu-devel] [RFC for-2.10 0/3] Rework handling of PCI/PCIe "hybrid" devices

David Gibson posted 3 patches 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170328021651.19350-1-david@gibson.dropbear.id.au
Test checkpatch failed
Test docker passed
Test s390x passed
hw/pci/pci.c              | 14 ++++++++++++++
hw/ppc/spapr_pci.c        |  9 +++++++++
hw/usb/hcd-xhci.c         |  2 +-
hw/virtio/virtio-pci.c    |  3 +--
include/hw/pci/pci.h      |  1 +
include/hw/pci/pci_host.h |  1 +
tests/virtio-9p-test.c    |  2 +-
tests/virtio-blk-test.c   |  4 ++--
tests/virtio-net-test.c   |  2 +-
tests/virtio-scsi-test.c  |  2 +-
10 files changed, 32 insertions(+), 8 deletions(-)
[Qemu-devel] [RFC for-2.10 0/3] Rework handling of PCI/PCIe "hybrid" devices
Posted by David Gibson 7 years ago
A couple of devices - virtio-pci and XHCI - can present themselves to
the guest as either PCI or PCIe devices depending on how they're
attached.  However, the logic is a little different between the two
devices.  In addition the logic in virtio makes it difficult to put a
PCIe virtio device into a "pseries" guest because of the unusual way
the paravirtualized PCI bus works there.

This series makes the logic more consistent, and allows per-machine
overrides to address that.

Currently patch 3/3 shows a non-obvious side effect of this change.  A
PCIe virtio device is, by default, modern mode only, but the qtest
logic doesn't handle modern-only virtio devices correctly.  We work
around this by explicitly adding disable-legacy=off to the testcases.
It would probably be better to update libqos so that it can handle
modern virtio devices.

David Gibson (3):
  pci/pcie: Make a consistent helper for switching PCI/PCIe "hybrid"
    devices
  pci: Allow host bridges to override PCI/PCIe hybrid device behaviour
  pseries: Allow PCIe virtio and XHCI on pseries machine type

 hw/pci/pci.c              | 14 ++++++++++++++
 hw/ppc/spapr_pci.c        |  9 +++++++++
 hw/usb/hcd-xhci.c         |  2 +-
 hw/virtio/virtio-pci.c    |  3 +--
 include/hw/pci/pci.h      |  1 +
 include/hw/pci/pci_host.h |  1 +
 tests/virtio-9p-test.c    |  2 +-
 tests/virtio-blk-test.c   |  4 ++--
 tests/virtio-net-test.c   |  2 +-
 tests/virtio-scsi-test.c  |  2 +-
 10 files changed, 32 insertions(+), 8 deletions(-)

-- 
2.9.3


Re: [Qemu-devel] [RFC for-2.10 0/3] Rework handling of PCI/PCIe "hybrid" devices
Posted by Eduardo Habkost 6 years, 7 months ago
On Tue, Mar 28, 2017 at 01:16:48PM +1100, David Gibson wrote:
> A couple of devices - virtio-pci and XHCI - can present themselves to
> the guest as either PCI or PCIe devices depending on how they're
> attached.  However, the logic is a little different between the two
> devices.  In addition the logic in virtio makes it difficult to put a
> PCIe virtio device into a "pseries" guest because of the unusual way
> the paravirtualized PCI bus works there.

virtio-pci and xhci are not the only hybrid devices.  What about
vmxnet3, pvscsi, and vfio-pci?

> 
> This series makes the logic more consistent, and allows per-machine
> overrides to address that.
> 
> Currently patch 3/3 shows a non-obvious side effect of this change.  A
> PCIe virtio device is, by default, modern mode only, but the qtest
> logic doesn't handle modern-only virtio devices correctly.  We work
> around this by explicitly adding disable-legacy=off to the testcases.
> It would probably be better to update libqos so that it can handle
> modern virtio devices.
> 
> David Gibson (3):
>   pci/pcie: Make a consistent helper for switching PCI/PCIe "hybrid"
>     devices
>   pci: Allow host bridges to override PCI/PCIe hybrid device behaviour
>   pseries: Allow PCIe virtio and XHCI on pseries machine type
> 
>  hw/pci/pci.c              | 14 ++++++++++++++
>  hw/ppc/spapr_pci.c        |  9 +++++++++
>  hw/usb/hcd-xhci.c         |  2 +-
>  hw/virtio/virtio-pci.c    |  3 +--
>  include/hw/pci/pci.h      |  1 +
>  include/hw/pci/pci_host.h |  1 +
>  tests/virtio-9p-test.c    |  2 +-
>  tests/virtio-blk-test.c   |  4 ++--
>  tests/virtio-net-test.c   |  2 +-
>  tests/virtio-scsi-test.c  |  2 +-
>  10 files changed, 32 insertions(+), 8 deletions(-)
> 
> -- 
> 2.9.3
> 
> 

-- 
Eduardo