[PATCH v1 2/4] arm/gic: Use static irqaction

Mykyta Poturai posted 4 patches 2 weeks, 2 days ago
There is a newer version of this series
[PATCH v1 2/4] arm/gic: Use static irqaction
Posted by Mykyta Poturai 2 weeks, 2 days ago
When stopping a core cpu_gic_callback is called in non-alloc
context, which causes xfree in release_irq to fail an assert.

To fix this, switch to a statically allocated irqaction that does not
need to be freed in release_irq.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
 xen/arch/arm/gic.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 260ee64cca..b00747a250 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -386,10 +386,16 @@ void gic_dump_info(struct vcpu *v)
     gic_hw_ops->dump_state(v);
 }
 
+static struct irqaction __read_mostly irq_maintenance = {
+    .name = "irq-maintenance",
+    .handler = maintenance_interrupt,
+    .dev_id = NULL,
+    .free_on_release = 0,
+};
+
 void init_maintenance_interrupt(void)
 {
-    request_irq(gic_hw_ops->info->maintenance_irq, 0, maintenance_interrupt,
-                "irq-maintenance", NULL);
+    setup_irq(gic_hw_ops->info->maintenance_irq, 0, &irq_maintenance);
 }
 
 int gic_make_hwdom_dt_node(const struct domain *d,
-- 
2.34.1