Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-28 Thread Stefano Stabellini
On Tue, 28 Jul 2020, Roger Pau Monné wrote: > On Mon, Jul 27, 2020 at 05:06:25PM -0700, Stefano Stabellini wrote: > > On Mon, 27 Jul 2020, Roger Pau Monné wrote: > > > On Sat, Jul 25, 2020 at 10:59:50AM +0100, Julien Grall wrote: > > > > On Sat, 25 Jul 2020 at 00:46, Stefano Stabellini > > > >

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-28 Thread Roger Pau Monné
On Mon, Jul 27, 2020 at 05:06:25PM -0700, Stefano Stabellini wrote: > On Mon, 27 Jul 2020, Roger Pau Monné wrote: > > On Sat, Jul 25, 2020 at 10:59:50AM +0100, Julien Grall wrote: > > > On Sat, 25 Jul 2020 at 00:46, Stefano Stabellini > > > wrote: > > > > > > > > On Fri, 24 Jul 2020, Julien

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-28 Thread Roger Pau Monné
On Tue, Jul 28, 2020 at 08:06:17AM +, Rahul Singh wrote: > > > > On 24 Jul 2020, at 3:44 pm, Roger Pau Monné wrote: > > > > On Thu, Jul 23, 2020 at 04:40:21PM +0100, Rahul Singh wrote: > >> + > >> +struct pci_host_bridge *bridge = pci_find_host_bridge(sbdf.seg, > >> sbdf.bus); > >> +

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-28 Thread Rahul Singh
> On 24 Jul 2020, at 3:44 pm, Roger Pau Monné wrote: > > On Thu, Jul 23, 2020 at 04:40:21PM +0100, Rahul Singh wrote: >> XEN during boot will read the PCI device tree node “reg” property >> and will map the PCI config space to the XEN memory. >> >> XEN will read the “linux, pci-domain”

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Stefano Stabellini
On Mon, 27 Jul 2020, Roger Pau Monné wrote: > On Sat, Jul 25, 2020 at 10:59:50AM +0100, Julien Grall wrote: > > On Sat, 25 Jul 2020 at 00:46, Stefano Stabellini > > wrote: > > > > > > On Fri, 24 Jul 2020, Julien Grall wrote: > > > > On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini > > > >

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Rahul Singh
> On 24 Jul 2020, at 9:23 am, Julien Grall wrote: > > Hi Rahul, > > On 23/07/2020 16:40, Rahul Singh wrote: >> XEN during boot will read the PCI device tree node “reg” property >> and will map the PCI config space to the XEN memory. >> XEN will read the “linux, pci-domain” property from the

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Rahul Singh
> On 24 Jul 2020, at 9:05 am, Julien Grall wrote: > > Hi, > > On 24/07/2020 08:03, Oleksandr Andrushchenko wrote: diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c new file mode 100644 index 00..c53ef58336 --- /dev/null +++

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Rahul Singh
> On 24 Jul 2020, at 8:03 am, Oleksandr Andrushchenko > wrote: > > > On 7/24/20 2:38 AM, Stefano Stabellini wrote: >> + Jan, Andrew, Roger >> >> Please have a look at my comment on whether we should share the MMCFG >> code below, feel free to ignore the rest :-) >> >> >> On Thu, 23 Jul

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Rahul Singh
> On 24 Jul 2020, at 12:38 am, Stefano Stabellini > wrote: > > + Jan, Andrew, Roger > > Please have a look at my comment on whether we should share the MMCFG > code below, feel free to ignore the rest :-) > > > On Thu, 23 Jul 2020, Rahul Singh wrote: >> XEN during boot will read the PCI

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Roger Pau Monné
On Sat, Jul 25, 2020 at 10:59:50AM +0100, Julien Grall wrote: > On Sat, 25 Jul 2020 at 00:46, Stefano Stabellini > wrote: > > > > On Fri, 24 Jul 2020, Julien Grall wrote: > > > On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini > > > wrote: > > > > > If they are not equal, then I fail to see why

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-27 Thread Roger Pau Monné
On Fri, Jul 24, 2020 at 05:54:20PM +0100, Julien Grall wrote: > Hi Jan, > > On 24/07/2020 17:01, Jan Beulich wrote: > > On 24.07.2020 17:15, Julien Grall wrote: > > > On 24/07/2020 15:44, Roger Pau Monné wrote: > > > > > + > > > > > +struct pci_host_bridge *bridge =

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-26 Thread Jan Beulich
On 25.07.2020 01:46, Stefano Stabellini wrote: > On Fri, 24 Jul 2020, Julien Grall wrote: >> On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini >> wrote: If they are not equal, then I fail to see why it would be useful to have this value in Xen. >>> >>> I think that's because the

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-25 Thread Julien Grall
On Sat, 25 Jul 2020 at 00:46, Stefano Stabellini wrote: > > On Fri, 24 Jul 2020, Julien Grall wrote: > > On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini > > wrote: > > > > If they are not equal, then I fail to see why it would be useful to > > > > have this > > > > value in Xen. > > > > > > I

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Stefano Stabellini
On Fri, 24 Jul 2020, Julien Grall wrote: > On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini > wrote: > > > If they are not equal, then I fail to see why it would be useful to have > > > this > > > value in Xen. > > > > I think that's because the domain is actually more convenient to use > >

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
On Fri, 24 Jul 2020 at 19:32, Stefano Stabellini wrote: > > If they are not equal, then I fail to see why it would be useful to have > > this > > value in Xen. > > I think that's because the domain is actually more convenient to use > because a segment can span multiple PCI host bridges. So my >

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Stefano Stabellini
On Fri, 24 Jul 2020, Julien Grall wrote: > On 24/07/2020 18:41, Stefano Stabellini wrote: > > On Fri, 24 Jul 2020, Julien Grall wrote: > > > On 24/07/2020 00:38, Stefano Stabellini wrote: > > > The segment number is just a value defined by the software. So as long as > > > Linux and Xen agrees

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
On 24/07/2020 18:41, Stefano Stabellini wrote: On Fri, 24 Jul 2020, Julien Grall wrote: On 24/07/2020 00:38, Stefano Stabellini wrote: The segment number is just a value defined by the software. So as long as Linux and Xen agrees with the number, then we should be ok. As far as I

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Stefano Stabellini
On Fri, 24 Jul 2020, Julien Grall wrote: > > > > +list_add_tail(>node, _host_bridges); > > > It looks like _host_bridges should be an ordered list, ordered by > > > segment number? > > > > Why? Do you expect bridge access in some specific order so ordered > > > > list will make it faster? >

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Stefano Stabellini
On Fri, 24 Jul 2020, Julien Grall wrote: > On 24/07/2020 00:38, Stefano Stabellini wrote: > > > +bridge->dt_node = dev; > > > +bridge->sysdata = cfg; > > > +bridge->ops = >pci_ops; > > > + > > > +if( !dt_property_read_u32(dev, "linux,pci-domain", ) ) > > > +{ > > > +

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
Hi Jan, On 24/07/2020 17:01, Jan Beulich wrote: On 24.07.2020 17:15, Julien Grall wrote: On 24/07/2020 15:44, Roger Pau Monné wrote: + +struct pci_host_bridge *bridge = pci_find_host_bridge(sbdf.seg, sbdf.bus); + +if ( unlikely(!bridge) ) +{ +printk(XENLOG_ERR "Unable to

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Jan Beulich
On 24.07.2020 17:15, Julien Grall wrote: > On 24/07/2020 15:44, Roger Pau Monné wrote: >>> + >>> +struct pci_host_bridge *bridge = pci_find_host_bridge(sbdf.seg, >>> sbdf.bus); >>> + >>> +if ( unlikely(!bridge) ) >>> +{ >>> +printk(XENLOG_ERR "Unable to find bridge for

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
On 24/07/2020 16:29, Roger Pau Monné wrote: On Fri, Jul 24, 2020 at 04:15:47PM +0100, Julien Grall wrote: On 24/07/2020 15:44, Roger Pau Monné wrote: diff --git a/xen/arch/arm/pci/Makefile b/xen/arch/arm/pci/Makefile new file mode 100644 index 00..358508b787 --- /dev/null +++

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Roger Pau Monné
On Fri, Jul 24, 2020 at 05:29:05PM +0200, Roger Pau Monné wrote: > On Fri, Jul 24, 2020 at 04:15:47PM +0100, Julien Grall wrote: > > > > > > On 24/07/2020 15:44, Roger Pau Monné wrote: > > > > + > > > > +if ( acpi_disabled ) > > > > +dt_pci_init(); > > > > +else > > > > +

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Roger Pau Monné
On Fri, Jul 24, 2020 at 04:15:47PM +0100, Julien Grall wrote: > > > On 24/07/2020 15:44, Roger Pau Monné wrote: > > > diff --git a/xen/arch/arm/pci/Makefile b/xen/arch/arm/pci/Makefile > > > new file mode 100644 > > > index 00..358508b787 > > > --- /dev/null > > > +++

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
On 24/07/2020 15:44, Roger Pau Monné wrote: diff --git a/xen/arch/arm/pci/Makefile b/xen/arch/arm/pci/Makefile new file mode 100644 index 00..358508b787 --- /dev/null +++ b/xen/arch/arm/pci/Makefile @@ -0,0 +1,4 @@ +obj-y += pci.o +obj-y += pci-host-generic.o +obj-y +=

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Roger Pau Monné
On Thu, Jul 23, 2020 at 04:40:21PM +0100, Rahul Singh wrote: > XEN during boot will read the PCI device tree node “reg” property > and will map the PCI config space to the XEN memory. > > XEN will read the “linux, pci-domain” property from the device tree > node and configure the host bridge

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
Hi, On 24/07/2020 00:38, Stefano Stabellini wrote: +bridge->dt_node = dev; +bridge->sysdata = cfg; +bridge->ops = >pci_ops; + +if( !dt_property_read_u32(dev, "linux,pci-domain", ) ) +{ +printk(XENLOG_ERR "\"linux,pci-domain\" property in not available in DT\n"); +

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
Hi Rahul, On 23/07/2020 16:40, Rahul Singh wrote: XEN during boot will read the PCI device tree node “reg” property and will map the PCI config space to the XEN memory. XEN will read the “linux, pci-domain” property from the device tree node and configure the host bridge segment number

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Julien Grall
Hi, On 24/07/2020 08:03, Oleksandr Andrushchenko wrote: diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c new file mode 100644 index 00..c53ef58336 --- /dev/null +++ b/xen/arch/arm/pci/pci-access.c @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2020 Arm Ltd. I think

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-24 Thread Oleksandr Andrushchenko
On 7/24/20 2:38 AM, Stefano Stabellini wrote: > + Jan, Andrew, Roger > > Please have a look at my comment on whether we should share the MMCFG > code below, feel free to ignore the rest :-) > > > On Thu, 23 Jul 2020, Rahul Singh wrote: >> XEN during boot will read the PCI device tree node “reg”

Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-23 Thread Stefano Stabellini
+ Jan, Andrew, Roger Please have a look at my comment on whether we should share the MMCFG code below, feel free to ignore the rest :-) On Thu, 23 Jul 2020, Rahul Singh wrote: > XEN during boot will read the PCI device tree node “reg” property > and will map the PCI config space to the XEN

[RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM.

2020-07-23 Thread Rahul Singh
XEN during boot will read the PCI device tree node “reg” property and will map the PCI config space to the XEN memory. XEN will read the “linux, pci-domain” property from the device tree node and configure the host bridge segment number accordingly. As of now "pci-host-ecam-generic" compatible