On Wed, 26 Nov 2025 23:37:32 +0800 Zhao Liu <[email protected]> wrote:
> Hi Igor, > > I find after removing legacy cpu hotplug totally, it seems necessary to > update docs/specs/acpi_cpu_hotplug.rst as well, since then QEMU doesn't > have legacy cpu hotplug. Do you agree? > > I also attached my update for that doc. If this change is fine for you, > I will squash that doc change into another patch that removes > cpu_hotplug.[h|c] - I split your this patch into several parts > (following you another previous suggestion [*] to make review easier). > :) sure thing, whatever makes it easier to read/review > > [*]: > https://lore.kernel.org/qemu-devel/[email protected]/ > > Thanks, > Zhao > --- > From ff3da76cf7de097c42bdaf64850dc4df65b4bf4a Mon Sep 17 00:00:00 2001 > From: Zhao Liu <[email protected]> > Date: Wed, 26 Nov 2025 23:06:09 +0800 > Subject: [PATCH] docs/specs/acpi_cpu_hotplug.rst: remove legacy cpu hotplug > descriptions > > Legacy cpu hotplug has been removed totally and machines start with > modern cpu hotplug interface directly. > > Therefore, update the documentation to describe current QEMU cpu hotplug > logic. > > Signed-off-by: Zhao Liu <[email protected]> LGTM > --- > docs/specs/acpi_cpu_hotplug.rst | 28 +++------------------------- > 1 file changed, 3 insertions(+), 25 deletions(-) > > diff --git a/docs/specs/acpi_cpu_hotplug.rst b/docs/specs/acpi_cpu_hotplug.rst > index 351057c96761..f49678100044 100644 > --- a/docs/specs/acpi_cpu_hotplug.rst > +++ b/docs/specs/acpi_cpu_hotplug.rst > @@ -8,22 +8,6 @@ ACPI BIOS GPE.2 handler is dedicated for notifying OS about > CPU hot-add > and hot-remove events. > > > -Legacy ACPI CPU hotplug interface registers > -------------------------------------------- > - > -CPU present bitmap for: > - > -- ICH9-LPC (IO port 0x0cd8-0xcf7, 1-byte access) > -- PIIX-PM (IO port 0xaf00-0xaf1f, 1-byte access) > -- One bit per CPU. Bit position reflects corresponding CPU APIC ID. > Read-only. > -- The first DWORD in bitmap is used in write mode to switch from legacy > - to modern CPU hotplug interface, write 0 into it to do switch. > - > -QEMU sets corresponding CPU bit on hot-add event and issues SCI > -with GPE.2 event set. CPU present map is read by ACPI BIOS GPE.2 handler > -to notify OS about CPU hot-add events. CPU hot-remove isn't supported. > - > - > Modern ACPI CPU hotplug interface registers > ------------------------------------------- > > @@ -189,20 +173,14 @@ Typical usecases > (x86) Detecting and enabling modern CPU hotplug interface > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > -QEMU starts with legacy CPU hotplug interface enabled. Detecting and > -switching to modern interface is based on the 2 legacy CPU hotplug features: > - > -#. Writes into CPU bitmap are ignored. > -#. CPU bitmap always has bit #0 set, corresponding to boot CPU. > - > -Use following steps to detect and enable modern CPU hotplug interface: > +QEMU starts with modern CPU hotplug interface enabled. Use following steps to > +detect modern CPU hotplug interface: > > -#. Store 0x0 to the 'CPU selector' register, attempting to switch to modern > mode > #. Store 0x0 to the 'CPU selector' register, to ensure valid selector value > #. Store 0x0 to the 'Command field' register > #. Read the 'Command data 2' register. > If read value is 0x0, the modern interface is enabled. > - Otherwise legacy or no CPU hotplug interface available > + Otherwise no CPU hotplug interface available > > Get a cpu with pending event > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > -- > 2.34.1 >
