On Thu, 8 May 2025 15:35:25 +0200 Philippe Mathieu-Daudé <phi...@linaro.org> wrote:
> The PCMachineClass::legacy_cpu_hotplug boolean was only used > by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got > removed. Remove it and simplify build_dsdt(), removing > build_legacy_cpu_hotplug_aml() altogether. > > Note, this field was added by commit 679dd1a957d ("pc: use > new CPU hotplug interface since 2.7 machine type"): > > > For compatibility reasons PC/Q35 will start with legacy > > CPU hotplug interface by default but with new CPU hotplug > > AML code since 2.7 machine type. That way legacy firmware > > that doesn't use QEMU generated ACPI tables will be > > able to continue using legacy CPU hotplug interface. > > > > While new machine type, with firmware supporting QEMU > > provided ACPI tables, will generate new CPU hotplug AML, > > which will switch to new CPU hotplug interface when > > guest OS executes its _INI method on ACPI tables > > loading. > > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> > Reviewed-by: Mark Cave-Ayland <mark.caveayl...@nutanix.com> > Reviewed-by: Thomas Huth <th...@redhat.com> > Reviewed-by: Zhao Liu <zhao1....@intel.com> > --- > include/hw/acpi/cpu_hotplug.h | 3 - > include/hw/i386/pc.h | 3 - > hw/acpi/cpu_hotplug.c | 230 ---------------------------------- > hw/i386/acpi-build.c | 4 +- > 4 files changed, 1 insertion(+), 239 deletions(-) > ... > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 3fffa4a3328..625889783ec 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -1465,9 +1465,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > } > aml_append(dsdt, scope); > > - if (pcmc->legacy_cpu_hotplug) { > - build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); > - } else { > + { > CPUHotplugFeatures opts = { > .acpi_1_compatible = true, .has_legacy_cphp = true, ^^^^^ that still leaves legacy CPU hotplug hardware around, which we should remove at the same time as legacy AML. i.e.: drop _INI in hw/acpi/cpu.c and at the same time replace legacy_acpi_cpu_hotplug_init() at call sites with cpu_hotplug_hw_init() after that you can safely remove legacy_cpu_hotplug and no longer needed hw/acpi/cpu_hotplug.c && co > .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,