mirror of
https://github.com/xemu-project/xemu.git
synced 2026-07-11 01:24:41 +02:00
hw/intc/arm_gicv3: Introduce a 'first-cpu-index' property
Introduce a 'first-cpu-index' property for specifying the first QEMU CPU connected to the GICv3. This makes it possible to have multiple instances of the GICv3 connected to different CPU clusters. For KVM, mark this property has unsupported. It probably does not make much sense as it is intented to be used to model non-SMP systems. Signed-off-by: Luc Michel <luc.michel@amd.com> Signed-off-by: Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20250926070806.292065-24-luc.michel@amd.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
6926b0b260
commit
27493e5e68
@@ -436,7 +436,7 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
|
||||
s->cpu = g_new0(GICv3CPUState, s->num_cpu);
|
||||
|
||||
for (i = 0; i < s->num_cpu; i++) {
|
||||
CPUState *cpu = qemu_get_cpu(i);
|
||||
CPUState *cpu = qemu_get_cpu(s->first_cpu_idx + i);
|
||||
uint64_t cpu_affid;
|
||||
|
||||
s->cpu[i].cpu = cpu;
|
||||
@@ -622,6 +622,7 @@ static const Property arm_gicv3_common_properties[] = {
|
||||
redist_region_count, qdev_prop_uint32, uint32_t),
|
||||
DEFINE_PROP_LINK("sysmem", GICv3State, dma, TYPE_MEMORY_REGION,
|
||||
MemoryRegion *),
|
||||
DEFINE_PROP_UINT32("first-cpu-index", GICv3State, first_cpu_idx, 0),
|
||||
};
|
||||
|
||||
static void arm_gicv3_common_class_init(ObjectClass *klass, const void *data)
|
||||
|
||||
@@ -3024,7 +3024,7 @@ void gicv3_init_cpuif(GICv3State *s)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < s->num_cpu; i++) {
|
||||
ARMCPU *cpu = ARM_CPU(qemu_get_cpu(i));
|
||||
ARMCPU *cpu = ARM_CPU(qemu_get_cpu(s->first_cpu_idx + i));
|
||||
GICv3CPUState *cs = &s->cpu[i];
|
||||
|
||||
/*
|
||||
|
||||
@@ -821,6 +821,12 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (s->first_cpu_idx != 0) {
|
||||
error_setg(errp, "Non-zero first-cpu-idx is unsupported with the "
|
||||
"in-kernel GIC");
|
||||
return;
|
||||
}
|
||||
|
||||
gicv3_init_irqs_and_mmio(s, kvm_arm_gicv3_set_irq, NULL);
|
||||
|
||||
for (i = 0; i < s->num_cpu; i++) {
|
||||
|
||||
@@ -229,6 +229,7 @@ struct GICv3State {
|
||||
uint32_t *redist_region_count; /* redistributor count within each region */
|
||||
uint32_t nb_redist_regions; /* number of redist regions */
|
||||
|
||||
uint32_t first_cpu_idx;
|
||||
uint32_t num_cpu;
|
||||
uint32_t num_irq;
|
||||
uint32_t revision;
|
||||
|
||||
Reference in New Issue
Block a user