diff mbox

[V1,17/29] xen/arm: Mark each device used by Xen as disabled in DOM0 FDT

Message ID 1377701263-3319-18-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall Aug. 28, 2013, 2:47 p.m. UTC
When a device has a property status with disabled inside, Linux will not use
the device.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Ian Campbell Sept. 9, 2013, 11:37 a.m. UTC | #1
On Wed, 2013-08-28 at 15:47 +0100, Julien Grall wrote:
> When a device has a property status with disabled inside, Linux will not use
> the device.

Do we not filter such devices out already?

Or did the previous patch remove that functionality? In which case is
there a bisection hazard here?

Why is it preferred to leave the device with disabled in it instead of
removing it? (Can this go in the changelog please)

I think I've asked before, but is the handling of status = disabled
generic and therefore reliable?

> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> ---
>  xen/arch/arm/domain_build.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 76decf4..d56bc70a 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -208,6 +208,14 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
>              return res;
>      }
>  
> +    /* Disable all devices used by Xen */
> +    if ( dt_device_used_by(np) == DOMID_XEN )
> +    {
> +        res = fdt_property(kinfo->fdt, "status", "disabled", 8 + 1);
> +        if ( res )
> +            return res;
> +    }
> +
>      /*
>       * XXX should populate /chosen/linux,initrd-{start,end} here if we
>       * have module[2]
Julien Grall Sept. 9, 2013, 9:53 p.m. UTC | #2
On 09/09/2013 12:37 PM, Ian Campbell wrote:
> On Wed, 2013-08-28 at 15:47 +0100, Julien Grall wrote:
>> When a device has a property status with disabled inside, Linux will not use
>> the device.
>
> Do we not filter such devices out already?

We only filter gic/timer node. All the others nodes used by Xen, for 
instance the serial device, will be marked by status = "disabled".

> Or did the previous patch remove that functionality? In which case is
> there a bisection hazard here?

AFAIK, there is no bisection hazard with the current order of this patch 
series.

>
> Why is it preferred to leave the device with disabled in it instead of
> removing it? (Can this go in the changelog please)
> I think I've asked before, but is the handling of status = disabled
> generic and therefore reliable?

I let this patch because I didn't implement all the fake nodes in the 
previous patch series. In another hand, I'm not sure how Linux will 
react if there is a missing node and it should cope with status = 
"disabled" with most of nodes.

I will give a try and see if I can remove completely nodes used by Xen. 
Except, of course, gic and timer nodes which are recreated later.

>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> ---
>>   xen/arch/arm/domain_build.c |    8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 76decf4..d56bc70a 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -208,6 +208,14 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
>>               return res;
>>       }
>>
>> +    /* Disable all devices used by Xen */
>> +    if ( dt_device_used_by(np) == DOMID_XEN )
>> +    {
>> +        res = fdt_property(kinfo->fdt, "status", "disabled", 8 + 1);
>> +        if ( res )
>> +            return res;
>> +    }
>> +
>>       /*
>>        * XXX should populate /chosen/linux,initrd-{start,end} here if we
>>        * have module[2]
>
>
Ian Campbell Sept. 10, 2013, 9:01 a.m. UTC | #3
On Mon, 2013-09-09 at 22:53 +0100, Julien Grall wrote:
> On 09/09/2013 12:37 PM, Ian Campbell wrote:
> > On Wed, 2013-08-28 at 15:47 +0100, Julien Grall wrote:
> >> When a device has a property status with disabled inside, Linux will not use
> >> the device.
> >
> > Do we not filter such devices out already?
> 
> We only filter gic/timer node. All the others nodes used by Xen, for 
> instance the serial device, will be marked by status = "disabled".

Ah, the current code omits devices from the mapping but not the fdt, I
was confusing the two. In the current way of doing things
fdt_next_dom0_node would need a check for the owner, but that's not
relevant with this series.

> > Or did the previous patch remove that functionality? In which case is
> > there a bisection hazard here?
> 
> AFAIK, there is no bisection hazard with the current order of this patch 
> series.

Ack, thanks.

> 
> >
> > Why is it preferred to leave the device with disabled in it instead of
> > removing it? (Can this go in the changelog please)
> > I think I've asked before, but is the handling of status = disabled
> > generic and therefore reliable?
> 
> I let this patch because I didn't implement all the fake nodes in the 
> previous patch series. In another hand, I'm not sure how Linux will 
> react if there is a missing node and it should cope with status = 
> "disabled" with most of nodes.
> 
> I will give a try and see if I can remove completely nodes used by Xen. 
> Except, of course, gic and timer nodes which are recreated later.

If you want you can add that to the end of the series/future work rather
than reworking this patch in the middle of a large series.
diff mbox

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 76decf4..d56bc70a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -208,6 +208,14 @@  static int write_properties(struct domain *d, struct kernel_info *kinfo,
             return res;
     }
 
+    /* Disable all devices used by Xen */
+    if ( dt_device_used_by(np) == DOMID_XEN )
+    {
+        res = fdt_property(kinfo->fdt, "status", "disabled", 8 + 1);
+        if ( res )
+            return res;
+    }
+
     /*
      * XXX should populate /chosen/linux,initrd-{start,end} here if we
      * have module[2]