Skip to content

Commit

Permalink
arm: Adjust irqchips only on arch_config_commit
Browse files Browse the repository at this point in the history
Doing this earlier, during arch_cell_create, does not work because the
CPUs have not yet been assigned to their new owner at this point. Should
have noticed earlier: this aligns ARM with x86.

Fixes: 011ab91 ("arm: Rework interrupt affinity management on cell
creation")

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Oct 2, 2016
1 parent be07319 commit 6b1ba6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions hypervisor/arch/arm/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ void arch_flush_cell_vcpu_caches(struct cell *cell)

void arch_config_commit(struct cell *cell_added_removed)
{
irqchip_config_commit(cell_added_removed);
}

void __attribute__((noreturn)) arch_panic_stop(void)
Expand Down
2 changes: 2 additions & 0 deletions hypervisor/arch/arm/include/asm/irqchip.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void irqchip_cpu_shutdown(struct per_cpu *cpu_data);
int irqchip_cell_init(struct cell *cell);
void irqchip_cell_exit(struct cell *cell);

void irqchip_config_commit(struct cell *cell_added_removed);

int irqchip_send_sgi(struct sgi *sgi);
void irqchip_handle_irq(struct per_cpu *cpu_data);
void irqchip_eoi_irq(u32 irqn, bool deactivate);
Expand Down
22 changes: 15 additions & 7 deletions hypervisor/arch/arm/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,6 @@ int irqchip_cell_init(struct cell *cell)
~chip->pin_bitmap[pos];
}

for (n = 32; n < sizeof(cell->arch.irq_bitmap) * 8; n++) {
if (irqchip_irq_in_cell(cell, n))
irqchip.adjust_irq_target(cell, n);
if (irqchip_irq_in_cell(&root_cell, n))
irqchip.adjust_irq_target(&root_cell, n);
}

return 0;
}

Expand Down Expand Up @@ -229,6 +222,21 @@ void irqchip_cell_exit(struct cell *cell)
irqchip.cell_exit(cell);
}

void irqchip_config_commit(struct cell *cell_added_removed)
{
unsigned int n;

if (!cell_added_removed)
return;

for (n = 32; n < sizeof(cell_added_removed->arch.irq_bitmap) * 8; n++) {
if (irqchip_irq_in_cell(cell_added_removed, n))
irqchip.adjust_irq_target(cell_added_removed, n);
if (irqchip_irq_in_cell(&root_cell, n))
irqchip.adjust_irq_target(&root_cell, n);
}
}

int irqchip_init(void)
{
int i, err;
Expand Down

0 comments on commit 6b1ba6d

Please sign in to comment.