]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
arm: Account for irqchip_cell_exit being called before irqchip_init
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 21 Nov 2014 20:00:28 +0000 (21:00 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 8 Jan 2015 12:01:23 +0000 (13:01 +0100)
If the hypervisor setup procedures fails before irqchip_init was called,
arch_shutdown will still invoke irqchip_cell_exit. If we run this
function, we'll crash latest when trying to access the not yet mapped
GIC. Leave irqchip_cell_exit early in this case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/irqchip.c

index fe8b0f1f4cacff799945fec2264a56a300c257fa..24b59708774fb9914acabd209214a2d9794d6cd2 100644 (file)
@@ -271,6 +271,11 @@ void irqchip_cell_exit(struct cell *cell)
        const struct jailhouse_irqchip *root_pins =
                irqchip_find_config(root_cell.config);
 
+       /* might be called by arch_shutdown while rolling back
+        * a failed setup */
+       if (!irqchip_is_init)
+               return;
+
        if (root_pins)
                root_cell.arch.spis |= cell->arch.spis & root_pins->pin_bitmap;