intc/gicv3_common: Factor out arm_gicv3_common_cpu_realize
The CPU object of hotplugged CPU will be defer-created (during hotplug session), so we must factor out realization code to let it can be applied to individual CPU. Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> (cherry picked from commit 7e5f5b7ff26bc48205f47d8f29477a8587c71446)
This commit is contained in:
parent
4eebae230f
commit
b7a94f5251
51
intc-gicv3_common-Factor-out-arm_gicv3_common_cpu_re.patch
Normal file
51
intc-gicv3_common-Factor-out-arm_gicv3_common_cpu_re.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
From 06cb0756a01796352861b4d47d59db1bde84ec6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Keqian Zhu <zhukeqian1@huawei.com>
|
||||||
|
Date: Fri, 10 Apr 2020 12:55:17 +0800
|
||||||
|
Subject: [PATCH] intc/gicv3_common: Factor out arm_gicv3_common_cpu_realize
|
||||||
|
|
||||||
|
The CPU object of hotplugged CPU will be defer-created (during
|
||||||
|
hotplug session), so we must factor out realization code to let
|
||||||
|
it can be applied to individual CPU.
|
||||||
|
|
||||||
|
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
|
||||||
|
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
|
||||||
|
---
|
||||||
|
hw/intc/arm_gicv3_common.c | 15 +++++++++++----
|
||||||
|
1 file changed, 11 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
|
||||||
|
index 9884d2e39b..1a11d1986d 100644
|
||||||
|
--- a/hw/intc/arm_gicv3_common.c
|
||||||
|
+++ b/hw/intc/arm_gicv3_common.c
|
||||||
|
@@ -301,6 +301,16 @@ void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_handler handler,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void arm_gicv3_common_cpu_realize(GICv3State *s, int ncpu)
|
||||||
|
+{
|
||||||
|
+ CPUState *cpu = qemu_get_cpu(ncpu);
|
||||||
|
+
|
||||||
|
+ s->cpu[ncpu].cpu = cpu;
|
||||||
|
+ s->cpu[ncpu].gic = s;
|
||||||
|
+ /* Store GICv3CPUState in CPUARMState gicv3state pointer */
|
||||||
|
+ gicv3_set_gicv3state(cpu, &s->cpu[ncpu]);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
|
||||||
|
{
|
||||||
|
GICv3State *s = ARM_GICV3_COMMON(dev);
|
||||||
|
@@ -363,10 +373,7 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
|
||||||
|
CPUState *cpu = qemu_get_cpu(i);
|
||||||
|
uint64_t cpu_affid;
|
||||||
|
|
||||||
|
- s->cpu[i].cpu = cpu;
|
||||||
|
- s->cpu[i].gic = s;
|
||||||
|
- /* Store GICv3CPUState in CPUARMState gicv3state pointer */
|
||||||
|
- gicv3_set_gicv3state(cpu, &s->cpu[i]);
|
||||||
|
+ arm_gicv3_common_cpu_realize(s, i);
|
||||||
|
|
||||||
|
/* Pre-construct the GICR_TYPER:
|
||||||
|
* For our implementation:
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user