Skip to content

Commit 7d2c204

Browse files
Marc ZyngierKAGA-KOKO
authored andcommitted
irqchip/gic-v4: Always configure affinity on VPE activation
There are currently two paths to set the initial affinity of a VPE: - at activation time on GICv4 without the stupid VMOVP list, and on GICv4.1 - at map time for GICv4 with VMOVP list The latter location may end-up modifying the affinity of VPE that is currently running, making the results unpredictible. Instead, unify the two paths, making sure to set the initial affinity only at activation time. Reported-by: Nianyao Tang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Nianyao Tang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent be5e5f3 commit 7d2c204

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,13 +1809,9 @@ static void its_map_vm(struct its_node *its, struct its_vm *vm)
18091809

18101810
for (i = 0; i < vm->nr_vpes; i++) {
18111811
struct its_vpe *vpe = vm->vpes[i];
1812-
struct irq_data *d = irq_get_irq_data(vpe->irq);
18131812

1814-
/* Map the VPE to the first possible CPU */
1815-
vpe->col_idx = cpumask_first(cpu_online_mask);
18161813
its_send_vmapp(its, vpe, true);
18171814
its_send_vinvall(its, vpe);
1818-
irq_data_update_effective_affinity(d, cpumask_of(vpe->col_idx));
18191815
}
18201816
}
18211817

@@ -4582,6 +4578,10 @@ static int its_vpe_irq_domain_activate(struct irq_domain *domain,
45824578
struct its_vpe *vpe = irq_data_get_irq_chip_data(d);
45834579
struct its_node *its;
45844580

4581+
/* Map the VPE to the first possible CPU */
4582+
vpe->col_idx = cpumask_first(cpu_online_mask);
4583+
irq_data_update_effective_affinity(d, cpumask_of(vpe->col_idx));
4584+
45854585
/*
45864586
* If we use the list map, we issue VMAPP on demand... Unless
45874587
* we're on a GICv4.1 and we eagerly map the VPE on all ITSs
@@ -4590,9 +4590,6 @@ static int its_vpe_irq_domain_activate(struct irq_domain *domain,
45904590
if (!gic_requires_eager_mapping())
45914591
return 0;
45924592

4593-
/* Map the VPE to the first possible CPU */
4594-
vpe->col_idx = cpumask_first(cpu_online_mask);
4595-
45964593
list_for_each_entry(its, &its_nodes, entry) {
45974594
if (!is_v4(its))
45984595
continue;
@@ -4601,8 +4598,6 @@ static int its_vpe_irq_domain_activate(struct irq_domain *domain,
46014598
its_send_vinvall(its, vpe);
46024599
}
46034600

4604-
irq_data_update_effective_affinity(d, cpumask_of(vpe->col_idx));
4605-
46064601
return 0;
46074602
}
46084603

0 commit comments

Comments
 (0)