Skip to content

Commit 03a28dc

Browse files
Lorenzo PieralisiMarc Zyngier
authored andcommitted
irqchip/gic-v5: Enable GICv5 SMP booting
Set up IPIs by allocating IPI IRQs for all cpus and call into arm64 core code to initialise IPIs IRQ descriptors and request the related IRQ. Implement hotplug callback to enable interrupts on a cpu and register the cpu with an IRS. Co-developed-by: Sascha Bischoff <sascha.bischoff@arm.com> Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Co-developed-by: Timothy Hayes <timothy.hayes@arm.com> Signed-off-by: Timothy Hayes <timothy.hayes@arm.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20250703-gicv5-host-v7-23-12e71f1b3528@kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 0f01013 commit 03a28dc

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

drivers/irqchip/irq-gic-v5.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#define pr_fmt(fmt) "GICv5: " fmt
77

8+
#include <linux/cpuhotplug.h>
89
#include <linux/idr.h>
910
#include <linux/irqdomain.h>
1011
#include <linux/slab.h>
@@ -918,6 +919,8 @@ static void gicv5_cpu_enable_interrupts(void)
918919
write_sysreg_s(cr0, SYS_ICC_CR0_EL1);
919920
}
920921

922+
static int base_ipi_virq;
923+
921924
static int gicv5_starting_cpu(unsigned int cpu)
922925
{
923926
if (WARN(!gicv5_cpuif_has_gcie(),
@@ -929,6 +932,22 @@ static int gicv5_starting_cpu(unsigned int cpu)
929932
return gicv5_irs_register_cpu(cpu);
930933
}
931934

935+
static void __init gicv5_smp_init(void)
936+
{
937+
unsigned int num_ipis = GICV5_IPIS_PER_CPU * nr_cpu_ids;
938+
939+
cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_GIC_STARTING,
940+
"irqchip/arm/gicv5:starting",
941+
gicv5_starting_cpu, NULL);
942+
943+
base_ipi_virq = irq_domain_alloc_irqs(gicv5_global_data.ipi_domain,
944+
num_ipis, NUMA_NO_NODE, NULL);
945+
if (WARN(base_ipi_virq <= 0, "IPI IRQ allocation was not successful"))
946+
return;
947+
948+
set_smp_ipi_range_percpu(base_ipi_virq, GICV5_IPIS_PER_CPU, nr_cpu_ids);
949+
}
950+
932951
static void __init gicv5_free_domains(void)
933952
{
934953
if (gicv5_global_data.ppi_domain)
@@ -1050,6 +1069,8 @@ static int __init gicv5_of_init(struct device_node *node, struct device_node *pa
10501069
if (ret)
10511070
goto out_int;
10521071

1072+
gicv5_smp_init();
1073+
10531074
return 0;
10541075

10551076
out_int:

0 commit comments

Comments
 (0)