[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC V2 12/37] hw/acpi: Use qemu_present_cpu() API in ACPI CPU hot
From: |
Salil Mehta |
Subject: |
[PATCH RFC V2 12/37] hw/acpi: Use qemu_present_cpu() API in ACPI CPU hotplug init |
Date: |
Tue, 26 Sep 2023 11:04:11 +0100 |
ACPI CPU Hotplug code assumes a virtual CPU is unplugged if the CPUState object
is absent in the list of ths possible CPUs(CPUArchIdList *possible_cpus)
maintained on per-machine basis. Use the earlier introduced qemu_present_cpu()
API to check this state.
This change should have no bearing on the functionality of any architecture and
is mere a representational change.
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
hw/acpi/cpu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 45defdc0e2..d5ba37b209 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -225,7 +225,10 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
state->dev_count = id_list->len;
state->devs = g_new0(typeof(*state->devs), state->dev_count);
for (i = 0; i < id_list->len; i++) {
- state->devs[i].cpu = CPU(id_list->cpus[i].cpu);
+ struct CPUState *cpu = CPU(id_list->cpus[i].cpu);
+ if (qemu_present_cpu(cpu)) {
+ state->devs[i].cpu = cpu;
+ }
state->devs[i].arch_id = id_list->cpus[i].arch_id;
}
memory_region_init_io(&state->ctrl_reg, owner, &cpu_hotplug_ops, state,
--
2.34.1
- Re: [PATCH RFC V2 06/37] arm/virt,kvm: Pre-create disabled possible vCPUs @machine init, (continued)
- [PATCH RFC V2 07/37] arm/virt, gicv3: Changes to pre-size GIC with possible vcpus @machine init, Salil Mehta, 2023/09/26
- [PATCH RFC V2 08/37] arm/virt: Init PMU at host for all possible vcpus, Salil Mehta, 2023/09/26
- [PATCH RFC V2 09/37] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file, Salil Mehta, 2023/09/26
- [PATCH RFC V2 10/37] arm/acpi: Enable ACPI support for vcpu hotplug, Salil Mehta, 2023/09/26
- [PATCH RFC V2 11/37] hw/acpi: Add ACPI CPU hotplug init stub, Salil Mehta, 2023/09/26
- [PATCH RFC V2 12/37] hw/acpi: Use qemu_present_cpu() API in ACPI CPU hotplug init,
Salil Mehta <=
- [PATCH RFC V2 13/37] hw/acpi: Init GED framework with cpu hotplug events, Salil Mehta, 2023/09/26
- [PATCH RFC V2 14/37] arm/virt: Add cpu hotplug events to GED during creation, Salil Mehta, 2023/09/26
- [PATCH RFC V2 15/37] arm/virt: Create GED dev before *disabled* CPU Objs are destroyed, Salil Mehta, 2023/09/26
- [PATCH RFC V2 16/37] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change, Salil Mehta, 2023/09/26
- [PATCH RFC V2 17/37] arm/virt/acpi: Build CPUs AML with CPU Hotplug support, Salil Mehta, 2023/09/26