Skip to contentSkip to conversation

xen/arm: Use the right GICD register to initialize IRQs routing

PATCH Superseded Julien Grall 2 participants 2 messages Jun 13, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Use the right GICD register to initialize IRQs routing

Currently IRQs routing is initialized to the wrong register and overwrites interrupt configuration register (ICFGRn).
Furthermore, the register describes target CPUs for 4 interrupts, update the cpumask variable to also redirect the last interrupts to the current cpu.

---
 xen/arch/arm/gic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/arm/gic.c +2 -1
index a7a70b8..181e12a 100644
@@ -274,6 +274,7 @@ static void __init gic_dist_init(void)
 
     cpumask |= cpumask << 8;
     cpumask |= cpumask << 16;
+    cpumask |= cpumask << 24;
 
     /* Disable the distributor */
     GICD[GICD_CTLR] = 0;
@@ -292,7 +293,7 @@ static void __init gic_dist_init(void)
 
     /* Route all global IRQs to this CPU */
     for ( i = 32; i < gic.lines; i += 4 )
-        GICD[GICD_ICFGR + i / 4] = cpumask;
+        GICD[GICD_ITARGETSR + i / 4] = cpumask;
 
     /* Default priority for global interrupts */
     for ( i = 32; i < gic.lines; i += 4 )
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 17 lines · Julien Grall

Currently IRQs routing is initialized to the wrong register and overwrites interrupt configuration register (ICFGRn).
Furthermore, the register describes target CPUs for 4 interrupts, update the cpumask variable to also redirect the last interrupts to the current cpu.

---
 xen/arch/arm/gic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/arm/gic.c +0 -0
index a7a70b8..181e12a 100644

xen/arch/arm/gic.c static void __init gic_dist_init(void) · line 277

Quoted 4 lines
xen/arch/arm/gic.c +1 -0
@@ -274,6 +274,7 @@ static void __init gic_dist_init(void)
 
     cpumask |= cpumask << 8;
     cpumask |= cpumask << 16;
+    cpumask |= cpumask << 24;

This is a bit tricky but given cpumask == 0xAA then:

        cpumask |= cpumask << 8  : cpumask is now 0xAAAA
        cpumask |= cpumask << 16  : cpumask is now 0xAAAAAAAA

IOW I think the existing code is correct.

Quoted 12 lines
xen/arch/arm/gic.c +1 -1
     /* Disable the distributor */
     GICD[GICD_CTLR] = 0;
@@ -292,7 +293,7 @@ static void __init gic_dist_init(void)
 
     /* Route all global IRQs to this CPU */
     for ( i = 32; i < gic.lines; i += 4 )
-        GICD[GICD_ICFGR + i / 4] = cpumask;
+        GICD[GICD_ITARGETSR + i / 4] = cpumask;
 
     /* Default priority for global interrupts */
     for ( i = 32; i < gic.lines; i += 4 )