intc/arm_gic: Fix gic_irq_signaling_enabled() for vCPUs
cover intc/arm_gic: Fix gic_irq_signaling_enabled() for vCPUs
From: "Edgar E. Iglesias" <[email protected]>
Hi,
Found this while debugging an issue with lockups during boot of Linux on Xen.
In the particular setup, I'm running without EL3 firmware so group0 interrupts are disabled on the physical interface and enabled on the virtual interface.
Looks like we're checking the wrong CPU_CTLR reg for vCPUs. This fixes the problem on my side.
Cheers,
Edgar
Edgar E. Iglesias (1):
intc/arm_gic: Fix gic_irq_signaling_enabled() for vCPUs
hw/intc/arm_gic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
PATCH 1/1 intc/arm_gic: Fix gic_irq_signaling_enabled() for vCPUs
From: "Edgar E. Iglesias" <[email protected]>
Correct the indexing into s->cpu_ctlr for vCPUs.
--- hw/intc/arm_gic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/intc/arm_gic.c +3 -1
@@ -141,6 +141,8 @@ static inline void gic_get_best_virq(GICState *s, int cpu,static inline bool gic_irq_signaling_enabled (GICState *s,int cpu,bool virt,int group_mask) { +int cpu_iface = virt ? (cpu +GIC_NCPU ) : cpu; +if (!virt && !(s->ctlr & group_mask)) {return false; }
@@ -149,7 +151,7 @@ static inline bool gic_irq_signaling_enabled(GICState *s, int cpu, bool virt,return false; } -if (!(s->cpu_ctlr[cpu] & group_mask)) { +if (!(s->cpu_ctlr[cpu_iface] & group_mask)) {return false; }
Signature · 1 line
2.25.1
Quoted 4 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Correct the indexing into
s->cpu_ctlrfor vCPUs.
LGTM but better double-check with GIC specialist ;)
Quoted 28 lines
Signed-off-by Edgar E. Iglesias <[email protected]>--- hw/intc/arm_gic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/intc/arm_gic.c +3
-1@@ -141,6 +141,8 @@ static inline void gic_get_best_virq(GICState *s, int cpu,static inline bool gic_irq_signaling_enabled (GICState *s,int cpu,bool virt,int group_mask) { +int cpu_iface = virt ? (cpu +GIC_NCPU ) : cpu; +if (!virt && !(s->ctlr & group_mask)) {return false; }@@ -149,7 +151,7 @@ static inline bool gic_irq_signaling_enabled(GICState *s, int cpu, bool virt,return false; } -if (!(s->cpu_ctlr[cpu] & group_mask)) { +if (!(s->cpu_ctlr[cpu_iface] & group_mask)) {return false; }
Quoted 5 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Correct the indexing into
s->cpu_ctlrfor vCPUs.Signed-off-by Edgar E. Iglesias <[email protected]>
Hi Edgar,
Nice catch! Thanks.
Signature · 1 line
Luc
Quoted 27 lines
--- hw/intc/arm_gic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/intc/arm_gic.c +3
-1@@ -141,6 +141,8 @@ static inline void gic_get_best_virq(GICState *s, int cpu,static inline bool gic_irq_signaling_enabled (GICState *s,int cpu,bool virt,int group_mask) { +int cpu_iface = virt ? (cpu +GIC_NCPU ) : cpu; +if (!virt && !(s->ctlr & group_mask)) {return false; }@@ -149,7 +151,7 @@ static inline bool gic_irq_signaling_enabled(GICState *s, int cpu, bool virt,return false; } -if (!(s->cpu_ctlr[cpu] & group_mask)) { +if (!(s->cpu_ctlr[cpu_iface] & group_mask)) {return false; }
Peter Maydell
AppliedQuoted 8 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Hi,
Found this while debugging an issue with lockups during boot of Linux on Xen.
Quoted 6 lines
In the particular setup, I'm running without EL3 firmware so group0 interrupts are disabled on the physical interface and enabled on the virtual interface.
Looks like we're checking the wrong
CPU_CTLRreg for vCPUs. This fixes the problem on my side.
Applied to target-arm.next, thanks.
-- PMM