We create and initialize a cpuobj for each present cpu in machvirt_init(). Now we also initialize the cpu member of structure CPUArchId for each present cpu in the function.
This will be used to determine whether a cpu is present when generating ACPI tables in later patches. Co-developed-by: Ying Fang <fangyi...@huawei.com> Signed-off-by: Ying Fang <fangyi...@huawei.com> Signed-off-by: Yanan Wang <wangyana...@huawei.com> --- hw/arm/virt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e5dcdebdbc..50e324975f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2061,6 +2061,13 @@ static void machvirt_init(MachineState *machine) } qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); + + /* + * As ARM cpu hotplug is not supported yet, we initialize + * the present cpu members here. + */ + machine->possible_cpus->cpus[n].cpu = cpuobj; + object_unref(cpuobj); } fdt_add_timer_nodes(vms); -- 2.19.1