hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
Subsystems (3)
v6 cover hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
Hi,
This v6 is based on the master branch at the commit 0fc482b73d8e ("Merge tag 'pull-aspeed-20260105' of https://github.com/legoater/qemu
into staging").
Since there's the discussion around fw_cfg_init_io_nodma() [*], v6 doesn't include that cleanups. Therefore, comparing v5, v6 has *very* minimal changes and most of patches have been reviewed (except patch 15
- I think it needs an additianl review :-) ).
Thanks for your patience and review!
Introduction
============
A brief introduction from Philippe's v4:
The versioned 'pc' and 'q35' machines up to 2.12 been marked as deprecated three releases ago, and are older than 6 years, so according to our support policy we can remove them.
This series only includes the 2.6 and 2.7 machines removal, as it is a big enough number of LoC removed. Rest will follow.
Change Log
==========
(Main) changes since v5:
* Merge pc & q35 changes for testing DSDT tables into one patch and simplify the commit message.
* Reorganize S-o-b and collect review tags from Igor.
(Main) changes since v4:
* Completely remove the legacy CPU hotplug approach.
- New patch 2-8.
- Test CPU hot-plug & hot-unplug via qmp.
* Keep "dma_enabled" property in fw_cfg_io_properties[] since Sun4u & Sun4v are still using it.
- About more details, please see commit message of patch 15.
* Temporarily keep these properties: "cpuid-0xb" (of X86CPU), "fill-mtrr-mask" (of X86CPU), "version" (of IOAPICCommonState).
- These properties will be deprecated first before removal, in another series.
* Keep "l3-cache" (of X86CPU) and "page-per-vq" (of VirtIOPCIProxy), since they are still in use (e.g., libvirt).
Reference
=========
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
Best Regards,
Zhao
---
Igor Mammedov (1):
tests/acpi: Allow DSDT table change for x86 machines
Philippe Mathieu-Daudé (22):
hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() ->
fw_cfg_init_mem_dma()
hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field hw/i386/pc: Remove multiboot.bin
hw/i386: Assume fw_cfg DMA is always enabled
hw/i386: Remove linuxboot.bin
hw/i386/pc: Remove pc_compat_2_6[] array
hw/intc/apic: Remove APICCommonState::legacy_instance_id field hw/core/machine: Remove hw_compat_2_6[] array hw/virtio/virtio-mmio: Remove
VirtIOMMIOProxy::format_transport_address field
hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines hw/i386/pc: Remove pc_compat_2_7[] array
target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field hw/audio/pcspk: Remove PCSpkState::migrate field hw/core/machine: Remove hw_compat_2_7[] array hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features
field
hw/char/virtio-serial: Do not expose the 'emergency-write' property
Zhao Liu (4):
pc: Start with modern CPU hotplug interface by default
acpi: Remove legacy cpu hotplug utilities docs/specs/acpi_cpu_hotplug: Remove legacy cpu hotplug descriptions tests/acpi: Update DSDT tables for pc & q35 machines
docs/specs/acpi_cpu_hotplug.rst | 28 +- hw/acpi/acpi-cpu-hotplug-stub.c | 19 +- hw/acpi/cpu.c | 10 - hw/acpi/cpu_hotplug.c | 348 ------------------ hw/acpi/generic_event_device.c | 1 + hw/acpi/ich9.c | 61 +-- hw/acpi/meson.build | 2 +- hw/acpi/piix4.c | 61 +-- hw/arm/virt.c | 2 +- hw/audio/pcspk.c | 10 - hw/char/virtio-serial-bus.c | 9 +- hw/core/machine.c | 17 - hw/hppa/machine.c | 2 +- hw/i386/acpi-build.c | 7 +- hw/i386/fw_cfg.c | 16 +- hw/i386/intel_iommu.c | 5 +- hw/i386/microvm.c | 3 - hw/i386/multiboot.c | 7 +- hw/i386/pc.c | 25 +- hw/i386/pc_piix.c | 23 -- hw/i386/pc_q35.c | 24 -- hw/i386/x86-common.c | 8 +- hw/i386/x86.c | 2 - hw/intc/apic_common.c | 5 - hw/loongarch/fw_cfg.c | 4 +- hw/loongarch/virt-acpi-build.c | 1 - hw/mips/loongson3_virt.c | 2 +- hw/nvram/fw_cfg.c | 22 +- hw/riscv/virt.c | 4 +- hw/virtio/virtio-mmio.c | 15 - hw/virtio/virtio-pci.c | 5 +- include/hw/acpi/cpu.h | 1 - include/hw/acpi/ich9.h | 4 +- include/hw/acpi/piix4.h | 4 +- include/hw/core/boards.h | 6 - include/hw/i386/apic_internal.h | 1 - include/hw/i386/intel_iommu.h | 1 - include/hw/i386/pc.h | 9 - include/hw/i386/x86.h | 2 - include/hw/nvram/fw_cfg.h | 9 +- include/hw/virtio/virtio-mmio.h | 1 - include/hw/virtio/virtio-pci.h | 1 - include/hw/virtio/virtio-serial.h | 2 - pc-bios/meson.build | 2 - pc-bios/multiboot.bin | Bin 1024 -> 0 bytes pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/linuxboot.S | 195 ---------- pc-bios/optionrom/multiboot.S | 232 ------------ pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++- pc-bios/optionrom/optionrom.h | 4 - target/i386/cpu.c | 119 +++--- target/i386/cpu.h | 3 - tests/data/acpi/x86/pc/DSDT | Bin 8611 -> 8598 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8522 -> 8509 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9936 -> 9923 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15482 -> 15469 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9075 -> 9062 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10265 -> 10252 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8562 -> 8549 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5100 -> 5087 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8683 -> 8670 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9970 -> 9957 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8469 -> 8456 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8617 -> 8604 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12404 -> 12391 bytes tests/data/acpi/x86/q35/DSDT | Bin 8440 -> 8427 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9765 -> 9752 bytes .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12650 -> 12637 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8719 -> 8706 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8486 -> 8473 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12053 -> 12040 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8904 -> 8891 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13231 -> 13218 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10094 -> 10081 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8515 -> 8502 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8528 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9799 -> 9786 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9570 -> 9557 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13293 -> 13280 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8302 -> 8289 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8298 -> 8285 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8446 -> 8433 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8541 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9046 -> 9033 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9072 -> 9059 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18674 -> 18661 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14697 -> 14684 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35803 -> 35790 bytes tests/qtest/test-x86-cpuid-compat.c | 11 - 95 files changed, 363 insertions(+), 1228 deletions(-) delete mode 100644 hw/acpi/cpu_hotplug.c delete mode 100644 pc-bios/multiboot.bin delete mode 100644 pc-bios/optionrom/linuxboot.S delete mode 100644 pc-bios/optionrom/multiboot.S
Signature · 1 line
2.34.1
PATCH v6 1/27 hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
From: Philippe Mathieu-Daudé <[email protected]>
These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.
--- hw/i386/pc_piix.c | 14 -------------- hw/i386/pc_q35.c | 14 -------------- 2 files changed, 28 deletions(-)
hw/i386/pc_piix.c +0 -14
@@ -733,20 +733,6 @@ static void pc_i440fx_machine_2_7_options(MachineClass *m)DEFINE_I440FX_MACHINE (2 ,7 ); -static void pc_i440fx_machine_2_6_options (MachineClass *m) -{ -X86MachineClass *x86mc =X86_MACHINE_CLASS (m); -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_i440fx_machine_2_7_options (m); - pcmc->legacy_cpu_hotplug = true; - x86mc->fwcfg_dma_enabled = false; -compat_props_add (m->compat_props, hw_compat_2_6, hw_compat_2_6_len); -compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); -} - -DEFINE_I440FX_MACHINE (2 ,6 ); -#ifdef CONFIG_XEN static void xenfv_machine_4_2_options (MachineClass *m) {
hw/i386/pc_q35.c +0 -14
@@ -681,17 +681,3 @@ static void pc_q35_machine_2_7_options(MachineClass *m) }DEFINE_Q35_MACHINE (2 ,7 ); - -static void pc_q35_machine_2_6_options (MachineClass *m) -{ -X86MachineClass *x86mc =X86_MACHINE_CLASS (m); -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_q35_machine_2_7_options (m); - pcmc->legacy_cpu_hotplug = true; - x86mc->fwcfg_dma_enabled = false; -compat_props_add (m->compat_props, hw_compat_2_6, hw_compat_2_6_len); -compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); -} - -DEFINE_Q35_MACHINE (2 ,6 );
Signature · 1 line
2.34.1
PATCH v6 2/27 tests/acpi: Allow DSDT table change for x86 machines
In reply to Zhao LiuFrom: Igor Mammedov <[email protected]>
Before dropping legacy CPU hotplug code, mark and allow the affected ACPI tables, to avoid breaking ACPI table testing.
---
Changes since v4:
* New patch split off from Igor's v5 [*].
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
--- tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +42 -0
@@ -1 +1,43 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.hpbrroot" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.noacpihp" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.xapic",
Signature · 1 line
2.34.1
PATCH v6 3/27 pc: Start with modern CPU hotplug interface by default
In reply to Zhao LiuFor 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 (in commit 679dd1a957df ("pc: use new CPU hotplug interface since 2.7 machine type")). In that way, legacy firmware that doesn't use QEMU generated ACPI tables was able to continue using legacy CPU hotplug interface.
While later machine types, with firmware supporting QEMU provided ACPI tables, generate new CPU hotplug AML, which will switch to new CPU hotplug interface when guest OS executes its _INI method on ACPI tables loading.
Since 2.6 machine type is now gone, and consider that the legacy BIOS (based on QEMU ACPI prior to v2.7) should be no longer in use, previous compatibility requirements are no longer necessary. So initialize 'modern' hotplug directly from the very beginning for PC/Q35 machines with cpu_hotplug_hw_init(), and drop _INIT method.
Additionally, remove the checks and settings around cpu_hotplug_legacy in cpuhp VMState (for piix4 & ich9), to eliminate the risk of segmentation faults, as gpe_cpu no longer has the opportunity to be initialized. This is safe because all hotplug now start with the modern way, and it's impossible to switch to legacy way at runtime (even the "cpu-hotplug-legacy" properties does not allow it either).
---
Changes since v4:
* New patch split off from Igor's v5 [*].
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
--- hw/acpi/cpu.c | 10 ---------- hw/acpi/ich9.c | 22 +++------------------- hw/acpi/piix4.c | 21 +++------------------ hw/i386/acpi-build.c | 2 +- hw/loongarch/virt-acpi-build.c | 1 - include/hw/acpi/cpu.h | 1 - 6 files changed, 7 insertions(+), 50 deletions(-)
hw/acpi/cpu.c +0 -10
@@ -408,16 +408,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,aml_append (field,aml_reserved_field (4 *8 ));aml_append (field,aml_named_field (CPU_DATA ,32 ));aml_append (cpu_ctrl_dev, field); - -if (opts.has_legacy_cphp) { - method =aml_method ("_INI" ,0 ,AML_SERIALIZED ); -/* switch off legacy CPU hotplug HW and use new one, -* on reboot system is in new mode and writing 0 -* in CPU_SELECTOR selects BSP, which is NOP at -* the time _INI is called */ -aml_append (method,aml_store (zero,aml_name (CPU_SELECTOR ))); -aml_append (cpu_ctrl_dev, method); - } }aml_append (sb_scope, cpu_ctrl_dev);
hw/acpi/ich9.c +3 -19
@@ -183,26 +183,10 @@ static const VMStateDescription vmstate_tco_io_state = { } }; -static bool vmstate_test_use_cpuhp (void *opaque) -{ -ICH9LPCPMRegs *s = opaque; -return !s->cpu_hotplug_legacy; -} - -static int vmstate_cpuhp_pre_load (void *opaque) -{ -ICH9LPCPMRegs *s = opaque; -Object *obj =OBJECT (s->gpe_cpu.device); -object_property_set_bool (obj,"cpu-hotplug-legacy" , false, &error_abort); -return 0 ; -} -static const VMStateDescription vmstate_cpuhp_state = { .name ="ich9_pm/cpuhp" , .version_id =1 , .minimum_version_id =1 , - .needed = vmstate_test_use_cpuhp, - .pre_load = vmstate_cpuhp_pre_load, .fields = (const VMStateField []) {VMSTATE_CPU_HOTPLUG (cpuhp_state, ICH9LPCPMRegs),VMSTATE_END_OF_LIST ()
@@ -338,8 +322,8 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq) pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); -legacy_acpi_cpu_hotplug_init (pci_address_space_io (lpc_pci), -OBJECT (lpc_pci), &pm->gpe_cpu,ICH9_CPU_HOTPLUG_IO_BASE ); +cpu_hotplug_hw_init (pci_address_space_io (lpc_pci), +OBJECT (lpc_pci), &pm->cpuhp_state,ICH9_CPU_HOTPLUG_IO_BASE ); acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci), &pm->acpi_memory_hotplug,
@@ -419,7 +403,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) {static const uint32_t gpe0_len =ICH9_PMIO_GPE0_LEN ; pm->acpi_memory_hotplug.is_enabled = true; - pm->cpu_hotplug_legacy = true; + pm->cpu_hotplug_legacy = false; pm->disable_s3 =0 ; pm->disable_s4 =0 ; pm->s4_val =2 ;
hw/acpi/piix4.c +3 -18
@@ -195,25 +195,10 @@ static const VMStateDescription vmstate_memhp_state = { } }; -static bool vmstate_test_use_cpuhp (void *opaque) -{ -PIIX4PMState *s = opaque; -return !s->cpu_hotplug_legacy; -} - -static int vmstate_cpuhp_pre_load (void *opaque) -{ -Object *obj =OBJECT (opaque); -object_property_set_bool (obj,"cpu-hotplug-legacy" , false, &error_abort); -return 0 ; -} -static const VMStateDescription vmstate_cpuhp_state = { .name ="piix4_pm/cpuhp" , .version_id =1 , .minimum_version_id =1 , - .needed = vmstate_test_use_cpuhp, - .pre_load = vmstate_cpuhp_pre_load, .fields = (const VMStateField []) {VMSTATE_CPU_HOTPLUG (cpuhp_state, PIIX4PMState),VMSTATE_END_OF_LIST ()
@@ -573,12 +558,12 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,qbus_set_hotplug_handler (BUS (pci_get_bus (PCI_DEVICE (s))),OBJECT (s)); } - s->cpu_hotplug_legacy = true; + s->cpu_hotplug_legacy = false;object_property_add_bool (OBJECT (s),"cpu-hotplug-legacy" , piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy); -legacy_acpi_cpu_hotplug_init (parent,OBJECT (s), &s->gpe_cpu, -PIIX4_CPU_HOTPLUG_IO_BASE ); +cpu_hotplug_hw_init (parent,OBJECT (s), &s->cpuhp_state, +PIIX4_CPU_HOTPLUG_IO_BASE );if (s->acpi_memory_hotplug.is_enabled) { acpi_memory_hotplug_init(parent, OBJECT(s), &s->acpi_memory_hotplug,
hw/i386/acpi-build.c +1 -1
@@ -964,7 +964,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,build_legacy_cpu_hotplug_aml (dsdt, machine, pm->cpu_hp_io_base); }else {CPUHotplugFeatures opts = { - .acpi_1_compatible = true, .has_legacy_cphp = true, + .acpi_1_compatible = true, .smi_path = pm->smi_on_cpuhp ?"\\_SB.PCI0.SMI0.SMIC" :NULL , .fw_unplugs_cpu = pm->smi_on_cpu_unplug, };
hw/loongarch/virt-acpi-build.c +0 -1
@@ -369,7 +369,6 @@ build_la_ged_aml(Aml *dsdt, MachineState *machine)if (event &ACPI_GED_CPU_HOTPLUG_EVT ) { opts.acpi_1_compatible = false; - opts.has_legacy_cphp = false; opts.fw_unplugs_cpu = false; opts.smi_path =NULL ;
include/hw/acpi/cpu.h +0 -1
@@ -54,7 +54,6 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,typedef struct CPUHotplugFeatures {bool acpi_1_compatible; -bool has_legacy_cphp;bool fw_unplugs_cpu;const char *smi_path; }CPUHotplugFeatures ;
Signature · 1 line
2.34.1
PATCH v6 4/27 hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
Now all PC & Q35 machiens are using modern hotplug from the beginning, and all legacy_cpu_hotplug flags keep false during runtime.
So it's safe to remove legacy_cpu_hotplug flags and related properties, with unused gpe_cpu field.
---
Changes since v4:
* Referring Igor's v5 [*], drop gpe_cpu field and does not only remove build_legacy_cpu_hotplug_aml(), but instead remove the entire cpu_hotplug.c file in a separate patch.
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
--- hw/acpi/ich9.c | 40 ++++------------------------------------ hw/acpi/piix4.c | 40 ++++------------------------------------ hw/i386/acpi-build.c | 4 +--- include/hw/acpi/ich9.h | 2 -- include/hw/acpi/piix4.h | 2 -- include/hw/i386/pc.h | 3 --- 6 files changed, 9 insertions(+), 82 deletions(-)
hw/acpi/ich9.c +4 -36
@@ -339,26 +339,6 @@ static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, const char *name,visit_type_uint32 (v, name, &value, errp); } -static bool ich9_pm_get_cpu_hotplug_legacy (Object *obj,Error **errp) -{ -ICH9LPCState *s =ICH9_LPC_DEVICE (obj); - -return s->pm.cpu_hotplug_legacy; -} - -static void ich9_pm_set_cpu_hotplug_legacy (Object *obj,bool value, -Error **errp) -{ -ICH9LPCState *s =ICH9_LPC_DEVICE (obj); - -assert (!value); -if (s->pm.cpu_hotplug_legacy && value == false) { -acpi_switch_to_modern_cphp (&s->pm.gpe_cpu, &s->pm.cpuhp_state, -ICH9_CPU_HOTPLUG_IO_BASE ); - } - s->pm.cpu_hotplug_legacy = value; -} -static bool ich9_pm_get_enable_tco (Object *obj,Error **errp) {ICH9LPCState *s =ICH9_LPC_DEVICE (obj);
@@ -403,7 +383,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) {static const uint32_t gpe0_len =ICH9_PMIO_GPE0_LEN ; pm->acpi_memory_hotplug.is_enabled = true; - pm->cpu_hotplug_legacy = false; pm->disable_s3 =0 ; pm->disable_s4 =0 ; pm->s4_val =2 ;
@@ -422,9 +401,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) NULL, NULL, pm);object_property_add_uint32_ptr (obj,ACPI_PM_PROP_GPE0_BLK_LEN , &gpe0_len,OBJ_PROP_FLAG_READ ); -object_property_add_bool (obj,"cpu-hotplug-legacy" , - ich9_pm_get_cpu_hotplug_legacy, - ich9_pm_set_cpu_hotplug_legacy);object_property_add_uint8_ptr (obj,ACPI_PM_PROP_S3_DISABLED , &pm->disable_s3,OBJ_PROP_FLAG_READWRITE ); object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
@@ -477,11 +453,7 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, dev, errp); } }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { -if (lpc->pm.cpu_hotplug_legacy) { -legacy_acpi_cpu_plug_cb (hotplug_dev, &lpc->pm.gpe_cpu, dev, errp); - }else { -acpi_cpu_plug_cb (hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); - } +acpi_cpu_plug_cb (hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {acpi_pcihp_device_plug_cb (hotplug_dev, &lpc->pm.acpi_pci_hotplug, dev, errp);
@@ -500,8 +472,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev,acpi_memory_unplug_request_cb (hotplug_dev, &lpc->pm.acpi_memory_hotplug, dev, errp); - }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && - !lpc->pm.cpu_hotplug_legacy) { + }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {uint64_t negotiated = lpc->smi_negotiated_features; if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) &&
@@ -533,8 +504,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {acpi_memory_unplug_cb (&lpc->pm.acpi_memory_hotplug, dev, errp); - }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && - !lpc->pm.cpu_hotplug_legacy) { + }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {acpi_cpu_unplug_cb (&lpc->pm.cpuhp_state, dev, errp); }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) { acpi_pcihp_device_unplug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug,
@@ -556,7 +526,5 @@ void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)ICH9LPCState *s =ICH9_LPC_DEVICE (adev);acpi_memory_ospm_status (&s->pm.acpi_memory_hotplug, list); -if (!s->pm.cpu_hotplug_legacy) { -acpi_cpu_ospm_status (&s->pm.cpuhp_state, list); - } +acpi_cpu_ospm_status (&s->pm.cpuhp_state, list); }
hw/acpi/piix4.c +4 -36
@@ -336,11 +336,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {acpi_pcihp_device_plug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, errp); }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { -if (s->cpu_hotplug_legacy) { -legacy_acpi_cpu_plug_cb (hotplug_dev, &s->gpe_cpu, dev, errp); - }else { -acpi_cpu_plug_cb (hotplug_dev, &s->cpuhp_state, dev, errp); - } +acpi_cpu_plug_cb (hotplug_dev, &s->cpuhp_state, dev, errp); }else {g_assert_not_reached (); }
@@ -358,8 +354,7 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev, }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {acpi_pcihp_device_unplug_request_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, errp); - }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && - !s->cpu_hotplug_legacy) { + }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {acpi_cpu_unplug_request_cb (hotplug_dev, &s->cpuhp_state, dev, errp); }else { error_setg(errp, "acpi: device unplug request for not supported device"
@@ -378,8 +373,7 @@ static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev, }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {acpi_pcihp_device_unplug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, errp); - }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && - !s->cpu_hotplug_legacy) { + }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {acpi_cpu_unplug_cb (&s->cpuhp_state, dev, errp); }else { error_setg(errp, "acpi: device unplug for not supported device"
@@ -523,26 +517,6 @@ static const MemoryRegionOps piix4_gpe_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; - -static bool piix4_get_cpu_hotplug_legacy (Object *obj,Error **errp) -{ -PIIX4PMState *s =PIIX4_PM (obj); - -return s->cpu_hotplug_legacy; -} - -static void piix4_set_cpu_hotplug_legacy (Object *obj,bool value,Error **errp) -{ -PIIX4PMState *s =PIIX4_PM (obj); - -assert (!value); -if (s->cpu_hotplug_legacy && value == false) { -acpi_switch_to_modern_cphp (&s->gpe_cpu, &s->cpuhp_state, -PIIX4_CPU_HOTPLUG_IO_BASE ); - } - s->cpu_hotplug_legacy = value; -} -static void piix4_acpi_system_hot_add_init (MemoryRegion *parent,PCIBus *bus,PIIX4PMState *s) {
@@ -558,10 +532,6 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,qbus_set_hotplug_handler (BUS (pci_get_bus (PCI_DEVICE (s))),OBJECT (s)); } - s->cpu_hotplug_legacy = false; -object_property_add_bool (OBJECT (s),"cpu-hotplug-legacy" , - piix4_get_cpu_hotplug_legacy, - piix4_set_cpu_hotplug_legacy);cpu_hotplug_hw_init (parent,OBJECT (s), &s->cpuhp_state,PIIX4_CPU_HOTPLUG_IO_BASE );
@@ -576,9 +546,7 @@ static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)PIIX4PMState *s =PIIX4_PM (adev);acpi_memory_ospm_status (&s->acpi_memory_hotplug, list); -if (!s->cpu_hotplug_legacy) { -acpi_cpu_ospm_status (&s->cpuhp_state, list); - } +acpi_cpu_ospm_status (&s->cpuhp_state, list); }static void piix4_send_gpe (AcpiDeviceIf *adev,AcpiEventStatusBits ev)
hw/i386/acpi-build.c +1 -3
@@ -960,9 +960,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, .smi_path = pm->smi_on_cpuhp ?"\\_SB.PCI0.SMI0.SMIC" :NULL ,
include/hw/acpi/ich9.h +0 -2
@@ -53,8 +53,6 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; -bool cpu_hotplug_legacy; -AcpiCpuHotplug gpe_cpu;CPUHotplugState cpuhp_state;bool keep_pci_slot_hpc;
include/hw/acpi/piix4.h +0 -2
@@ -63,8 +63,6 @@ struct PIIX4PMState {uint8_t disable_s4;uint8_t s4_val; -bool cpu_hotplug_legacy; -AcpiCpuHotplug gpe_cpu;CPUHotplugState cpuhp_state;MemHotplugState acpi_memory_hotplug;
include/hw/i386/pc.h +0 -3
@@ -110,9 +110,6 @@ struct PCMachineClass {bool enforce_amd_1tb_hole;bool isa_bios_alias; -/* generate legacy CPU hotplug AML */ -bool legacy_cpu_hotplug; -/* use PVH to load kernels that support this feature */ bool pvh_enabled;
Signature · 1 line
2.34.1
PATCH v6 5/27 acpi: Remove legacy cpu hotplug utilities
In reply to Zhao LiuThe cpu_hotplug.h and cpu_hotplug.c contain legacy cpu hotplug utilities. Now there's no use case of legacy cpu hotplug, so it's safe to drop legacy cpu hotplug support totally.
---
Changes since v4:
* New patch split off from Igor's v5 [*].
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
--- hw/acpi/acpi-cpu-hotplug-stub.c | 19 +- hw/acpi/cpu_hotplug.c | 348 -------------------------------- hw/acpi/generic_event_device.c | 1 + hw/acpi/ich9.c | 1 + hw/acpi/meson.build | 2 +- hw/acpi/piix4.c | 2 +- hw/i386/acpi-build.c | 1 + hw/i386/pc.c | 3 +- hw/i386/x86-common.c | 1 - include/hw/acpi/ich9.h | 2 +- include/hw/acpi/piix4.h | 2 +- 11 files changed, 10 insertions(+), 372 deletions(-) delete mode 100644 hw/acpi/cpu_hotplug.c
hw/acpi/acpi-cpu-hotplug-stub.c +1 -18
@@ -1,22 +1,10 @@#include "qemu/osdep.h" -#include "hw/acpi/cpu_hotplug.h" #include "migration/vmstate.h" - +#include "hw/acpi/cpu.h" /* Following stubs are all related to ACPI cpu hotplug */ const VMStateDescription vmstate_cpu_hotplug; -void acpi_switch_to_modern_cphp (AcpiCpuHotplug *gpe_cpu, -CPUHotplugState *cpuhp_state, -uint16_t io_port) -{ -} - -void legacy_acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner, -AcpiCpuHotplug *gpe_cpu,uint16_t base) -{ -} -void cpu_hotplug_hw_init (MemoryRegion *as,Object *owner,CPUHotplugState *state,hwaddr base_addr) {
@@ -31,11 +19,6 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, { } -void legacy_acpi_cpu_plug_cb (HotplugHandler *hotplug_dev, -AcpiCpuHotplug *g,DeviceState *dev,Error **errp) -{ -} -void acpi_cpu_unplug_cb (CPUHotplugState *cpu_st,DeviceState *dev,Error **errp) {
hw/acpi/cpu_hotplug.c deleted +0 -348
348 lines not on this page · raw message
hw/acpi/generic_event_device.c +1 -0
@@ -13,6 +13,7 @@#include "qapi/error.h" #include "hw/acpi/acpi.h" #include "hw/acpi/pcihp.h" +#include "hw/acpi/cpu.h" #include "hw/acpi/generic_event_device.h" #include "hw/pci/pci.h" #include "hw/core/irq.h"
hw/acpi/ich9.c +1 -0
@@ -40,6 +40,7 @@#include "hw/southbridge/ich9.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" +#include "hw/acpi/pc-hotplug.h" static void ich9_pm_update_sci_fn (ACPIREGS *regs) {
hw/acpi/meson.build +1 -1
@@ -6,7 +6,7 @@ acpi_ss.add(files( 'core.c', 'utils.c', )) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c', 'cpu_hotplug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-hotplug-stub.c'))
hw/acpi/piix4.c +1 -1
@@ -33,7 +33,6 @@#include "system/xen.h" #include "qapi/error.h" #include "qemu/range.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/core/hotplug.h" #include "hw/mem/pc-dimm.h"
@@ -43,6 +42,7 @@#include "migration/vmstate.h" #include "hw/core/cpu.h" #include "qom/object.h" +#include "hw/acpi/pc-hotplug.h" #define GPE_BASE 0xafe0#define GPE_LEN 4
hw/i386/acpi-build.c +1 -0
@@ -35,6 +35,7 @@#include "hw/acpi/acpi-defs.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/pc-hotplug.h" #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/acpi_aml_interface.h"
hw/i386/pc.c +2 -1
@@ -48,7 +48,8 @@#include "hw/xen/xen.h" #include "qobject/qlist.h" #include "qemu/error-report.h" -#include "hw/acpi/cpu_hotplug.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/pc-hotplug.h" #include "acpi-build.h" #include "hw/mem/nvdimm.h" #include "hw/cxl/cxl_host.h"
hw/i386/x86-common.c +0 -1
@@ -36,7 +36,6 @@#include "hw/rtc/mc146818rtc.h" #include "target/i386/sev.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/core/irq.h" #include "hw/core/loader.h" #include "multiboot.h"
include/hw/acpi/ich9.h +1 -1
@@ -22,12 +22,12 @@#define HW_ACPI_ICH9_H #include "hw/acpi/acpi.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/acpi/pcihp.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/ich9_tco.h" +#include "hw/acpi/cpu.h" #define ACPI_PCIHP_ADDR_ICH9 0x0cc0
include/hw/acpi/piix4.h +1 -1
@@ -24,11 +24,11 @@#include "hw/pci/pci_device.h" #include "hw/acpi/acpi.h" -#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/pcihp.h" #include "hw/i2c/pm_smbus.h" #include "hw/isa/apm.h" +#include "hw/acpi/cpu.h" #define TYPE_PIIX4_PM "PIIX4_PM"OBJECT_DECLARE_SIMPLE_TYPE (PIIX4PMState,PIIX4_PM )
Signature · 1 line
2.34.1
PATCH v6 6/27 docs/specs/acpi_cpu_hotplug: Remove legacy cpu hotplug descriptions
In reply to Zhao LiuLegacy 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.
---
Changes since v4:
* New patch.
--- docs/specs/acpi_cpu_hotplug.rst | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-)
docs/specs/acpi_cpu_hotplug.rst +3 -25
@@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Signature · 1 line
2.34.1
PATCH v6 7/27 tests/acpi: Update DSDT tables for pc & q35 machines
In reply to Zhao LiuNow the legacy cpu hotplug way has gone away, and there's no _INIT method in DSDT table for modern cpu hotplug support.
Update DSDT tables for pc machine, and_INIT methods are removed from DSDT tables:
- Method (_INI, 0, Serialized) // _INI: Initialize
- {
- CSEL = Zero
- }
---
Changes since v5:
* Merge pc & q35 changes into one patch and simplify the commit message.
Changes since v4:
* New patch.
--- tests/data/acpi/x86/pc/DSDT | Bin 8611 -> 8598 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8522 -> 8509 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9936 -> 9923 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15482 -> 15469 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9075 -> 9062 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10265 -> 10252 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8562 -> 8549 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5100 -> 5087 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8683 -> 8670 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9970 -> 9957 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8469 -> 8456 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8617 -> 8604 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12404 -> 12391 bytes tests/data/acpi/x86/q35/DSDT | Bin 8440 -> 8427 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9765 -> 9752 bytes .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12650 -> 12637 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8719 -> 8706 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8486 -> 8473 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12053 -> 12040 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8904 -> 8891 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13231 -> 13218 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10094 -> 10081 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8515 -> 8502 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8528 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8457 -> 8444 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9799 -> 9786 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9570 -> 9557 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13293 -> 13280 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8302 -> 8289 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8298 -> 8285 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8446 -> 8433 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8541 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12998 -> 12985 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33855 -> 33842 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9046 -> 9033 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9072 -> 9059 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18674 -> 18661 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14697 -> 14684 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35803 -> 35790 bytes tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------ 43 files changed, 42 deletions(-)
tests/data/acpi/x86/pc/DSDT binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
tests/data/acpi/x86/q35/DSDT binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -42
43 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v6 8/27 hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma() to distinct with the DMA version (currently named fw_cfg_init_mem_wide).
--- hw/hppa/machine.c | 2 +- hw/nvram/fw_cfg.c | 7 +++---- include/hw/nvram/fw_cfg.h | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-)
hw/hppa/machine.c +1 -1
@@ -208,7 +208,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus,int btlb_entries =HPPA_BTLB_ENTRIES (&cpu[0 ]->env);int len; - fw_cfg =fw_cfg_init_mem (addr, addr +4 ); + fw_cfg =fw_cfg_init_mem_nodma (addr, addr +4 ,1 );fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , ms->smp.cpus);fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS ,HPPA_MAX_CPUS );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , ms->ram_size);
hw/nvram/fw_cfg.c +3 -4
@@ -1088,11 +1088,10 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,return s; } -FWCfgState *fw_cfg_init_mem (hwaddr ctl_addr,hwaddr data_addr) +FWCfgState *fw_cfg_init_mem_nodma (hwaddr ctl_addr,hwaddr data_addr, +unsigned data_width) { -return fw_cfg_init_mem_wide (ctl_addr, data_addr, - fw_cfg_data_mem_ops.valid.max_access_size, -0 ,NULL ); +return fw_cfg_init_mem_wide (ctl_addr, data_addr, data_width,0 ,NULL ); }
include/hw/nvram/fw_cfg.h +2 -1
@@ -307,7 +307,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s,FWCfgState *fw_cfg_init_io_dma (uint32_t iobase,uint32_t dma_iobase,AddressSpace *dma_as); -FWCfgState *fw_cfg_init_mem (hwaddr ctl_addr,hwaddr data_addr); +FWCfgState *fw_cfg_init_mem_nodma (hwaddr ctl_addr,hwaddr data_addr, +unsigned data_width);FWCfgState *fw_cfg_init_mem_wide (hwaddr ctl_addr,hwaddr data_addr,uint32_t data_width,hwaddr dma_addr,AddressSpace *dma_as);
Signature · 1 line
2.34.1
PATCH v6 9/27 hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
fw_cfg_init_mem_wide() is prefered to initialize fw_cfg with DMA support. Without DMA, use fw_cfg_init_mem_nodma().
--- hw/mips/loongson3_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/loongson3_virt.c +1 -1
@@ -287,7 +287,7 @@ static void fw_conf_init(void)FWCfgState *fw_cfg;hwaddr cfg_addr = virt_memmap[VIRT_FW_CFG ].base; - fw_cfg =fw_cfg_init_mem_wide (cfg_addr, cfg_addr +8 ,8 ,0 ,NULL ); + fw_cfg =fw_cfg_init_mem_nodma (cfg_addr, cfg_addr +8 ,8 );fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )current_machine->smp.cpus);fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )current_machine->smp.max_cpus);fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , loaderparams.ram_size);
Signature · 1 line
2.34.1
PATCH v6 10/27 hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
Factor fw_cfg_init_mem_internal() out of fw_cfg_init_mem_wide(). In fw_cfg_init_mem_wide(), assert DMA arguments are provided. Callers without DMA have to use the fw_cfg_init_mem() helper.
---
Changes since v4:
* Fix a "typo" argument in fw_cfg_init_mem_wide().
--- hw/nvram/fw_cfg.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
hw/nvram/fw_cfg.c +13 -4
@@ -1054,9 +1054,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,return s; } -FWCfgState *fw_cfg_init_mem_wide (hwaddr ctl_addr, -hwaddr data_addr,uint32_t data_width, -hwaddr dma_addr,AddressSpace *dma_as) +static FWCfgState *fw_cfg_init_mem_internal (hwaddr ctl_addr, +hwaddr data_addr,uint32_t data_width, +hwaddr dma_addr,AddressSpace *dma_as) {DeviceState *dev;SysBusDevice *sbd;
@@ -1088,10 +1088,19 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,return s; } +FWCfgState *fw_cfg_init_mem_wide (hwaddr ctl_addr, +hwaddr data_addr,uint32_t data_width, +hwaddr dma_addr,AddressSpace *dma_as) +{ +assert (dma_addr && dma_as); +return fw_cfg_init_mem_internal (ctl_addr, data_addr, data_width, + dma_addr, dma_as); +} +FWCfgState *fw_cfg_init_mem_nodma (hwaddr ctl_addr,hwaddr data_addr,unsigned data_width) { -return fw_cfg_init_mem_wide (ctl_addr, data_addr, data_width,0 ,NULL ); +return fw_cfg_init_mem_internal (ctl_addr, data_addr, data_width,0 ,NULL ); }
Signature · 1 line
2.34.1
PATCH v6 11/27 hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
"wide" in fw_cfg_init_mem_wide() means "DMA support". Rename for clarity.
---
Changes since v4:
* Fix a missing case in hw/loongarch/fw_cfg.c.
--- hw/arm/virt.c | 2 +- hw/loongarch/fw_cfg.c | 4 ++-- hw/nvram/fw_cfg.c | 6 +++--- hw/riscv/virt.c | 4 ++-- include/hw/nvram/fw_cfg.h | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-)
hw/arm/virt.c +1 -1
@@ -1412,7 +1412,7 @@ static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as)FWCfgState *fw_cfg;char *nodename; - fw_cfg =fw_cfg_init_mem_wide (base +8 , base,8 , base +16 , as); + fw_cfg =fw_cfg_init_mem_dma (base +8 , base,8 , base +16 , as);fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )ms->smp.cpus); nodename =g_strdup_printf ("/fw-cfg@%" PRIx64, base);
hw/loongarch/fw_cfg.c +2 -2
@@ -23,8 +23,8 @@ FWCfgState *virt_fw_cfg_init(ram_addr_t ram_size, MachineState *ms)int max_cpus = ms->smp.max_cpus;int smp_cpus = ms->smp.cpus; - fw_cfg =fw_cfg_init_mem_wide (VIRT_FWCFG_BASE +8 ,VIRT_FWCFG_BASE ,8 , -VIRT_FWCFG_BASE +16 , &address_space_memory); + fw_cfg =fw_cfg_init_mem_dma (VIRT_FWCFG_BASE +8 ,VIRT_FWCFG_BASE ,8 , +VIRT_FWCFG_BASE +16 , &address_space_memory);fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus);fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);
hw/nvram/fw_cfg.c +3 -3
@@ -1088,9 +1088,9 @@ static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr,return s; } -FWCfgState *fw_cfg_init_mem_wide (hwaddr ctl_addr, -hwaddr data_addr,uint32_t data_width, -hwaddr dma_addr,AddressSpace *dma_as) +FWCfgState *fw_cfg_init_mem_dma (hwaddr ctl_addr, +hwaddr data_addr,uint32_t data_width, +hwaddr dma_addr,AddressSpace *dma_as) {assert (dma_addr && dma_as); return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width,
hw/riscv/virt.c +2 -2
@@ -1274,8 +1274,8 @@ static FWCfgState *create_fw_cfg(const MachineState *ms, hwaddr base) {FWCfgState *fw_cfg; - fw_cfg =fw_cfg_init_mem_wide (base +8 , base,8 , base +16 , - &address_space_memory); + fw_cfg =fw_cfg_init_mem_dma (base +8 , base,8 , base +16 , + &address_space_memory);fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , (uint16_t )ms->smp.cpus);return fw_cfg;
include/hw/nvram/fw_cfg.h +3 -3
@@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as);FWCfgState *fw_cfg_init_mem_nodma (hwaddr ctl_addr,hwaddr data_addr,unsigned data_width); -FWCfgState *fw_cfg_init_mem_wide (hwaddr ctl_addr, -hwaddr data_addr,uint32_t data_width, -hwaddr dma_addr,AddressSpace *dma_as); +FWCfgState *fw_cfg_init_mem_dma (hwaddr ctl_addr, +hwaddr data_addr,uint32_t data_width, +hwaddr dma_addr,AddressSpace *dma_as);FWCfgState *fw_cfg_find (void );bool fw_cfg_dma_enabled (void *opaque);
Signature · 1 line
2.34.1
PATCH v6 12/27 hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The X86MachineClass::fwcfg_dma_enabled boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify.
'multiboot.bin' isn't used anymore, we'll remove it in the next commit.
--- hw/i386/microvm.c | 3 --- hw/i386/multiboot.c | 7 +------ hw/i386/x86-common.c | 3 +-- hw/i386/x86.c | 2 -- include/hw/i386/x86.h | 2 -- 5 files changed, 2 insertions(+), 15 deletions(-)
hw/i386/microvm.c +0 -3
@@ -640,7 +640,6 @@ GlobalProperty microvm_properties[] = {static void microvm_class_init (ObjectClass *oc,const void *data) { -X86MachineClass *x86mc =X86_MACHINE_CLASS (oc);MicrovmMachineClass *mmc =MICROVM_MACHINE_CLASS (oc);MachineClass *mc =MACHINE_CLASS (oc);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (oc);
@@ -674,8 +673,6 @@ static void microvm_class_init(ObjectClass *oc, const void *data) hc->unplug_request = microvm_device_unplug_request_cb; hc->unplug = microvm_device_unplug_cb; - x86mc->fwcfg_dma_enabled = true; - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", microvm_machine_get_rtc, microvm_machine_set_rtc,
hw/i386/multiboot.c +1 -6
@@ -153,7 +153,6 @@ int load_multiboot(X86MachineState *x86ms,int kernel_file_size, uint8_t *header) { - bool multiboot_dma_enabled = X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma_enabled; int i, is_multiboot = 0;uint32_t flags =0 ;uint32_t mh_entry_addr;
@@ -402,11 +401,7 @@ int load_multiboot(X86MachineState *x86ms,fw_cfg_add_bytes (fw_cfg,FW_CFG_INITRD_DATA , mb_bootinfo_data,sizeof (bootinfo)); -if (multiboot_dma_enabled) { - option_rom[nb_option_roms].name ="multiboot_dma.bin" ; - }else { - option_rom[nb_option_roms].name ="multiboot.bin" ; - } + option_rom[nb_option_roms].name ="multiboot_dma.bin" ; option_rom[nb_option_roms].bootindex =0 ; nb_option_roms++;
hw/i386/x86-common.c +1 -2
@@ -645,7 +645,6 @@ void x86_load_linux(X86MachineState *x86ms,int acpi_data_size, bool pvh_enabled) { - bool linuxboot_dma_enabled = X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma_enabled; uint16_t protocol;int setup_size, kernel_size, cmdline_size;int dtb_size, setup_data_offset;
@@ -1004,7 +1003,7 @@ void x86_load_linux(X86MachineState *x86ms, option_rom[nb_option_roms].bootindex =0 ; option_rom[nb_option_roms].name ="linuxboot.bin" ; -if (linuxboot_dma_enabled &&fw_cfg_dma_enabled (fw_cfg)) { +if (fw_cfg_dma_enabled (fw_cfg)) { option_rom[nb_option_roms].name ="linuxboot_dma.bin" ; } nb_option_roms++;
hw/i386/x86.c +0 -2
@@ -375,14 +375,12 @@ static void x86_machine_initfn(Object *obj)static void x86_machine_class_init (ObjectClass *oc,const void *data) {MachineClass *mc =MACHINE_CLASS (oc); -X86MachineClass *x86mc =X86_MACHINE_CLASS (oc);NMIClass *nc =NMI_CLASS (oc); mc->cpu_index_to_instance_props = x86_cpu_index_to_props; mc->get_default_cpu_node_id = x86_get_default_cpu_node_id; mc->possible_cpu_arch_ids = x86_possible_cpu_arch_ids; mc->kvm_type = x86_kvm_type; - x86mc->fwcfg_dma_enabled = true; nc->nmi_monitor_handler = x86_nmi; object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto",
include/hw/i386/x86.h +0 -2
@@ -30,8 +30,6 @@struct X86MachineClass {MachineClass parent; -/* use DMA capable linuxboot option rom */ -bool fwcfg_dma_enabled;/* CPU and apic information: */ bool apic_xrupt_override; };
Signature · 1 line
2.34.1
PATCH v6 13/27 hw/i386/pc: Remove multiboot.bin
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
All PC machines now use the multiboot_dma.bin binary, we can remove the non-DMA version (multiboot.bin).
This doesn't change multiboot_dma binary file.
---
Changes since v4:
* There's a recent change for multiboot.S: commit 4c8f69b94839. Rebase this patch on that.
--- hw/i386/pc.c | 1 - pc-bios/meson.build | 1 - pc-bios/multiboot.bin | Bin 1024 -> 0 bytes pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/multiboot.S | 232 ----------------------------- pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++++++++++++++++++++- pc-bios/optionrom/optionrom.h | 4 - 7 files changed, 233 insertions(+), 241 deletions(-) delete mode 100644 pc-bios/multiboot.bin delete mode 100644 pc-bios/optionrom/multiboot.S
hw/i386/pc.c +0 -1
@@ -669,7 +669,6 @@ void xen_load_linux(PCMachineState *pcms)assert (!strcmp (option_rom[i].name,"linuxboot.bin" ) || !strcmp (option_rom[i].name,"linuxboot_dma.bin" ) || !strcmp (option_rom[i].name,"pvh.bin" ) || - !strcmp (option_rom[i].name,"multiboot.bin" ) || !strcmp (option_rom[i].name,"multiboot_dma.bin" ));rom_add_option (option_rom[i].name, option_rom[i].bootindex); }
pc-bios/meson.build +0 -1
@@ -62,7 +62,6 @@ blobs = [ 'efi-e1000e.rom', 'efi-vmxnet3.rom', 'qemu-nsis.bmp', - 'multiboot.bin', 'multiboot_dma.bin', 'linuxboot.bin', 'linuxboot_dma.bin',
pc-bios/multiboot.bin deleted binary +0 -0
pc-bios/optionrom/Makefile +1 -1
@@ -2,7 +2,7 @@ include config.mak SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom VPATH = $(SRC_DIR) -all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin +all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true
pc-bios/optionrom/multiboot.S deleted +0 -232
232 lines not on this page · raw message
pc-bios/optionrom/multiboot_dma.S +232 -2
234 lines not on this page · raw message
pc-bios/optionrom/optionrom.h +0 -4
@@ -117,16 +117,12 @@* * Clobbers: %eax, %edx, %es, %ecx, %edi and adresses %esp-20 to %esp */ -#ifdef USE_FW_CFG_DMA #define read_fw_blob_dma (var) \ read_fw var ## _SIZE; \ mov %eax, %ecx; \ read_fw var ## _ADDR; \ mov %eax, %edi ; \ read_fw_dma var ## _DATA, %ecx, %edi -#else -#define read_fw_blob_dma (var) read_fw_blob(var) -#endif #define read_fw_blob_pre (var) \ read_fw var ## _SIZE; \
Signature · 1 line
2.34.1
PATCH v6 14/27 hw/i386: Assume fw_cfg DMA is always enabled
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
Now all calls of x86 machines to fw_cfg_init_io_dma() pass DMA arguments, so the FWCfgState (FWCfgIoState) created by x86 machines enables DMA by default.
Although other callers of fw_cfg_init_io_dma() besides x86 also pass DMA arguments to create DMA-enabled FwCfgIoState, the "dma_enabled" property of FwCfgIoState cannot yet be removed, because Sun4u and Sun4v still create DMA-disabled FwCfgIoState (bypass fw_cfg_init_io_dma()) in sun4uv_init() (hw/sparc64/sun4u.c).
Maybe reusing fw_cfg_init_io_dma() for them would be a better choice, or adding fw_cfg_init_io_nodma(). However, before that, first simplify the handling of FwCfgState in x86.
Considering that FwCfgIoState in x86 enables DMA by default, remove the handling for DMA-disabled cases and replace DMA checks with assertions to ensure that the default DMA-enabled setting is not broken.
Then 'linuxboot.bin' isn't used anymore, and it will be removed in the next commit.
---
Changes since v4:
* Keep "dma_enabled" property in fw_cfg_io_properties[].
* Replace DMA checks with assertions for x86 machines.
--- hw/i386/fw_cfg.c | 16 ++++++++-------- hw/i386/x86-common.c | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-)
hw/i386/fw_cfg.c +8 -8
@@ -215,18 +215,18 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg)#ifdef CONFIG_ACPI void fw_cfg_add_acpi_dsdt (Aml *scope,FWCfgState *fw_cfg) { +uint8_t io_size; +Aml *dev =aml_device ("FWCF" ); +Aml *crs =aml_resource_template (); +/* * when using port i/o, the 8-bit data register *always* overlaps * with half of the 16-bit control register. Hence, the total size -* of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the -* DMA control register is located at FW_CFG_DMA_IO_BASE + 4 +* of the i/o region used is FW_CFG_CTL_SIZE; And the DMA control +* register is located at FW_CFG_DMA_IO_BASE + 4 */ -Object *obj =OBJECT (fw_cfg); -uint8_t io_size =object_property_get_bool (obj,"dma_enabled" ,NULL ) ? -ROUND_UP (FW_CFG_CTL_SIZE ,4 ) +sizeof (dma_addr_t) : -FW_CFG_CTL_SIZE ; -Aml *dev =aml_device ("FWCF" ); -Aml *crs =aml_resource_template (); +assert (fw_cfg_dma_enabled (fw_cfg)); + io_size =ROUND_UP (FW_CFG_CTL_SIZE ,4 ) +sizeof (dma_addr_t);aml_append (dev,aml_name_decl ("_HID" ,aml_string ("QEMU0002" )));
hw/i386/x86-common.c +2 -4
@@ -1002,10 +1002,8 @@ void x86_load_linux(X86MachineState *x86ms, } option_rom[nb_option_roms].bootindex =0 ; - option_rom[nb_option_roms].name ="linuxboot.bin" ; -if (fw_cfg_dma_enabled (fw_cfg)) { - option_rom[nb_option_roms].name ="linuxboot_dma.bin" ; - } +assert (fw_cfg_dma_enabled (fw_cfg)); + option_rom[nb_option_roms].name ="linuxboot_dma.bin" ; nb_option_roms++; }
Signature · 1 line
2.34.1
Re: [PATCH v6 14/27] hw/i386: Assume fw_cfg DMA is always enabled
Quoted 26 lines · Zhao Liu
From: Philippe Mathieu-Daudé <[email protected]>
Now all calls of x86 machines to
fw_cfg_init_io_dma()pass DMA arguments, so the FWCfgState (FWCfgIoState) created by x86 machines enables DMA by default.Although other callers of
fw_cfg_init_io_dma()besides x86 also pass DMA arguments to create DMA-enabled FwCfgIoState, the "dma_enabled" property of FwCfgIoState cannot yet be removed, because Sun4u and Sun4v still create DMA-disabled FwCfgIoState (bypassfw_cfg_init_io_dma()) insun4uv_init()(hw/sparc64/sun4u.c).Maybe reusing
fw_cfg_init_io_dma()for them would be a better choice, or addingfw_cfg_init_io_nodma(). However, before that, first simplify the handling of FwCfgState in x86.Considering that FwCfgIoState in x86 enables DMA by default, remove the handling for DMA-disabled cases and replace DMA checks with assertions to ensure that the default DMA-enabled setting is not broken.
Then 'linuxboot.bin' isn't used anymore, and it will be removed in the next commit.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Zhao Liu <[email protected]>Acked-by Igor Mammedov <[email protected]>
Quoted 8 lines
---
Changes since v4:
* Keep "dma_enabled" property in fw_cfg_io_properties[].
* Replace DMA checks with assertions for x86 machines.--- hw/i386/fw_cfg.c | 16 ++++++++-------- hw/i386/x86-common.c | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-)
PATCH v6 15/27 hw/i386: Remove linuxboot.bin
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
All machines now use the linuxboot_dma.bin binary, so it's safe to remove the non-DMA version (linuxboot.bin).
---
Changes since v4:
* Update commit message: not only pc, but also microvm enables DMA for FwCfgState (in microvm_memory_init).
--- hw/i386/pc.c | 3 +- pc-bios/meson.build | 1 - pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/linuxboot.S | 195 ---------------------------------- 4 files changed, 2 insertions(+), 199 deletions(-) delete mode 100644 pc-bios/optionrom/linuxboot.S
hw/i386/pc.c +1 -2
@@ -666,8 +666,7 @@ void xen_load_linux(PCMachineState *pcms)x86_load_linux (x86ms, fw_cfg,PC_FW_DATA , pcmc->pvh_enabled);for (i =0 ; i < nb_option_roms; i++) { -assert (!strcmp (option_rom[i].name,"linuxboot.bin" ) || - !strcmp (option_rom[i].name,"linuxboot_dma.bin" ) || +assert (!strcmp (option_rom[i].name,"linuxboot_dma.bin" ) || !strcmp (option_rom[i].name,"pvh.bin" ) || !strcmp (option_rom[i].name,"multiboot_dma.bin" ));rom_add_option (option_rom[i].name, option_rom[i].bootindex);
pc-bios/meson.build +0 -1
@@ -63,7 +63,6 @@ blobs = [ 'efi-vmxnet3.rom', 'qemu-nsis.bmp', 'multiboot_dma.bin', - 'linuxboot.bin', 'linuxboot_dma.bin', 'kvmvapic.bin', 'pvh.bin',
pc-bios/optionrom/Makefile +1 -1
@@ -2,7 +2,7 @@ include config.mak SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom VPATH = $(SRC_DIR) -all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin +all: multiboot_dma.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true
pc-bios/optionrom/linuxboot.S deleted +0 -195
195 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v6 15/27] hw/i386: Remove linuxboot.bin
Quoted 13 lines · Zhao Liu
From: Philippe Mathieu-Daudé <[email protected]>
All machines now use the linuxboot_dma.bin binary, so it's safe to remove the non-DMA version (linuxboot.bin).
Suggested-by Thomas Huth <[email protected]>Reviewed-by Zhao Liu <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Zhao Liu <[email protected]>---
Changes since v4:
* Update commit message: not only pc, but also microvm enables DMA for FwCfgState (inmicrovm_memory_init).
Quoted 7 lines
--- hw/i386/pc.c | 3 +- pc-bios/meson.build | 1 - pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/linuxboot.S | 195 ---------------------------------- 4 files changed, 2 insertions(+), 199 deletions(-)delete mode 100644
pc-bios/optionrom/linuxboot.S
PATCH v6 16/27 hw/i386/pc: Remove pc_compat_2_6[] array
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The pc_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.
--- hw/i386/pc.c | 8 -------- include/hw/i386/pc.h | 3 --- 2 files changed, 11 deletions(-)
hw/i386/pc.c +0 -8
@@ -263,14 +263,6 @@ GlobalProperty pc_compat_2_7[] = { };const size_t pc_compat_2_7_len =G_N_ELEMENTS (pc_compat_2_7); -GlobalProperty pc_compat_2_6[] = { - {TYPE_X86_CPU ,"cpuid-0xb" ,"off" }, - {"vmxnet3" ,"romfile" ,"" }, - {TYPE_X86_CPU ,"fill-mtrr-mask" ,"off" }, - {"apic-common" ,"legacy-instance-id" ,"on" , } -}; -const size_t pc_compat_2_6_len =G_N_ELEMENTS (pc_compat_2_6); -/* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
include/hw/i386/pc.h +0 -3
@@ -295,9 +295,6 @@ extern const size_t pc_compat_2_8_len;extern GlobalProperty pc_compat_2_7[];extern const size_t pc_compat_2_7_len; -extern GlobalProperty pc_compat_2_6[]; -extern const size_t pc_compat_2_6_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \
Signature · 1 line
2.34.1
PATCH v6 17/27 hw/intc/apic: Remove APICCommonState::legacy_instance_id field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The APICCommonState::legacy_instance_id boolean was only set in the pc_compat_2_6[] array, via the 'legacy-instance-id=on' property. We removed all machines using that array, lets remove that property, simplifying apic_common_realize().
Because instance_id is initialized as initial_apic_id, we can not register vmstate_apic_common directly via dc->vmsd.
--- hw/intc/apic_common.c | 5 ----- include/hw/i386/apic_internal.h | 1 - 2 files changed, 6 deletions(-)
hw/intc/apic_common.c +0 -5
@@ -276,9 +276,6 @@ static void apic_common_realize(DeviceState *dev, Error **errp) info->enable_tpr_reporting (s, true); } -if (s->legacy_instance_id) { - instance_id =VMSTATE_INSTANCE_ID_ANY ; - }vmstate_register_with_alias_id (NULL , instance_id, &vmstate_apic_common, s,-1 ,0 ,NULL );
@@ -395,8 +392,6 @@ static const Property apic_properties_common[] = {DEFINE_PROP_UINT8 ("version" , APICCommonState, version,0x14 ),DEFINE_PROP_BIT ("vapic" , APICCommonState, vapic_control,VAPIC_ENABLE_BIT , true), -DEFINE_PROP_BOOL ("legacy-instance-id" , APICCommonState, legacy_instance_id, - false), }; static void apic_common_get_id(Object *obj, Visitor *v, const char *name,
include/hw/i386/apic_internal.h +0 -1
@@ -187,7 +187,6 @@ struct APICCommonState {uint32_t vapic_control;DeviceState *vapic;hwaddr vapic_paddr;/* note: persistence via kvmvapic */ -bool legacy_instance_id;uint32_t extended_log_dest; };
Signature · 1 line
2.34.1
PATCH v6 18/27 hw/core/machine: Remove hw_compat_2_6[] array
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The hw_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.
--- hw/core/machine.c | 8 -------- include/hw/core/boards.h | 3 --- 2 files changed, 11 deletions(-)
hw/core/machine.c +0 -8
@@ -290,14 +290,6 @@ GlobalProperty hw_compat_2_7[] = { };const size_t hw_compat_2_7_len =G_N_ELEMENTS (hw_compat_2_7); -GlobalProperty hw_compat_2_6[] = { - {"virtio-mmio" ,"format_transport_address" ,"off" }, -/* Optional because not all virtio-pci devices support legacy mode */ - {"virtio-pci" ,"disable-modern" ,"on" , .optional = true }, - {"virtio-pci" ,"disable-legacy" ,"off" , .optional = true }, -}; -const size_t hw_compat_2_6_len =G_N_ELEMENTS (hw_compat_2_6); -MachineState *current_machine;static char *machine_get_kernel (Object *obj,Error **errp)
include/hw/core/boards.h +0 -3
@@ -882,7 +882,4 @@ extern const size_t hw_compat_2_8_len;extern GlobalProperty hw_compat_2_7[];extern const size_t hw_compat_2_7_len; -extern GlobalProperty hw_compat_2_6[]; -extern const size_t hw_compat_2_6_len; -#endif
Signature · 1 line
2.34.1
PATCH v6 19/27 hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The VirtIOMMIOProxy::format_transport_address boolean was only set in the hw_compat_2_6[] array, via the 'format_transport_address=off' property. We removed all machines using that array, lets remove that property, simplifying virtio_mmio_bus_get_dev_path().
--- hw/virtio/virtio-mmio.c | 15 --------------- include/hw/virtio/virtio-mmio.h | 1 - 2 files changed, 16 deletions(-)
hw/virtio/virtio-mmio.c +0 -15
@@ -764,8 +764,6 @@ static void virtio_mmio_pre_plugged(DeviceState *d, Error **errp)/* virtio-mmio device */ static const Property virtio_mmio_properties[] = { -DEFINE_PROP_BOOL ("format_transport_address" , VirtIOMMIOProxy, - format_transport_address, true),DEFINE_PROP_BOOL ("force-legacy" , VirtIOMMIOProxy, legacy, true),DEFINE_PROP_BIT ("ioeventfd" , VirtIOMMIOProxy, flags,VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD_BIT , true),
@@ -827,19 +825,6 @@ static char *virtio_mmio_bus_get_dev_path(DeviceState *dev) virtio_mmio_proxy =VIRTIO_MMIO (virtio_mmio_bus->parent); proxy_path =qdev_get_dev_path (DEVICE (virtio_mmio_proxy)); -/* -* If @format_transport_address is false, then we just perform the same as -* virtio_bus_get_dev_path(): we delegate the address formatting for the -* device on the virtio-mmio bus to the bus that the virtio-mmio proxy -* (i.e., the device that implements the virtio-mmio bus) resides on. In -* this case the base address of the virtio-mmio transport will be -* invisible. -*/ -if (!virtio_mmio_proxy->format_transport_address) { -return proxy_path; - } - -/* Otherwise, we append the base address of the transport. */ section =memory_region_find (&virtio_mmio_proxy->iomem,0 ,0x200 );assert (section.mr);
include/hw/virtio/virtio-mmio.h +0 -1
@@ -66,7 +66,6 @@ struct VirtIOMMIOProxy {uint32_t guest_page_shift;/* virtio-bus */ VirtioBusState bus; -bool format_transport_address;/* Fields only used for non-legacy (v2) devices */ uint32_t guest_features[2 ];VirtIOMMIOQueue vqs[VIRTIO_QUEUE_MAX ];
Signature · 1 line
2.34.1
PATCH v6 20/27 hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed. Remove the qtest in test-x86-cpuid-compat.c file.
--- hw/i386/pc_piix.c | 9 --------- hw/i386/pc_q35.c | 10 ---------- tests/qtest/test-x86-cpuid-compat.c | 11 ----------- 3 files changed, 30 deletions(-)
hw/i386/pc_piix.c +0 -9
@@ -724,15 +724,6 @@ static void pc_i440fx_machine_2_8_options(MachineClass *m)DEFINE_I440FX_MACHINE (2 ,8 ); -static void pc_i440fx_machine_2_7_options (MachineClass *m) -{ -pc_i440fx_machine_2_8_options (m); -compat_props_add (m->compat_props, hw_compat_2_7, hw_compat_2_7_len); -compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); -} - -DEFINE_I440FX_MACHINE (2 ,7 ); -#ifdef CONFIG_XEN static void xenfv_machine_4_2_options (MachineClass *m) {
hw/i386/pc_q35.c +0 -10
@@ -671,13 +671,3 @@ static void pc_q35_machine_2_8_options(MachineClass *m) }DEFINE_Q35_MACHINE (2 ,8 ); - -static void pc_q35_machine_2_7_options (MachineClass *m) -{ -pc_q35_machine_2_8_options (m); - m->max_cpus =255 ; -compat_props_add (m->compat_props, hw_compat_2_7, hw_compat_2_7_len); -compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); -} - -DEFINE_Q35_MACHINE (2 ,7 );
tests/qtest/test-x86-cpuid-compat.c +0 -11
@@ -345,17 +345,6 @@ int main(int argc, char **argv)/* Check compatibility of old machine-types that didn't * auto-increase level/xlevel/xlevel2: */ -if (qtest_has_machine ("pc-i440fx-2.7" )) { -add_cpuid_test ("x86/cpuid/auto-level/pc-2.7" , -"486" ,"arat=on,avx512vbmi=on,xsaveopt=on" , -"pc-i440fx-2.7" ,"level" ,1 ); -add_cpuid_test ("x86/cpuid/auto-xlevel/pc-2.7" , -"486" ,"3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on" , -"pc-i440fx-2.7" ,"xlevel" ,0 ); -add_cpuid_test ("x86/cpuid/auto-xlevel2/pc-2.7" , -"486" ,"xstore=on" ,"pc-i440fx-2.7" , -"xlevel2" ,0 ); - }if (qtest_has_machine ("pc-i440fx-2.9" )) { add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/off", "Conroe", NULL, "pc-i440fx-2.9",
Signature · 1 line
2.34.1
PATCH v6 21/27 hw/i386/pc: Remove pc_compat_2_7[] array
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.
--- hw/i386/pc.c | 10 ---------- include/hw/i386/pc.h | 3 --- 2 files changed, 13 deletions(-)
hw/i386/pc.c +0 -10
@@ -253,16 +253,6 @@ GlobalProperty pc_compat_2_8[] = { };const size_t pc_compat_2_8_len =G_N_ELEMENTS (pc_compat_2_8); -GlobalProperty pc_compat_2_7[] = { - {TYPE_X86_CPU ,"l3-cache" ,"off" }, - {TYPE_X86_CPU ,"full-cpuid-auto-level" ,"off" }, - {"Opteron_G3" "-" TYPE_X86_CPU ,"family" ,"15" }, - {"Opteron_G3" "-" TYPE_X86_CPU ,"model" ,"6" }, - {"Opteron_G3" "-" TYPE_X86_CPU ,"stepping" ,"1" }, - {"isa-pcspk" ,"migrate" ,"off" }, -}; -const size_t pc_compat_2_7_len =G_N_ELEMENTS (pc_compat_2_7); -/* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
include/hw/i386/pc.h +0 -3
@@ -292,9 +292,6 @@ extern const size_t pc_compat_2_9_len;extern GlobalProperty pc_compat_2_8[];extern const size_t pc_compat_2_8_len; -extern GlobalProperty pc_compat_2_7[]; -extern const size_t pc_compat_2_7_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \
Signature · 1 line
2.34.1
PATCH v6 22/27 target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The CPUX86State::full_cpuid_auto_level boolean was only disabled for the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Being now always %true, we can remove it and simplify x86_cpu_expand_features().
---
Note, although libvirt still uses this property in its test cases, it was confirmed this property is not exposed to user directly [*].
[*]: https://lore.kernel.org/qemu-devel/[email protected]/
--- target/i386/cpu.c | 119 ++++++++++++++++++++++------------------------ target/i386/cpu.h | 3 -- 2 files changed, 58 insertions(+), 64 deletions(-)
target/i386/cpu.c +58 -61
@@ -9518,74 +9518,72 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)/* CPUID[EAX=7,ECX=0].EBX always increased level automatically: */ x86_cpu_adjust_feat_level (cpu,FEAT_7_0_EBX ); -if (cpu->full_cpuid_auto_level) { -x86_cpu_adjust_feat_level (cpu,FEAT_1_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_1_ECX ); -x86_cpu_adjust_feat_level (cpu,FEAT_6_EAX ); -x86_cpu_adjust_feat_level (cpu,FEAT_7_0_ECX ); -x86_cpu_adjust_feat_level (cpu,FEAT_7_1_EAX ); -x86_cpu_adjust_feat_level (cpu,FEAT_7_1_ECX ); -x86_cpu_adjust_feat_level (cpu,FEAT_7_1_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_7_2_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_8000_0001_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_8000_0001_ECX ); -x86_cpu_adjust_feat_level (cpu,FEAT_8000_0007_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_8000_0008_EBX ); -x86_cpu_adjust_feat_level (cpu,FEAT_C000_0001_EDX ); -x86_cpu_adjust_feat_level (cpu,FEAT_SVM ); -x86_cpu_adjust_feat_level (cpu,FEAT_XSAVE ); - -/* Intel Processor Trace requires CPUID[0x14] */ -if ((env->features[FEAT_7_0_EBX ] &CPUID_7_0_EBX_INTEL_PT )) { -if (cpu->intel_pt_auto_level) { -x86_cpu_adjust_level (cpu, &cpu->env.cpuid_min_level,0x14 ); - }else if (cpu->env.cpuid_min_level <0x14 ) { -mark_unavailable_features (cpu,FEAT_7_0_EBX , -CPUID_7_0_EBX_INTEL_PT , -"Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"" ); - } +x86_cpu_adjust_feat_level (cpu,FEAT_1_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_1_ECX ); +x86_cpu_adjust_feat_level (cpu,FEAT_6_EAX ); +x86_cpu_adjust_feat_level (cpu,FEAT_7_0_ECX ); +x86_cpu_adjust_feat_level (cpu,FEAT_7_1_EAX ); +x86_cpu_adjust_feat_level (cpu,FEAT_7_1_ECX ); +x86_cpu_adjust_feat_level (cpu,FEAT_7_1_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_7_2_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_8000_0001_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_8000_0001_ECX ); +x86_cpu_adjust_feat_level (cpu,FEAT_8000_0007_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_8000_0008_EBX ); +x86_cpu_adjust_feat_level (cpu,FEAT_C000_0001_EDX ); +x86_cpu_adjust_feat_level (cpu,FEAT_SVM ); +x86_cpu_adjust_feat_level (cpu,FEAT_XSAVE ); + +/* Intel Processor Trace requires CPUID[0x14] */ +if ((env->features[FEAT_7_0_EBX ] &CPUID_7_0_EBX_INTEL_PT )) { +if (cpu->intel_pt_auto_level) { +x86_cpu_adjust_level (cpu, &cpu->env.cpuid_min_level,0x14 ); + }else if (cpu->env.cpuid_min_level <0x14 ) { +mark_unavailable_features (cpu,FEAT_7_0_EBX , +CPUID_7_0_EBX_INTEL_PT , +"Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"" ); } + } -/* -* Intel CPU topology with multi-dies support requires CPUID[0x1F]. -* For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect -* extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless -* cpu->vendor_cpuid_only has been unset for compatibility with older -* machine types. -*/ -if (x86_has_cpuid_0x1f (cpu) && - (IS_INTEL_CPU (env) || !cpu->vendor_cpuid_only)) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x1F ); - } +/* +* Intel CPU topology with multi-dies support requires CPUID[0x1F]. +* For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect +* extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless +* cpu->vendor_cpuid_only has been unset for compatibility with older +* machine types. +*/ +if (x86_has_cpuid_0x1f (cpu) && + (IS_INTEL_CPU (env) || !cpu->vendor_cpuid_only)) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x1F ); + } -/* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */ -if (env->features[FEAT_7_1_EDX ] &CPUID_7_1_EDX_AVX10 ) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x24 ); - } +/* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */ +if (env->features[FEAT_7_1_EDX ] &CPUID_7_1_EDX_AVX10 ) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x24 ); + } -/* Advanced Performance Extensions (APX) requires CPUID[0x29] */ -if (env->features[FEAT_7_1_EDX ] &CPUID_7_1_EDX_APXF ) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x29 ); - } +/* Advanced Performance Extensions (APX) requires CPUID[0x29] */ +if (env->features[FEAT_7_1_EDX ] &CPUID_7_1_EDX_APXF ) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x29 ); + } -/* SVM requires CPUID[0x8000000A] */ -if (env->features[FEAT_8000_0001_ECX ] &CPUID_EXT3_SVM ) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x8000000A ); - } +/* SVM requires CPUID[0x8000000A] */ +if (env->features[FEAT_8000_0001_ECX ] &CPUID_EXT3_SVM ) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x8000000A ); + } -/* SEV requires CPUID[0x8000001F] */ -if (sev_enabled ()) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x8000001F ); - } +/* SEV requires CPUID[0x8000001F] */ +if (sev_enabled ()) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x8000001F ); + } -if (env->features[FEAT_8000_0021_EAX ]) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x80000021 ); - } +if (env->features[FEAT_8000_0021_EAX ]) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_xlevel,0x80000021 ); + } -/* SGX requires CPUID[0x12] for EPC enumeration */ -if (env->features[FEAT_7_0_EBX ] &CPUID_7_0_EBX_SGX ) { -x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x12 ); - } +/* SGX requires CPUID[0x12] for EPC enumeration */ +if (env->features[FEAT_7_0_EBX ] &CPUID_7_0_EBX_SGX ) { +x86_cpu_adjust_level (cpu, &env->cpuid_min_level,0x12 ); }/* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
@@ -10530,7 +10528,6 @@ static const Property x86_cpu_properties[] = {DEFINE_PROP_UINT32 ("min-xlevel" ,X86CPU , env.cpuid_min_xlevel,0 ),DEFINE_PROP_UINT32 ("min-xlevel2" ,X86CPU , env.cpuid_min_xlevel2,0 ),DEFINE_PROP_UINT64 ("ucode-rev" ,X86CPU , ucode_rev,0 ), -DEFINE_PROP_BOOL ("full-cpuid-auto-level" ,X86CPU , full_cpuid_auto_level, true),DEFINE_PROP_STRING ("hv-vendor-id" ,X86CPU , hyperv_vendor),DEFINE_PROP_BOOL ("cpuid-0xb" ,X86CPU , enable_cpuid_0xb, true), DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
target/i386/cpu.h +0 -3
@@ -2425,9 +2425,6 @@ struct ArchCPU {/* Force to enable cpuid 0x1f */ bool force_cpuid_0x1f; -/* Enable auto level-increase for all CPUID leaves */ -bool full_cpuid_auto_level; -/* * Compatibility bits for old machine types (PC machine v6.0 and older). * Only advertise CPUID leaves defined by the vendor.
Signature · 1 line
2.34.1
PATCH v6 23/27 hw/audio/pcspk: Remove PCSpkState::migrate field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The PCSpkState::migrate boolean was only set in the pc_compat_2_7[] array, via the 'migrate=off' property. We removed all machines using that array, lets remove that property, simplifying vmstate_spk[].
--- hw/audio/pcspk.c | 10 ---------- 1 file changed, 10 deletions(-)
hw/audio/pcspk.c +0 -10
@@ -57,7 +57,6 @@ struct PCSpkState {unsigned int play_pos;uint8_t data_on;uint8_t dummy_refresh_clock; -bool migrate; };static const char *s_spk ="pcspk" ;
@@ -202,18 +201,10 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp) } } -static bool migrate_needed (void *opaque) -{ -PCSpkState *s = opaque; - -return s->migrate; -} -static const VMStateDescription vmstate_spk = { .name ="pcspk" , .version_id =1 , .minimum_version_id =1 , - .needed = migrate_needed, .fields = (const VMStateField []) {VMSTATE_UINT8 (data_on, PCSpkState),VMSTATE_UINT8 (dummy_refresh_clock, PCSpkState),
@@ -224,7 +215,6 @@ static const VMStateDescription vmstate_spk = {static const Property pcspk_properties[] = {DEFINE_AUDIO_PROPERTIES (PCSpkState, audio_be),DEFINE_PROP_UINT32 ("iobase" , PCSpkState, iobase,0x61 ), -DEFINE_PROP_BOOL ("migrate" , PCSpkState, migrate, true), DEFINE_PROP_LINK("pit", PCSpkState, pit, TYPE_PIT_COMMON, PITCommonState *), };
Signature · 1 line
2.34.1
PATCH v6 24/27 hw/core/machine: Remove hw_compat_2_7[] array
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The hw_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.
--- hw/core/machine.c | 9 --------- include/hw/core/boards.h | 3 --- 2 files changed, 12 deletions(-)
hw/core/machine.c +0 -9
@@ -281,15 +281,6 @@ GlobalProperty hw_compat_2_8[] = { };const size_t hw_compat_2_8_len =G_N_ELEMENTS (hw_compat_2_8); -GlobalProperty hw_compat_2_7[] = { - {"virtio-pci" ,"page-per-vq" ,"on" }, - {"virtio-serial-device" ,"emergency-write" ,"off" }, - {"ioapic" ,"version" ,"0x11" }, - {"intel-iommu" ,"x-buggy-eim" ,"true" }, - {"virtio-pci" ,"x-ignore-backend-features" ,"on" }, -}; -const size_t hw_compat_2_7_len =G_N_ELEMENTS (hw_compat_2_7); -MachineState *current_machine;static char *machine_get_kernel (Object *obj,Error **errp)
include/hw/core/boards.h +0 -3
@@ -879,7 +879,4 @@ extern const size_t hw_compat_2_9_len;extern GlobalProperty hw_compat_2_8[];extern const size_t hw_compat_2_8_len; -extern GlobalProperty hw_compat_2_7[]; -extern const size_t hw_compat_2_7_len; -#endif
Signature · 1 line
2.34.1
PATCH v6 25/27 hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The IntelIOMMUState::buggy_eim boolean was only set in the hw_compat_2_7[] array, via the 'x-buggy-eim=true' property. We removed all machines using that array, lets remove that property, simplifying vtd_decide_config().
--- hw/i386/intel_iommu.c | 5 ++--- include/hw/i386/intel_iommu.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
hw/i386/intel_iommu.c +2 -3
@@ -4092,7 +4092,6 @@ static const Property vtd_properties[] = {DEFINE_PROP_UINT32 ("version" , IntelIOMMUState, version,0 ),DEFINE_PROP_ON_OFF_AUTO ("eim" , IntelIOMMUState, intr_eim,ON_OFF_AUTO_AUTO ), -DEFINE_PROP_BOOL ("x-buggy-eim" , IntelIOMMUState, buggy_eim, false),DEFINE_PROP_UINT8 ("aw-bits" , IntelIOMMUState, aw_bits,VTD_HOST_ADDRESS_WIDTH ), DEFINE_PROP_BOOL("caching-mode", IntelIOMMUState, caching_mode, FALSE),
@@ -5359,11 +5358,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) }if (s->intr_eim ==ON_OFF_AUTO_AUTO ) { - s->intr_eim = (kvm_irqchip_in_kernel () || s->buggy_eim) + s->intr_eim =kvm_irqchip_in_kernel () &&x86_iommu_ir_supported (x86_iommu) ?ON_OFF_AUTO_ON :ON_OFF_AUTO_OFF ; } -if (s->intr_eim ==ON_OFF_AUTO_ON && !s->buggy_eim) { +if (s->intr_eim ==ON_OFF_AUTO_ON ) {if (kvm_irqchip_is_split () && !kvm_enable_x2apic ()) {error_setg (errp,"eim=on requires support on the KVM side" "(X2APIC_API, first shipped in v4.7)" );
include/hw/i386/intel_iommu.h +0 -1
@@ -310,7 +310,6 @@ struct IntelIOMMUState {uint32_t intr_size;/* Number of IR table entries */ bool intr_eime;/* Extended interrupt mode enabled */ OnOffAuto intr_eim;/* Toggle for EIM cabability */ -bool buggy_eim;/* Force buggy EIM unless eim=off */ uint8_t aw_bits;/* Host/IOVA address width (in bits) */ bool dma_drain;/* Whether DMA r/w draining enabled */ bool pasid;/* Whether to support PASID */
Signature · 1 line
2.34.1
PATCH v6 26/27 hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The VirtIOPCIProxy::ignore_backend_features boolean was only set in the hw_compat_2_7[] array, via the 'x-ignore-backend-features=on' property. We removed all machines using that array, lets remove that property, simplify by only using the default version.
--- hw/virtio/virtio-pci.c | 5 +---- include/hw/virtio/virtio-pci.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-)
hw/virtio/virtio-pci.c +1 -4
@@ -2040,8 +2040,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)* Virtio capabilities present without * VIRTIO_F_VERSION_1 confuses guests */ -if (!proxy->ignore_backend_features && - !virtio_has_feature (vdev->host_features,VIRTIO_F_VERSION_1 )) { +if (!virtio_has_feature (vdev->host_features,VIRTIO_F_VERSION_1 )) {virtio_pci_disable_modern (proxy);if (!legacy) {
@@ -2441,8 +2440,6 @@ static const Property virtio_pci_properties[] = { VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT, false),DEFINE_PROP_BIT ("page-per-vq" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT , false), -DEFINE_PROP_BOOL ("x-ignore-backend-features" , VirtIOPCIProxy, - ignore_backend_features, false),DEFINE_PROP_BIT ("ats" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_ATS_BIT , false), DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
include/hw/virtio/virtio-pci.h +0 -1
@@ -150,7 +150,6 @@ struct VirtIOPCIProxy {uint16_t last_pcie_cap_offset;uint32_t flags;bool disable_modern; -bool ignore_backend_features;OnOffAuto disable_legacy;/* Transitional device id */ uint16_t trans_devid;
Signature · 1 line
2.34.1
PATCH v6 27/27 hw/char/virtio-serial: Do not expose the 'emergency-write' property
In reply to Zhao LiuFrom: Philippe Mathieu-Daudé <[email protected]>
The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=off' property. We removed all machines using that array, lets remove that property. All instances have this feature bit set and it can not be disabled. VirtIOSerial::host_features mask is now unused, remove it.
--- hw/char/virtio-serial-bus.c | 9 +++------ include/hw/virtio/virtio-serial.h | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-)
hw/char/virtio-serial-bus.c +3 -6
@@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t features, vser =VIRTIO_SERIAL (vdev); - features |= vser->host_features; + features |=BIT_ULL (VIRTIO_CONSOLE_F_EMERG_WRITE );if (vser->bus.max_nr_ports >1 ) {virtio_add_feature (&features,VIRTIO_CONSOLE_F_MULTIPORT ); }
@@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_t *config_data)VirtIOSerialPortClass *vsc;uint8_t emerg_wr_lo; -if (!virtio_has_feature (vser->host_features, -VIRTIO_CONSOLE_F_EMERG_WRITE ) || !config->emerg_wr) { +if (!config->emerg_wr) {return ; }
@@ -1040,7 +1039,7 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)return ; } -if (!virtio_has_feature (vser->host_features, +if (!virtio_has_feature (vdev->host_features,VIRTIO_CONSOLE_F_EMERG_WRITE )) { config_size = offsetof(struct virtio_console_config , emerg_wr); }
@@ -1156,8 +1155,6 @@ static const VMStateDescription vmstate_virtio_console = {static const Property virtio_serial_properties[] = {DEFINE_PROP_UINT32 ("max_ports" , VirtIOSerial, serial.max_virtserial_ports,31 ), -DEFINE_PROP_BIT64 ("emergency-write" , VirtIOSerial, host_features, -VIRTIO_CONSOLE_F_EMERG_WRITE , true), };static void virtio_serial_class_init (ObjectClass *klass,const void *data)
include/hw/virtio/virtio-serial.h +0 -2
@@ -186,8 +186,6 @@ struct VirtIOSerial {struct VirtIOSerialPostLoad *post_load;virtio_serial_conf serial; - -uint64_t host_features; };/* Interface to the virtio-serial bus */
Signature · 1 line
2.34.1
Queued, thanks.
Paolo