[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC V2 15/37] arm/virt: Create GED dev before *disabled* CPU Objs
From: |
Salil Mehta |
Subject: |
[PATCH RFC V2 15/37] arm/virt: Create GED dev before *disabled* CPU Objs are destroyed |
Date: |
Tue, 26 Sep 2023 11:04:14 +0100 |
ACPI CPU hotplug state (is_present=_STA.PRESENT, is_enabled=_STA.ENABLED) for
all the possible vCPUs MUST be initialized during machine init. This is done
during the creation of the GED device. VMM/Qemu MUST expose/fake the ACPI state
of the disabled vCPUs to the Guest kernel as 'present' (_STA.PRESENT) always
i.e. ACPI persistent. if the 'disabled' vCPU objectes are destroyed before the
GED device has been created then their ACPI hotplug state might not get
initialized correctly as acpi_persistent flag is part of the CPUState. This will
expose wrong status of the unplugged vCPUs to the Guest kernel.
Hence, moving the GED device creation before disabled vCPU objects get destroyed
as part of the post CPU init routine.
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
hw/arm/virt.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 5c8a0672dc..cbb6199ec6 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2376,6 +2376,12 @@ static void machvirt_init(MachineState *machine)
create_gic(vms, sysmem);
+ has_ged = has_ged && aarch64 && firmware_loaded &&
+ virt_is_acpi_enabled(vms);
+ if (has_ged) {
+ vms->acpi_dev = create_acpi_ged(vms);
+ }
+
virt_cpu_post_init(vms, sysmem);
fdt_add_pmu_nodes(vms);
@@ -2398,9 +2404,7 @@ static void machvirt_init(MachineState *machine)
create_pcie(vms);
- if (has_ged && aarch64 && firmware_loaded && virt_is_acpi_enabled(vms)) {
- vms->acpi_dev = create_acpi_ged(vms);
- } else {
+ if (!has_ged) {
create_gpio_devices(vms, VIRT_GPIO, sysmem);
}
--
2.34.1
- [PATCH RFC V2 10/37] arm/acpi: Enable ACPI support for vcpu hotplug, (continued)
- [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 13/37] hw/acpi: Init GED framework with cpu hotplug events, Salil Mehta, 2023/09/26
- [PATCH RFC V2 12/37] hw/acpi: Use qemu_present_cpu() API in ACPI CPU hotplug init, 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 <=
- [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
- [PATCH RFC V2 18/37] arm/virt: Make ARM vCPU *present* status ACPI *persistent*, Salil Mehta, 2023/09/26
- [PATCH RFC V2 19/37] hw/acpi: ACPI/AML Changes to reflect the correct _STA.{PRES, ENA} Bits to Guest, Salil Mehta, 2023/09/26
- [PATCH RFC V2 20/37] hw/acpi: Update GED _EVT method AML with cpu scan, Salil Mehta, 2023/09/26