Skip to contentSkip to conversation

xen/dt: Allow only IRQ translation that are mapped to main GIC

PATCH In review Julien Grall 1 participant 2 messages Jul 8, 2014 – Jul 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen/dt: Allow only IRQ translation that are mapped to main GIC

Xen is only able to handle one GIC controller. Some platform may contain other interrupt controller.

Make sure to only translate IRQ mapped into the GIC handled by Xen.

---
Changes in v2:
- Fix compilation...

---
 xen/common/device_tree.c | 2 ++
 1 file changed, 2 insertions(+)
xen/common/device_tree.c +2 -0
index 310635e..7178c77 100644
@@ -1444,6 +1444,8 @@ int dt_irq_translate(const struct dt_raw_irq *raw,
     ASSERT(dt_irq_xlate != NULL);
 
     /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+    if ( raw->controller != dt_interrupt_controller )
+        return -EINVAL;
 
     return dt_irq_xlate(raw->specifier, raw->size,
                         &out_irq->irq, &out_irq->type);
Signature · 1 line
1.9.3
#1 lore raw
Quoted 10 lines · Julien Grall

Xen is only able to handle one GIC controller. Some platform may contain other interrupt controller.

Make sure to only translate IRQ mapped into the GIC handled by Xen.

---
Changes in v2:
- Fix compilation...

Please ignore this patch. The problem is bigger than I though. I will send a proper series later.

Quoted 18 lines
---
 xen/common/device_tree.c | 2 ++
 1 file changed, 2 insertions(+)
xen/common/device_tree.c +2 -0
index 310635e..7178c77 100644
@@ -1444,6 +1444,8 @@ int dt_irq_translate(const struct dt_raw_irq *raw,
     ASSERT(dt_irq_xlate != NULL);
 
     /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+    if ( raw->controller != dt_interrupt_controller )
+        return -EINVAL;
 
     return dt_irq_xlate(raw->specifier, raw->size,
                         &out_irq->irq, &out_irq->type);
Signature · 1 line
Julien Grall