Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-19 Thread Andrea Bolognani
On Wed, 2016-12-14 at 20:26 +0200, Marcel Apfelbaum wrote: > > > > > > Maybe I just don't quite get the relationship between Root > > > > > > Complexes and Root Buses, but I guess my question is: what > > > > > > is preventing us from simply doing whatever a > > > > > > spapr-pci-host-bridge is

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-15 Thread Benjamin Herrenschmidt
On Wed, 2016-12-14 at 20:26 +0200, Marcel Apfelbaum wrote: > > > The Root complex includes the PCI bus, some configuration > > > registers if > > > needed, provides access to the configuration space, translates > > > relevant CPU > > > reads/writes to PCI(e) transactions... > > > > Do those

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-14 Thread Marcel Apfelbaum
On 12/14/2016 04:46 AM, David Gibson wrote: On Tue, Dec 13, 2016 at 02:25:44PM +0200, Marcel Apfelbaum wrote: On 12/07/2016 06:42 PM, Andrea Bolognani wrote: [Added Marcel to CC] Hi, Sorry for the late reply. On Wed, 2016-12-07 at 15:11 +1100, David Gibson wrote: Is the difference

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-14 Thread Marcel Apfelbaum
On 12/13/2016 05:15 PM, Benjamin Herrenschmidt wrote: On Tue, 2016-12-13 at 14:25 +0200, Marcel Apfelbaum wrote: Hrm, the suggestion of providing both a vanilla-PCI and PCI-E host bridge came up before. I think one of us spotted a problem with that, but I don't recall what it was now. I guess

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-13 Thread David Gibson
On Tue, Dec 13, 2016 at 02:25:44PM +0200, Marcel Apfelbaum wrote: > On 12/07/2016 06:42 PM, Andrea Bolognani wrote: > > [Added Marcel to CC] > > > > > Hi, > > Sorry for the late reply. > > > On Wed, 2016-12-07 at 15:11 +1100, David Gibson wrote: > > > > Is the difference between q35 and

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-13 Thread David Gibson
On Tue, Dec 13, 2016 at 09:15:37AM -0600, Benjamin Herrenschmidt wrote: > On Tue, 2016-12-13 at 14:25 +0200, Marcel Apfelbaum wrote: > > > > Hrm, the suggestion of providing both a vanilla-PCI and PCI-E host > > > > bridge came up before.  I think one of us spotted a problem with that, > > > > but

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-13 Thread Benjamin Herrenschmidt
On Tue, 2016-12-13 at 14:25 +0200, Marcel Apfelbaum wrote: > > > Hrm, the suggestion of providing both a vanilla-PCI and PCI-E host > > > bridge came up before.  I think one of us spotted a problem with that, > > > but I don't recall what it was now.  I guess one is how libvirt would > > > map

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-13 Thread Greg Kurz
On Tue, 13 Dec 2016 14:25:44 +0200 Marcel Apfelbaum wrote: > >> Now... from what Laine was saying it sounds like more of the > >> differences between PCI-E placement and PCI placement may be > >> implemented by libvirt than qemu than I realized. So possibly we do > >> want to

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-13 Thread Marcel Apfelbaum
On 12/07/2016 06:42 PM, Andrea Bolognani wrote: [Added Marcel to CC] Hi, Sorry for the late reply. On Wed, 2016-12-07 at 15:11 +1100, David Gibson wrote: Is the difference between q35 and pseries guests with respect to PCIe only relevant when it comes to assigned devices, or in general?

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-07 Thread Andrea Bolognani
[Added Marcel to CC] On Wed, 2016-12-07 at 15:11 +1100, David Gibson wrote: > > Is the difference between q35 and pseries guests with > > respect to PCIe only relevant when it comes to assigned > > devices, or in general? I'm asking this because you seem to > > focus entirely on assigned devices.

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-06 Thread David Gibson
On Tue, Dec 06, 2016 at 06:30:47PM +0100, Andrea Bolognani wrote: > On Fri, 2016-12-02 at 15:18 +1100, David Gibson wrote: > > > So, would the PCIe Root Bus in a pseries guest behave > > > differently than the one in a q35 or mach-virt guest? > >  > > Yes.  I had a long discussion with BenH and

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-06 Thread David Gibson
On Mon, Dec 05, 2016 at 03:54:49PM -0500, Laine Stump wrote: > (Sorry for any duplicates. I sent it from the wrong address the first time) > > On 12/01/2016 11:18 PM, David Gibson wrote: > > On Fri, Nov 25, 2016 at 02:46:21PM +0100, Andrea Bolognani wrote: > > > On Wed, 2016-11-23 at 16:00 +1100,

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-06 Thread Andrea Bolognani
On Fri, 2016-12-02 at 15:18 +1100, David Gibson wrote: > > So, would the PCIe Root Bus in a pseries guest behave > > differently than the one in a q35 or mach-virt guest? >  > Yes.  I had a long discussion with BenH and got a somewhat better idea > about this. Sorry, but I'm afraid you're going

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-05 Thread Laine Stump
(Sorry for any duplicates. I sent it from the wrong address the first time) On 12/01/2016 11:18 PM, David Gibson wrote: On Fri, Nov 25, 2016 at 02:46:21PM +0100, Andrea Bolognani wrote: On Wed, 2016-11-23 at 16:00 +1100, David Gibson wrote: Existing libvirt versions assume that pseries guests

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-05 Thread Laine Stump
On 12/01/2016 11:18 PM, David Gibson wrote: On Fri, Nov 25, 2016 at 02:46:21PM +0100, Andrea Bolognani wrote: On Wed, 2016-11-23 at 16:00 +1100, David Gibson wrote: Existing libvirt versions assume that pseries guests have a legacy PCI root bus, and will base their PCI address allocation / PCI

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-02 Thread Alexey Kardashevskiy
On 03/12/16 08:41, Benjamin Herrenschmidt wrote: > On Fri, 2016-12-02 at 16:50 +1100, David Gibson wrote: >> >> Uh.. I don't entirely follow you. From the host point of view there >> are multiple iommu groups (PEs), but from the guest point of view >> there's only one. On the guest side iommu

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-02 Thread Benjamin Herrenschmidt
On Fri, 2016-12-02 at 16:50 +1100, David Gibson wrote: > > Uh.. I don't entirely follow you.  From the host point of view there > are multiple iommu groups (PEs), but from the guest point of view > there's only one.  On the guest side iommu granularity is always > per-vPHB. Ok so the H_PUT_TCE

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-02 Thread Benjamin Herrenschmidt
On Fri, 2016-12-02 at 15:18 +1100, David Gibson wrote: > But if you pass through multiple groups, things get weird.  On q35, > you'd generally expect physically separate (different slot) devices to > appear under separate root complexes.  Whereas on pseries they'll > appear as siblings on a

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-02 Thread David Gibson
On Fri, Dec 02, 2016 at 04:17:50PM +1100, Benjamin Herrenschmidt wrote: > On Fri, 2016-12-02 at 15:18 +1100, David Gibson wrote: > > But if you pass through multiple groups, things get weird.  On q35, > > you'd generally expect physically separate (different slot) devices to > > appear under

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-01 Thread David Gibson
On Fri, Nov 25, 2016 at 03:36:25PM +0100, Andrea Bolognani wrote: > On Wed, 2016-11-23 at 16:02 +1100, David Gibson wrote: > > > > The change from OHCI to XHCI only affected the *default* USB > > > > controller, which libvirt tries its best not to use anyway: > > > > instead, it will prefer to use

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-01 Thread David Gibson
On Fri, Nov 25, 2016 at 02:46:21PM +0100, Andrea Bolognani wrote: > On Wed, 2016-11-23 at 16:00 +1100, David Gibson wrote: > > > Existing libvirt versions assume that pseries guests have > > > a legacy PCI root bus, and will base their PCI address > > > allocation / PCI topology decisions on that

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-25 Thread Andrea Bolognani
On Wed, 2016-11-23 at 16:02 +1100, David Gibson wrote: > > > The change from OHCI to XHCI only affected the *default* USB > > > controller, which libvirt tries its best not to use anyway: > > > instead, it will prefer to use '-M ...,usb=off' along with > > > '-device ...' and set both the

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-25 Thread Andrea Bolognani
On Wed, 2016-11-23 at 16:00 +1100, David Gibson wrote: > > Existing libvirt versions assume that pseries guests have > > a legacy PCI root bus, and will base their PCI address > > allocation / PCI topology decisions on that fact: they > > will, for example, use legacy PCI bridges. >  > Um.. yeah..

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-22 Thread David Gibson
On Tue, Nov 22, 2016 at 01:26:49PM +1100, Alexey Kardashevskiy wrote: > On 22/11/16 00:08, Andrea Bolognani wrote: > > On Mon, 2016-11-21 at 13:12 +1100, Alexey Kardashevskiy wrote: > > 1) switch to PCI Express on newer machine types, and > >expose some sort of capability

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-22 Thread David Gibson
On Fri, Nov 18, 2016 at 09:17:22AM +0100, Andrea Bolognani wrote: > On Thu, 2016-11-17 at 13:02 +1100, Alexey Kardashevskiy wrote: > > > That said, considering that a big part of the PCI address > > > allocation logic is based off whether the specific machine > > > type exposes a legay PCI Root

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-22 Thread Eric Blake
On 11/21/2016 07:08 AM, Andrea Bolognani wrote: >> If libvirt is using a specific version of pseries, then it already knows >> that <=2.7 has pci.0 as a root, pcie.0 otherwise. libvirt has a knowledge >> what QEMU version has what, right? > > It doesn't yet, that's the point :) > > We *could*

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-21 Thread Alexey Kardashevskiy
On 22/11/16 00:08, Andrea Bolognani wrote: > On Mon, 2016-11-21 at 13:12 +1100, Alexey Kardashevskiy wrote: > 1) switch to PCI Express on newer machine types, and >expose some sort of capability through QMP so that >libvirt can know about the switch > >

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-21 Thread Andrea Bolognani
On Mon, 2016-11-21 at 13:12 +1100, Alexey Kardashevskiy wrote: > > > >1) switch to PCI Express on newer machine types, and > > > >   expose some sort of capability through QMP so that > > > >   libvirt can know about the switch > > > >  > > > > [...] > > > > Option 1) would break

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-20 Thread Alexey Kardashevskiy
On 18/11/16 19:17, Andrea Bolognani wrote: > On Thu, 2016-11-17 at 13:02 +1100, Alexey Kardashevskiy wrote: >>> That said, considering that a big part of the PCI address >>> allocation logic is based off whether the specific machine >>> type exposes a legay PCI Root Bus or a PCI Express Root Bus,

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-18 Thread David Gibson
On Thu, Nov 17, 2016 at 01:02:57PM +1100, Alexey Kardashevskiy wrote: > On 16/11/16 01:02, Andrea Bolognani wrote: > > On Tue, 2016-11-01 at 13:46 +1100, David Gibson wrote: > >> On Mon, Oct 31, 2016 at 03:10:23PM +1100, Alexey Kardashevskiy wrote: > >>> > >>> On 31/10/16 13:53, David Gibson

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-18 Thread Andrea Bolognani
On Thu, 2016-11-17 at 13:02 +1100, Alexey Kardashevskiy wrote: > > That said, considering that a big part of the PCI address > > allocation logic is based off whether the specific machine > > type exposes a legay PCI Root Bus or a PCI Express Root Bus, > > libvirt will need a way to be able to

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-16 Thread Alexey Kardashevskiy
On 16/11/16 01:02, Andrea Bolognani wrote: > On Tue, 2016-11-01 at 13:46 +1100, David Gibson wrote: >> On Mon, Oct 31, 2016 at 03:10:23PM +1100, Alexey Kardashevskiy wrote: >>> >>> On 31/10/16 13:53, David Gibson wrote: On Fri, Oct 28, 2016 at 12:07:12PM +0200, Greg Kurz wrote: >

Re: [libvirt] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-11-15 Thread Andrea Bolognani
On Tue, 2016-11-01 at 13:46 +1100, David Gibson wrote: > On Mon, Oct 31, 2016 at 03:10:23PM +1100, Alexey Kardashevskiy wrote: > >  > > On 31/10/16 13:53, David Gibson wrote: > > >  > > > On Fri, Oct 28, 2016 at 12:07:12PM +0200, Greg Kurz wrote: > > > >  > > > > On Fri, 28 Oct 2016 18:56:40 +1100