xen/arm: Initialize the domain vgic lock
PATCH 1/1 xen/arm: Initialize the domain vgic lock
The domain vgic lock is used uninitialized.
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.
There is no harm to apply for Xen 4.5 because it will correctly set the spin_lock structure for a later usage.
--- xen/arch/arm/vgic.c | 2 ++ 1 file changed, 2 insertions(+)
xen/arch/arm/vgic.c +2 -0
@@ -90,6 +90,8 @@ int domain_vgic_init(struct domain *d)return -ENODEV ; } +spin_lock_init (&d->arch.vgic.lock); + d->arch.vgic.shared_irqs = xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));if ( d->arch.vgic.shared_irqs ==NULL )
Signature · 1 line
2.1.3
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>
Quoted 7 lines
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.There is no harm to apply for Xen 4.5 because it will correctly set the
spin_lockstructure for a later usage.
By your above reasoning there is also no point, is there? That said, I think we should take this since as you say it is harmless and good practice to initialise spinlocks even if not strictly necessary.
Quoted 17 lines
--- xen/arch/arm/vgic.c | 2 ++ 1 file changed, 2 insertions(+)xen/arch/arm/vgic.c +2
-0@@ -90,6 +90,8 @@ int domain_vgic_init(struct domain *d)return -ENODEV ; } +spin_lock_init (&d->arch.vgic.lock); + d->arch.vgic.shared_irqs = xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));if ( d->arch.vgic.shared_irqs ==NULL )
Hi Ian,
Quoted 12 lines · Ian Campbell
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Quoted 5 lines
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.
Quoted 6 lines
Quoted 2 lines
There is no harm to apply for Xen 4.5 because it will correctly set the
spin_lockstructure for a later usage.By your above reasoning there is also no point, is there? That said, I think we should take this since as you say it is harmless and good practice to initialise spinlocks even if not strictly necessary.
It's necessary to initialize spinlocks, not all the field of the spinlock is using the value 0 at initialization time.
What I meant if the current usage is fine. But if we want to debug spinlock, it won't work.
Regards,
Signature · 1 line
Julien Grall
Quoted 18 lines · Julien Grall
Hi Ian,
Quoted 15 lines · Ian Campbell
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Quoted 7 lines
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.There is no harm to apply for Xen 4.5 because it will correctly set the
spin_lockstructure for a later usage.
Quoted 6 lines
Quoted 3 lines
By your above reasoning there is also no point, is there? That said, I think we should take this since as you say it is harmless and good practice to initialise spinlocks even if not strictly necessary.
It's necessary to initialize spinlocks, not all the field of the spinlock is using the value 0 at initialization time.
You said "...we only use the field "raw" which is reset to 0...". Was that statement inaccurate?
Quoted 5 lines
What I meant if the current usage is fine. But if we want to debug spinlock, it won't work.
Regards,
Quoted 23 lines · Ian Campbell
Quoted 22 lines · Julien Grall
Hi Ian,
Quoted 18 lines · Ian Campbell
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Quoted 7 lines
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.There is no harm to apply for Xen 4.5 because it will correctly set the
spin_lockstructure for a later usage.By your above reasoning there is also no point, is there? That said, I think we should take this since as you say it is harmless and good practice to initialise spinlocks even if not strictly necessary.
Quoted 5 lines
Quoted 2 lines
It's necessary to initialize spinlocks, not all the field of the spinlock is using the value 0 at initialization time.
You said "...we only use the field "raw" which is reset to 0...". Was that statement inaccurate?
It's accurate in the current. I should have give more details earlier, sorry.
Regards,
Signature · 1 line
Julien Grall
Quoted 6 lines · Ian Campbell
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>
Quoted 33 lines
Quoted 8 lines
---
This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used unitialized. Luckily we only use the field "raw" which is reset to 0 during the domain allocation.There is no harm to apply for Xen 4.5 because it will correctly set the
spin_lockstructure for a later usage.By your above reasoning there is also no point, is there? That said, I think we should take this since as you say it is harmless and good practice to initialise spinlocks even if not strictly necessary.
Quoted 17 lines
--- xen/arch/arm/vgic.c | 2 ++ 1 file changed, 2 insertions(+)xen/arch/arm/vgic.c +2
-0@@ -90,6 +90,8 @@ int domain_vgic_init(struct domain *d)return -ENODEV ; } +spin_lock_init (&d->arch.vgic.lock); + d->arch.vgic.shared_irqs = xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));if ( d->arch.vgic.shared_irqs ==NULL )
Ian Campbell
AppliedQuoted 9 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Ian Campbell
Quoted 3 lines · Julien Grall
The domain vgic lock is used uninitialized.
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Release-Acked-by Konrad Rzeszutek Wilk <[email protected]>
Applied.