xen/arm: gic-v3: Bail out if gicv3_cpu_init fail
PATCH 1/1 xen/arm: gic-v3: Bail out if gicv3_cpu_init fail
From: Julien Grall <[email protected]>
When system registers are not enabled, all the access to them will trap in EL2. In Xen, system registers will be enabled by gicv3_cpu_init only on success. As the rest of the code (e.g gicv3_hyp_init) relies on system register, it is better to bail out directly.
This will save time on debugging early boot issue on GICv3 platform.
---
This makes easier to debug early boot issue on GICv3 platform. It would be worth considering to backport it.
--- xen/arch/arm/gic-v3.c | 8 ++++++++ 1 file changed, 8 insertions(+)
xen/arch/arm/gic-v3.c +8 -0
@@ -847,8 +847,12 @@ static int gicv3_secondary_cpu_init(void)spin_lock (&gicv3.lock); res =gicv3_cpu_init (); +if ( res ) + goto out; +gicv3_hyp_init (); +out:spin_unlock (&gicv3.lock);return res;
@@ -1705,8 +1709,12 @@ static int __init gicv3_init(void)panic ("GICv3: ITS: initialization failed: %d\n" , res); res =gicv3_cpu_init (); +if ( res ) + goto out; +gicv3_hyp_init (); +out:spin_unlock (&gicv3.lock);return res;
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 3 lines · Julien Grall
From: Julien Grall <[email protected]>
When system registers are not enabled, all the access to them will trap
^ accesses
Quoted 7 lines
in EL2. In Xen, system registers will be enabled by
gicv3_cpu_initonly on success. As the rest of the code (e.ggicv3_hyp_init) relies on system register, it is better to bail out directly.This will save time on debugging early boot issue on GICv3 platform.
Signed-off-by Julien Grall <[email protected]>
This is good:
Do we also want to print a warning or an error message?
Quoted 41 lines
---
This makes easier to debug early boot issue on GICv3 platform. It would be worth considering to backport it.
--- xen/arch/arm/gic-v3.c | 8 ++++++++ 1 file changed, 8 insertions(+)xen/arch/arm/gic-v3.c +8
-0@@ -847,8 +847,12 @@ static int gicv3_secondary_cpu_init(void)spin_lock (&gicv3.lock); res =gicv3_cpu_init (); +if ( res ) + goto out; +gicv3_hyp_init (); +out:spin_unlock (&gicv3.lock);return res;@@ -1705,8 +1709,12 @@ static int __init gicv3_init(void)panic ("GICv3: ITS: initialization failed: %d\n" , res); res =gicv3_cpu_init (); +if ( res ) + goto out; +gicv3_hyp_init (); +out:spin_unlock (&gicv3.lock);return res;Signature · 1 line
2.11.0
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Stefano,
Quoted 13 lines · Stefano Stabellini
Quoted 3 lines · Julien Grall
From: Julien Grall <[email protected]>
When system registers are not enabled, all the access to them will trap
^ accesses
Quoted 6 lines
in EL2. In Xen, system registers will be enabled by
gicv3_cpu_initonly on success. As the rest of the code (e.ggicv3_hyp_init) relies on system register, it is better to bail out directly.This will save time on debugging early boot issue on GICv3 platform.
Quoted 8 lines
Quoted 1 line
Signed-off-by Julien Grall <[email protected]>This is good:
Reviewed-by Stefano Stabellini <[email protected]>Do we also want to print a warning or an error message?
AFAICT, all the path that return an error in gicv3_cpu_init (and the callers) have already a warning/error message. So no need to add an extra one here.
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 20 lines · Julien Grall
Hi Stefano,
Quoted 17 lines · Stefano Stabellini
Quoted 3 lines · Julien Grall
From: Julien Grall <[email protected]>
When system registers are not enabled, all the access to them will trap
^ accesses
Quoted 7 lines
in EL2. In Xen, system registers will be enabled by
gicv3_cpu_initonly on success. As the rest of the code (e.ggicv3_hyp_init) relies on system register, it is better to bail out directly.This will save time on debugging early boot issue on GICv3 platform.
Signed-off-by Julien Grall <[email protected]>This is good:
Quoted 7 lines
Quoted 4 lines
Reviewed-by Stefano Stabellini <[email protected]>Do we also want to print a warning or an error message?
AFAICT, all the path that return an error in
gicv3_cpu_init(and the callers) have already a warning/error message. So no need to add an extra one here.
committed
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel