Re: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [Qemu-ppc] [RFC PATCH qemu] spapr_pci: Create PCI-express root bus by default

2016-12-01 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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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: [Qemu-devel] [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

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

2016-10-31 Thread David Gibson
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 > >> Alexey Kardashevskiy wrote: > >> > >>> At the moment sPAPR PHB

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

2016-10-30 Thread Alexey Kardashevskiy
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 >> Alexey Kardashevskiy wrote: >> >>> At the moment sPAPR PHB creates a root buf of TYPE_PCI_BUS type. >>> This means that vfio-pci devices

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

2016-10-30 Thread David Gibson
On Fri, Oct 28, 2016 at 12:07:12PM +0200, Greg Kurz wrote: > On Fri, 28 Oct 2016 18:56:40 +1100 > Alexey Kardashevskiy wrote: > > > At the moment sPAPR PHB creates a root buf of TYPE_PCI_BUS type. > > This means that vfio-pci devices attached to it (and this is > > a default

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

2016-10-28 Thread Greg Kurz
On Fri, 28 Oct 2016 18:56:40 +1100 Alexey Kardashevskiy wrote: > At the moment sPAPR PHB creates a root buf of TYPE_PCI_BUS type. > This means that vfio-pci devices attached to it (and this is > a default behaviour) hide PCIe extended capabilities as > the bus does not pass a