RE: [PATCH V3 0/5] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

Salil Mehta via posted 5 patches 2 weeks, 5 days ago
Only 0 patches received!
RE: [PATCH V3 0/5] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)
Posted by Salil Mehta via 2 weeks, 5 days ago
HI Miguel,

>  From: Miguel Luis <miguel.luis@oracle.com>
>  Sent: Monday, November 4, 2024 12:55 PM
>  To: Salil Mehta <salil.mehta@huawei.com>
>  
>  Hi Salil,
>  
>  > On 3 Nov 2024, at 09:24, Salil Mehta via <qemu-devel@nongnu.org>
>  wrote:
>  >
>  > Change Log
>  > ==========
>  >
>  > Patch V2 -> V3:
>  > 1. Addressed left over issues of x86 suggested by Igor Mammedov
>  (Redhat):
>  >   - Removed the `ACPICPUstatus::is_enabled` State as well as it was
>  >     breaking the x86 migration
>  >   - Above is in addition to `is_present` state which was removed in V2
>  >   - Dropped [PATCH 1/6] of V2 patch-set
>  >   - Introduced hooks `CPUClass::cpu_{persistence,enabled}_status()`
>  > 2. Fixed the accidental CPUs AML break of x86 in V2 (sorry for this!).
>  >
>  > Patch V1 -> V2:
>  > 1. Addressed Igor Mammedov's (Redhat) raised issues:
>  >   - Removed `ACPICPUstatus::is_present` State and its handling in the
>  >     ACPI APUs AML code and now all QOM vCPUs are present.
>  >   - Dropped the concept of `acpi_persistent` because now QOM vCPUs
>  >     states and the ACPI vCPU states are consistent.
>  >   - QOM vCPU objects are always present now (accompanying RFC V6)
>  >   - Added .needed() hook to the GED VMSD toconditionally migrate the
>  >     ACPI CPU hotplug state at the source VM.
>  > 2. Addressed Zhao Liu's (Intel) reported x86 DSDT Table bios-acpi-test
>  > failure 3. Incorporated Gustavo Romero's comments and added his Tag to
>  > [Patches 1,2,4] 4. Addressed Gavin Shan's comment to reduce the inline
>  code comments
>  >   wherever possible.
>  >
>  >
>  > Brief Recall
>  > ============
>  > With the advent of multi-core SoCs, the concept of CPU-level
>  > hotplugging has become less distinct, often functioning as a power
>  > on/off event rather than a full hotplug operation. However, hotplug
>  > support at the die/NUMA/socket level remains meaningful and is
>  architecture-specific.
>  > Virtual CPU hotplug can be supported regardless of architectural
>  > support for physical CPU hotplug, as it serves resource management
>  > needs—such as dynamically scaling VM compute capacity based on
>  demand
>  > or SLAs, optimizing boot times, or reducing memory footprint.
>  > Although, its desing must be scalable and must co-exist with future
>  > die/NUMA/socket level hotplug features.
>  >
>  >
>  > Motivation for this patch-set
>  > =============================
>  > In architectures that support vCPU hotplug, firmware or the VMM/QEMU
>  > typically reflects vCPU status changes to the OS via the ACPI
>  > `_STA.Present` bit. However, certain CPU architectures prohibit [1]
>  > modifications to CPU presence after kernel boot. This restriction
>  > [2][3] could be due to closely integrated per-CPU components—like
>  > interrupt controllers or other features— that may not support
>  > reconfiguration post-boot and are often in an `always-on` power
>  > domain. Consequently, specifications for these architectures require
>  > all CPUs to remain present i.e.`_STA.Present=True`, once the system is
>  initialized.
>  >
>  > To be able to support vCPU Hotplug feature, as a workaround to the
>  > above limitation,  ACPI method `_STA.Enabled` Bit could be used to
>  > reflect the plugged and unplugged states of the QOM vCPUs.
>  >
>  > This patch set introduces the following changes:
>  >
>  > 1. Introduces`CPUClass::cpu_{persistence,enabled}_status` hooks: To
>  >   check if the CPU should always remain present even after unplug
>  >   operation and to fetch the vCPU `enabled` status in case it is
>  >   present. Later is used in context when Guest Kernel evaluates
>  >   ACPI `_STA` method and the status is read from the flags stored
>  >   in the Qemu ACPI code.
>  >
>  > 2. Support for Migrating ACPI CPU Hotplug State: Facilitates the
>  >   migration of the ACPI CPU hotplug state in VMSD by conditonally
>  >   making it part of the GED VMSD.
>  >
>  > 3. Updates the Qtest bios-acpi-tables/DSDT binaries for x86/{pc,q35}
>  >
>  > This patch set is designed to work independently and is meant to
>  > ensure compatibility with existing hotplug support across different
>  > architectures. This patch-set has been tested alongside ARM-specific
>  > vCPU hotplug changes (included in the upcoming RFC V6 [4]), and
>  > hot(un)plug functionalities performed as expected which concerns this
>  > patch-set. Please have a look.
>  >
>  
>  For arm64:
>  I’ve ran make check and bios-tables-test passed successfully and got 0 failed
>  tests.
>  After boot the number of vcpus matched what was initially requested via -
>  smp cpus.
>  I’ve also tested this patchset alongside the upcoming RFC V6-rc5 and
>  booting, basic hot-plugging/unplugging of vCPUs and live migration with an
>  asymmetrical number of hotplugged vCPUs looked good to me.
>  
>  Please, feel free to add:
>  Tested-by: Miguel Luis <miguel.luis@oracle.com>


Many thanks for your continuous efforts and confirming this. I really appreciate this.

I would leave application of this Tag to Michael as patch-set is in his queue now. 😊

Many thanks!

Best regards
Salil.


>  
>  Thank you.
>  Miguel
>  
>  > Thank you!
>  >