On Thu, 2017-02-16 at 21:14 +0200, Marcel Apfelbaum wrote: > > Wait, actually.. we have two possible directions to go, both of which > > have been mentioned in the thread, but I don't think we've settled on > > one: > > > > 1) Have pseries create a PCIe bus (as my first cut draft does). > > > > That should allow pure PCIe devices to appear either under a port or > > (more usually for PAPR) as "integrated endpoints". In addition we'd > > need as suggested above a "pcie_hybrid_type()" function that would > > tell hybrid devices to also appear as PCIe rather than PCI. > > > > 2) Have pseries create a vanilla PCI bus (or a special PAPR PCI > > variant) > > > > Appearing as vanilla PCI would in a number of ways more closely match > > the way PCI buses are handled on PAPR. However, we still need to > > connect PCIe devices to it. So we'd need some 'bus_accepts_pcie()' > > hook and use that (in place of pci_bus_is_express()) to determine both > > whether we can attach pure PCIe devices and that hybrid devices should > > appear as PCIe rather than plain PCI. > > > > > > Based on the immediately preceding discussion, I was leaning towards > > (2). Is that your feeling as well? > > I also like option (2).
After catching up with the thread, I tend to agree. I've also been thinking about what libvirt would need to do to adapt to the changes proposed here, and I believe the answer to be: not much, really. The current code already places VirtIO devices on the root bus, even though it does so because it assumes pSeries guests are not PCIe capable; same for XHCI, and pretty much all other devices including those assigned through VFIO. Basically, as far as I can tell, the changes proposed here would only affect the guest (eg. ability to access the extended config space), not how the devices would have to be placed on the various buses. Or did I miss something? -- Andrea Bolognani / Red Hat / Virtualization