]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
arm: Unmap virtual GIC on cell destruction
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 13 Jul 2015 07:06:54 +0000 (09:06 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 14 Jul 2015 06:06:46 +0000 (08:06 +0200)
This fixes a leak on cell destruction because we left the GICv2 mapped,
thus didn't free all paging structures. This also means we need to run
the irqchip cleanup before the cell MMU destruction.

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

index bfd79c09fd5f7e8bab411996eeda2aef45aee4f1..a0777369ab05eef27b4ebdc52119757113936e47 100644 (file)
@@ -366,8 +366,6 @@ void arch_cell_destroy(struct cell *cell)
        unsigned int cpu;
        struct per_cpu *percpu;
 
-       arch_mmu_cell_destroy(cell);
-
        for_each_cpu(cpu, cell->cpu_set) {
                percpu = per_cpu(cpu);
                /* Re-assign the physical IDs for the root cell */
@@ -376,6 +374,8 @@ void arch_cell_destroy(struct cell *cell)
        }
 
        irqchip_cell_exit(cell);
+
+       arch_mmu_cell_destroy(cell);
 }
 
 /* Note: only supports synchronous flushing as triggered by config_commit! */
index a87894f65e7b885dc2b2a3789f917160138dfd03..16937b1b929db7ab2439530d9eb2e57ab2ce5cec 100644 (file)
@@ -198,6 +198,8 @@ static int gic_cell_init(struct cell *cell)
 
 static void gic_cell_exit(struct cell *cell)
 {
+       paging_destroy(&cell->arch.mm, (unsigned long)gicc_base, gicc_size,
+                      PAGING_NON_COHERENT);
        /* Reset interrupt routing of the cell's spis */
        gic_target_spis(cell, &root_cell);
 }