diff mbox

[Xen-devel,1/5] xen: arm: propagate gic's #address-cells property to dom0.

Message ID 1414144717-32328-1-git-send-email-ian.campbell@citrix.com
State New
Headers show

Commit Message

Ian Campbell Oct. 24, 2014, 9:58 a.m. UTC
The interrupt-map property requires that the interrupt-parent node
must have both #address-cells and #interrupt-cells properties (see
ePAPR 2.4.3.1). Therefore propagate the property if it is present.

We must propagate (rather than invent our own value) since this value
is used to size fields within other properties within the tree.

ePAPR strictly speaking requires that the interrupt-parent node
always has these properties. However reality has diverged from this
and implementations will recursively search parents for #*-cells
properties. Hence we only copy if it is present.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Julien Grall Oct. 29, 2014, 7:03 p.m. UTC | #1
Hi Ian,

On 24/10/2014 10:58, Ian Campbell wrote:
> The interrupt-map property requires that the interrupt-parent node
> must have both #address-cells and #interrupt-cells properties (see
> ePAPR 2.4.3.1). Therefore propagate the property if it is present.
>
> We must propagate (rather than invent our own value) since this value
> is used to size fields within other properties within the tree.
>
> ePAPR strictly speaking requires that the interrupt-parent node
> always has these properties. However reality has diverged from this
> and implementations will recursively search parents for #*-cells
> properties. Hence we only copy if it is present.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Reviewed-by: Julien Grall <julien.grall@linaro.org>

Without this patch I can't boot Xen on the Foundation model with GIC-v3. 
Is it possible to push this patch for Xen 4.5 rc1?

Regards,
Ian Campbell Oct. 30, 2014, 10:06 a.m. UTC | #2
On Wed, 2014-10-29 at 19:03 +0000, Julien Grall wrote:
> Hi Ian,
> 
> On 24/10/2014 10:58, Ian Campbell wrote:
> > The interrupt-map property requires that the interrupt-parent node
> > must have both #address-cells and #interrupt-cells properties (see
> > ePAPR 2.4.3.1). Therefore propagate the property if it is present.
> >
> > We must propagate (rather than invent our own value) since this value
> > is used to size fields within other properties within the tree.
> >
> > ePAPR strictly speaking requires that the interrupt-parent node
> > always has these properties. However reality has diverged from this
> > and implementations will recursively search parents for #*-cells
> > properties. Hence we only copy if it is present.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> 
> Without this patch I can't boot Xen on the Foundation model with GIC-v3. 
> Is it possible to push this patch for Xen 4.5 rc1?

rc1 is long gone... I'll push for rc2 though.

Ian.
Julien Grall Oct. 30, 2014, 10:31 a.m. UTC | #3
On 30/10/2014 10:06, Ian Campbell wrote:
> On Wed, 2014-10-29 at 19:03 +0000, Julien Grall wrote:
>> Hi Ian,
>>
>> On 24/10/2014 10:58, Ian Campbell wrote:
>>> The interrupt-map property requires that the interrupt-parent node
>>> must have both #address-cells and #interrupt-cells properties (see
>>> ePAPR 2.4.3.1). Therefore propagate the property if it is present.
>>>
>>> We must propagate (rather than invent our own value) since this value
>>> is used to size fields within other properties within the tree.
>>>
>>> ePAPR strictly speaking requires that the interrupt-parent node
>>> always has these properties. However reality has diverged from this
>>> and implementations will recursively search parents for #*-cells
>>> properties. Hence we only copy if it is present.
>>>
>>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>>
>> Reviewed-by: Julien Grall <julien.grall@linaro.org>
>>
>> Without this patch I can't boot Xen on the Foundation model with GIC-v3.
>> Is it possible to push this patch for Xen 4.5 rc1?
>
> rc1 is long gone... I'll push for rc2 though.

Hmm right, I though the first version was rc0 not rc1.
Ian Campbell Nov. 4, 2014, 10:23 a.m. UTC | #4
On Wed, 2014-10-29 at 19:03 +0000, Julien Grall wrote:
> Hi Ian,
> 
> On 24/10/2014 10:58, Ian Campbell wrote:
> > The interrupt-map property requires that the interrupt-parent node
> > must have both #address-cells and #interrupt-cells properties (see
> > ePAPR 2.4.3.1). Therefore propagate the property if it is present.
> >
> > We must propagate (rather than invent our own value) since this value
> > is used to size fields within other properties within the tree.
> >
> > ePAPR strictly speaking requires that the interrupt-parent node
> > always has these properties. However reality has diverged from this
> > and implementations will recursively search parents for #*-cells
> > properties. Hence we only copy if it is present.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> 
> Without this patch I can't boot Xen on the Foundation model with GIC-v3. 
> Is it possible to push this patch for Xen 4.5 rc1?

Konrad, I think this is needed for 4.5 since without it dom0 can fail to
parse certain other constructs within the DT (in bits which we don't
generate and can't easily/don't want to rewrite as we pass them
through).

The risk is that some bit of DT which we do generate relies on this
value being absent (as it was before this patch). I don't believe we
generate any such nodes. The consumers are typically nodes representing
devices which we pass through rather than messing with them.

Ian.
Konrad Rzeszutek Wilk Nov. 4, 2014, 5:11 p.m. UTC | #5
On Tue, Nov 04, 2014 at 10:23:55AM +0000, Ian Campbell wrote:
> On Wed, 2014-10-29 at 19:03 +0000, Julien Grall wrote:
> > Hi Ian,
> > 
> > On 24/10/2014 10:58, Ian Campbell wrote:
> > > The interrupt-map property requires that the interrupt-parent node
> > > must have both #address-cells and #interrupt-cells properties (see
> > > ePAPR 2.4.3.1). Therefore propagate the property if it is present.
> > >
> > > We must propagate (rather than invent our own value) since this value
> > > is used to size fields within other properties within the tree.
> > >
> > > ePAPR strictly speaking requires that the interrupt-parent node
> > > always has these properties. However reality has diverged from this
> > > and implementations will recursively search parents for #*-cells
> > > properties. Hence we only copy if it is present.
> > >
> > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > Reviewed-by: Julien Grall <julien.grall@linaro.org>
> > 
> > Without this patch I can't boot Xen on the Foundation model with GIC-v3. 
> > Is it possible to push this patch for Xen 4.5 rc1?
> 
> Konrad, I think this is needed for 4.5 since without it dom0 can fail to
> parse certain other constructs within the DT (in bits which we don't
> generate and can't easily/don't want to rewrite as we pass them
> through).

Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>


> 
> The risk is that some bit of DT which we do generate relies on this
> value being absent (as it was before this patch). I don't believe we
> generate any such nodes. The consumers are typically nodes representing
> devices which we pass through rather than messing with them.
> 
> Ian.
>
Ian Campbell Nov. 5, 2014, 10:47 a.m. UTC | #6
On Tue, 2014-11-04 at 12:11 -0500, Konrad Rzeszutek Wilk wrote:
> On Tue, Nov 04, 2014 at 10:23:55AM +0000, Ian Campbell wrote:
> > On Wed, 2014-10-29 at 19:03 +0000, Julien Grall wrote:
> > > Hi Ian,
> > > 
> > > On 24/10/2014 10:58, Ian Campbell wrote:
> > > > The interrupt-map property requires that the interrupt-parent node
> > > > must have both #address-cells and #interrupt-cells properties (see
> > > > ePAPR 2.4.3.1). Therefore propagate the property if it is present.
> > > >
> > > > We must propagate (rather than invent our own value) since this value
> > > > is used to size fields within other properties within the tree.
> > > >
> > > > ePAPR strictly speaking requires that the interrupt-parent node
> > > > always has these properties. However reality has diverged from this
> > > > and implementations will recursively search parents for #*-cells
> > > > properties. Hence we only copy if it is present.
> > > >
> > > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > > 
> > > Reviewed-by: Julien Grall <julien.grall@linaro.org>
> > > 
> > > Without this patch I can't boot Xen on the Foundation model with GIC-v3. 
> > > Is it possible to push this patch for Xen 4.5 rc1?
> > 
> > Konrad, I think this is needed for 4.5 since without it dom0 can fail to
> > parse certain other constructs within the DT (in bits which we don't
> > generate and can't easily/don't want to rewrite as we pass them
> > through).
> 
> Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Applied, thanks.

Ian.
diff mbox

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 5aca925..de180d8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -788,6 +788,8 @@  static int make_gic_node(const struct domain *d, void *fdt,
 {
     const struct dt_device_node *gic = dt_interrupt_controller;
     int res = 0;
+    const void *addrcells;
+    u32 addrcells_len;
 
     /*
      * Xen currently supports only a single GIC. Discard any secondary
@@ -817,6 +819,14 @@  static int make_gic_node(const struct domain *d, void *fdt,
             return res;
     }
 
+    addrcells = dt_get_property(gic, "#address-cells", &addrcells_len);
+    if ( addrcells )
+    {
+        res = fdt_property(fdt, "#address-cells", addrcells, addrcells_len);
+        if ( res )
+            return res;
+    }
+
     res = fdt_end_node(fdt);
 
     return res;