]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Initialize correctly IRQ routing
authorJulien Grall <julien.grall@linaro.org>
Thu, 26 Sep 2013 11:09:37 +0000 (12:09 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 26 Sep 2013 14:44:45 +0000 (15:44 +0100)
When Xen initialize the GIC distributor, we need to route all the IRQs to
the boot CPU. The CPU ID can differ between Xen and the GIC.

When ITARGETSR0 is read, each field will return a value that corresponds
only to the processor reading the register. So Xen can use the PPI 0 to
initialize correctly the routing.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic.c

index 091eb367258970786a881128052a047f698ddf07..b969d236cc095d6468bc537e033f10cb9647b820 100644 (file)
@@ -258,9 +258,10 @@ void gic_route_dt_irq(const struct dt_irq *irq, const cpumask_t *cpu_mask,
 static void __init gic_dist_init(void)
 {
     uint32_t type;
-    uint32_t cpumask = 1 << smp_processor_id();
+    uint32_t cpumask;
     int i;
 
+    cpumask = GICD[GICD_ITARGETSR] & 0xff;
     cpumask |= cpumask << 8;
     cpumask |= cpumask << 16;