mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
On most architectures, during vCPU hot-plug and hot-unplug actions, the
firmware or VMM/QEMU can update the OS on vCPU status by toggling the
ACPI method `_STA.Present` bit. However, certain CPU architectures
prohibit [1] modifications to a CPU’s `presence` status after the kernel
has booted.
This limitation [2][3] exists because many per-CPU components, such as
interrupt controllers and various per-CPU features tightly integrated
with CPUs, may not support reconfiguration once the kernel is
initialized. Often, these components cannot be powered down, as they may
belong to an `always-on` power domain. As a result, some architectures
require all CPUs to remain `_STA.Present` after system initialization.
Therefore, it is essential to mirror the exact QOM vCPU status through
ACPI for the Guest kernel. For this, we should determine—via
architecture-specific code[4]—whether vCPUs must always remain present
and whether the associated `AcpiCpuStatus::cpu` object should remain
valid, even following a vCPU hot-unplug operation.
References:
[1] Check comment 5 in the bugzilla entry
Link: https://bugzilla.tianocore.org/show_bug.cgi?id=4481#c5
[2] KVMForum 2023 Presentation: Challenges Revisited in Supporting Virt CPU Hotplug on
architectures that don’t Support CPU Hotplug (like ARM64)
a. Kernel Link: https://kvm-forum.qemu.org/2023/KVM-forum-cpu-hotplug_7OJ1YyJ.pdf
b. Qemu Link: https://kvm-forum.qemu.org/2023/Challenges_Revisited_in_Supporting_Virt_CPU_Hotplug_-__ii0iNb3.pdf
[3] KVMForum 2020 Presentation: Challenges in Supporting Virtual CPU Hotplug on
SoC Based Systems (like ARM64)
Link: https://kvmforum2020.sched.com/event/eE4m
[4] Example implementation of architecture-specific CPU persistence hook
Link:
|
||
|---|---|---|
| .. | ||
| acpi-cpu-hotplug-stub.c | ||
| acpi-mem-hotplug-stub.c | ||
| acpi-nvdimm-stub.c | ||
| acpi-pci-hotplug-stub.c | ||
| acpi-qmp-cmds.c | ||
| acpi-stub.c | ||
| acpi-x86-stub.c | ||
| acpi_interface.c | ||
| aml-build-stub.c | ||
| aml-build.c | ||
| bios-linker-loader.c | ||
| core.c | ||
| cpu.c | ||
| cpu_hotplug.c | ||
| cxl-stub.c | ||
| cxl.c | ||
| erst.c | ||
| generic_event_device.c | ||
| ghes-stub.c | ||
| ghes.c | ||
| hmat.c | ||
| hmat.h | ||
| ich9.c | ||
| ich9_tco.c | ||
| ich9_timer.c | ||
| ipmi-stub.c | ||
| ipmi.c | ||
| Kconfig | ||
| memory_hotplug.c | ||
| meson.build | ||
| nvdimm.c | ||
| pci-bridge-stub.c | ||
| pci-bridge.c | ||
| pci.c | ||
| pcihp.c | ||
| piix4.c | ||
| tpm.c | ||
| trace-events | ||
| trace.h | ||
| utils.c | ||
| viot.c | ||
| viot.h | ||
| vmgenid.c | ||