hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
v6 cover hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
Series fully reviewed. Since Igor reviewed, I plan to merge it myself if no feedback from Paolo / Michael.
Since v5:
- Addressed Igor review comments
- Added R-b tags
Since v4:
- Rebased on top of 7b68a5fe2f ("Merge tag 'for-upstream')
- Removed obsolete comment (Daniel)
- Clean DEFINE_I440FX_MACHINE (Daniel, new patch).
Since v3:
- Deprecate up to 2.12 (Thomas)
Since v2:
- Addressed Zhao review comments
Since v1:
- Addressed Zhao and Thomas review comments
Clashes a bit with Daniel general deprecation policy for all versioned machines:
https://lists.nongnu.org/archive/html/qemu-devel/2024-05/msg00084.html
Philippe Mathieu-Daudé (23):
hw/i386/pc: Deprecate 2.4 to 2.12 pc-i440fx machines hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine hw/usb/hcd-xhci: Remove XHCI_FLAG_FORCE_PCIE_ENDCAP flag hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST flag hw/i386/acpi: Remove PCMachineClass::legacy_acpi_table_size hw/acpi/ich9: Remove 'memory-hotplug-support' property hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' hw/i386/pc: Remove deprecated pc-i440fx-2.1 machine target/i386/kvm: Remove x86_cpu_change_kvm_default() and 'kvm-cpu.h' hw/i386/pc: Remove PCMachineClass::smbios_uuid_encoded hw/smbios: Remove 'uuid_encoded' argument from smbios_set_defaults() hw/smbios: Remove 'smbios_uuid_encoded', simplify smbios_encode_uuid() hw/i386/pc: Remove PCMachineClass::enforce_aligned_dimm hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug() hw/mem/memory-device: Remove legacy_align from
memory_device_pre_plug()
hw/i386/pc: Remove deprecated pc-i440fx-2.2 machine hw/i386/pc: Remove PCMachineClass::resizable_acpi_blob hw/i386/pc: Remove PCMachineClass::rsdp_in_ram hw/i386/acpi: Remove AcpiBuildState::rsdp field hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine hw/i386/pc: Simplify DEFINE_I440FX_MACHINE() macro target/i386: Remove X86CPU::kvm_no_smi_migration field hw/i386/pc: Replace PCMachineClass::acpi_data_size by
PC_ACPI_DATA_SIZE
docs/about/deprecated.rst | 4 +- docs/about/removed-features.rst | 2 +- hw/usb/hcd-xhci.h | 4 +- include/hw/firmware/smbios.h | 3 +- include/hw/i386/pc.h | 22 ---- include/hw/mem/memory-device.h | 2 +- include/hw/mem/pc-dimm.h | 3 +- target/i386/cpu.h | 3 - target/i386/kvm/kvm-cpu.h | 41 ------ hw/acpi/ich9.c | 46 +------ hw/arm/virt.c | 5 +- hw/i386/acpi-build.c | 96 ++------------- hw/i386/fw_cfg.c | 3 +- hw/i386/pc.c | 107 +++------------- hw/i386/pc_piix.c | 171 +++++--------------------- hw/loongarch/virt.c | 4 +- hw/mem/memory-device.c | 12 +- hw/mem/pc-dimm.c | 6 +- hw/ppc/spapr.c | 2 +- hw/riscv/virt.c | 2 +- hw/smbios/smbios.c | 13 +- hw/usb/hcd-xhci-nec.c | 4 - hw/usb/hcd-xhci-pci.c | 4 +- hw/usb/hcd-xhci.c | 42 ++----- hw/virtio/virtio-md-pci.c | 2 +- target/i386/cpu.c | 2 - target/i386/kvm/kvm-cpu.c | 3 +- target/i386/kvm/kvm.c | 7 +- tests/avocado/mem-addr-space-check.py | 9 +- 29 files changed, 98 insertions(+), 526 deletions(-) delete mode 100644 target/i386/kvm/kvm-cpu.h
Signature · 1 line
2.41.0
PATCH v6 1/23 hw/i386/pc: Deprecate 2.4 to 2.12 pc-i440fx machines
Similarly to the commit c7437f0ddb "docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated", deprecate the 2.4 to 2.12 machines.
--- docs/about/deprecated.rst | 4 ++-- hw/i386/pc_piix.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
docs/about/deprecated.rst +2 -2
@@ -212,8 +212,8 @@ deprecated; use the new name ``dtb-randomness`` instead. The new name better reflects the way this property affects all random data within the device tree blob, not just the ``kaslr-seed`` node. -``pc-i440fx-2.0`` up to ``pc-i440fx-2.3`` (since 8.2) -''''''''''''''''''''''''''''''''''''''''''''''''''''' +``pc-i440fx-2.0`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have various pitfalls with regards to live migration. Use a newer machine type
hw/i386/pc_piix.c +1 -1
@@ -742,6 +742,7 @@ DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,static void pc_i440fx_2_12_machine_options (MachineClass *m) {pc_i440fx_3_0_machine_options (m); + m->deprecation_reason ="old and unattended - use a newer version instead" ;compat_props_add (m->compat_props, hw_compat_2_12, hw_compat_2_12_len);compat_props_add (m->compat_props, pc_compat_2_12, pc_compat_2_12_len); }
@@ -847,7 +848,6 @@ static void pc_i440fx_2_3_machine_options(MachineClass *m) {pc_i440fx_2_4_machine_options (m); m->hw_version ="2.3.0" ; - m->deprecation_reason ="old and unattended - use a newer version instead" ;compat_props_add (m->compat_props, hw_compat_2_3, hw_compat_2_3_len);compat_props_add (m->compat_props, pc_compat_2_3, pc_compat_2_3_len); }
Signature · 1 line
2.41.0
PATCH v6 2/23 hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine
In reply to Philippe Mathieu-DaudéThe pc-i440fx-2.0 machine was deprecated for the 8.2 release (see commit c7437f0ddb "docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated"), time to remove it.
--- docs/about/deprecated.rst | 2 +- docs/about/removed-features.rst | 2 +- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 15 ------------- hw/i386/pc_piix.c | 37 --------------------------------- 5 files changed, 2 insertions(+), 57 deletions(-)
docs/about/deprecated.rst +1 -1
@@ -212,7 +212,7 @@ deprecated; use the new name ``dtb-randomness`` instead. The new name better reflects the way this property affects all random data within the device tree blob, not just the ``kaslr-seed`` node. -``pc-i440fx-2.0`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) +``pc-i440fx-2.1`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have
docs/about/removed-features.rst +1 -1
@@ -948,7 +948,7 @@ mips ``fulong2e`` machine alias (removed in 6.0) This machine has been renamed ``fuloong2e``. -``pc-0.10`` up to ``pc-i440fx-1.7`` (removed in 4.0 up to 8.2) +``pc-0.10`` up to ``pc-i440fx-2.0`` (removed in 4.0 up to 9.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These machine types were very old and likely could not be used for live
include/hw/i386/pc.h +0 -3
@@ -318,9 +318,6 @@ extern const size_t pc_compat_2_2_len;extern GlobalProperty pc_compat_2_1[];extern const size_t pc_compat_2_1_len; -extern GlobalProperty pc_compat_2_0[]; -extern const size_t pc_compat_2_0_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \
hw/i386/pc.c +0 -15
@@ -320,21 +320,6 @@ GlobalProperty pc_compat_2_1[] = { };const size_t pc_compat_2_1_len =G_N_ELEMENTS (pc_compat_2_1); -GlobalProperty pc_compat_2_0[] = { - PC_CPU_MODEL_IDS("2.0.0") - {"virtio-scsi-pci" ,"any_layout" ,"off" }, - {"PIIX4_PM" ,"memory-hotplug-support" ,"off" }, - {"apic" ,"version" ,"0x11" }, - {"nec-usb-xhci" ,"superspeed-ports-first" ,"off" }, - {"nec-usb-xhci" ,"force-pcie-endcap" ,"on" }, - {"pci-serial" ,"prog_if" ,"0" }, - {"pci-serial-2x" ,"prog_if" ,"0" }, - {"pci-serial-4x" ,"prog_if" ,"0" }, - {"virtio-net-pci" ,"guest_announce" ,"off" }, - {"ICH9-LPC" ,"memory-hotplug-support" ,"off" }, -}; -const size_t pc_compat_2_0_len =G_N_ELEMENTS (pc_compat_2_0); -GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
hw/i386/pc_piix.c +0 -37
@@ -441,11 +441,6 @@ static void pc_compat_2_1_fn(MachineState *machine)x86_cpu_change_kvm_default ("svm" ,NULL ); } -static void pc_compat_2_0_fn (MachineState *machine) -{ -pc_compat_2_1_fn (machine); -} -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {
@@ -887,38 +882,6 @@ static void pc_i440fx_2_1_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v2_1,"pc-i440fx-2.1" , pc_compat_2_1_fn, pc_i440fx_2_1_machine_options); -static void pc_i440fx_2_0_machine_options (MachineClass *m) -{ -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_i440fx_2_1_machine_options (m); - m->hw_version ="2.0.0" ; -compat_props_add (m->compat_props, pc_compat_2_0, pc_compat_2_0_len); - pcmc->smbios_legacy_mode = true; - pcmc->has_reserved_memory = false; -/* This value depends on the actual DSDT and SSDT compiled into -* the source QEMU; unfortunately it depends on the binary and -* not on the machine type, so we cannot make pc-i440fx-1.7 work on -* both QEMU 1.7 and QEMU 2.0. -* -* Large variations cause migration to fail for more than one -* consecutive value of the "-smp" maxcpus option. -* -* For small variations of the kind caused by different iasl versions, -* the 4k rounding usually leaves slack. However, there could be still -* one or two values that break. For QEMU 1.7 and QEMU 2.0 the -* slack is only ~10 bytes before one "-smp maxcpus" value breaks! -* -* 6652 is valid for QEMU 2.0, the right value for pc-i440fx-1.7 on -* QEMU 1.7 it is 6414. For RHEL/CentOS 7.0 it is 6418. -*/ - pcmc->legacy_acpi_table_size =6652 ; - pcmc->acpi_data_size =0x10000 ; -} - -DEFINE_I440FX_MACHINE (v2_0,"pc-i440fx-2.0" , pc_compat_2_0_fn, - pc_i440fx_2_0_machine_options); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
Signature · 1 line
2.41.0
PATCH v6 3/23 hw/usb/hcd-xhci: Remove XHCI_FLAG_FORCE_PCIE_ENDCAP flag
In reply to Philippe Mathieu-DaudéXHCI_FLAG_FORCE_PCIE_ENDCAP was only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplify usb_xhci_pci_realize().
--- hw/usb/hcd-xhci.h | 1 - hw/usb/hcd-xhci-nec.c | 2 -- hw/usb/hcd-xhci-pci.c | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-)
hw/usb/hcd-xhci.h +0 -1
@@ -37,7 +37,6 @@ typedef struct XHCIEPContext XHCIEPContext;enum xhci_flags {XHCI_FLAG_SS_FIRST =1 , -XHCI_FLAG_FORCE_PCIE_ENDCAP ,XHCI_FLAG_ENABLE_STREAMS , };
hw/usb/hcd-xhci-nec.c +0 -2
@@ -43,8 +43,6 @@ static Property nec_xhci_properties[] = {DEFINE_PROP_ON_OFF_AUTO ("msix" , XHCIPciState, msix,ON_OFF_AUTO_AUTO ),DEFINE_PROP_BIT ("superspeed-ports-first" , XHCINecState, flags,XHCI_FLAG_SS_FIRST , true), -DEFINE_PROP_BIT ("force-pcie-endcap" , XHCINecState, flags, -XHCI_FLAG_FORCE_PCIE_ENDCAP , false),DEFINE_PROP_UINT32 ("intrs" , XHCINecState, intrs,XHCI_MAXINTRS ),DEFINE_PROP_UINT32 ("slots" , XHCINecState, slots,XHCI_MAXSLOTS ), DEFINE_PROP_END_OF_LIST(),
hw/usb/hcd-xhci-pci.c +1 -2
@@ -148,8 +148,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)PCI_BASE_ADDRESS_MEM_TYPE_64 , &s->xhci.mem); -if (pci_bus_is_express (pci_get_bus (dev)) || -xhci_get_flag (&s->xhci,XHCI_FLAG_FORCE_PCIE_ENDCAP )) { +if (pci_bus_is_express (pci_get_bus (dev))) { ret =pcie_endpoint_cap_init (dev,0xa0 );assert (ret >0 ); }
Signature · 1 line
2.41.0
PATCH v6 4/23 hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST flag
In reply to Philippe Mathieu-DaudéXHCI_FLAG_SS_FIRST was only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplify various functions in hcd-xhci.c.
--- hw/usb/hcd-xhci.h | 3 +-- hw/usb/hcd-xhci-nec.c | 2 -- hw/usb/hcd-xhci-pci.c | 1 - hw/usb/hcd-xhci.c | 42 ++++++++---------------------------------- 4 files changed, 9 insertions(+), 39 deletions(-)
hw/usb/hcd-xhci.h +1 -2
@@ -36,8 +36,7 @@ typedef struct XHCIStreamContext XHCIStreamContext;typedef struct XHCIEPContext XHCIEPContext ;enum xhci_flags { -XHCI_FLAG_SS_FIRST =1 , -XHCI_FLAG_ENABLE_STREAMS , +XHCI_FLAG_ENABLE_STREAMS =1 , }; typedef enum TRBType {
hw/usb/hcd-xhci-nec.c +0 -2
@@ -41,8 +41,6 @@ struct XHCINecState {static Property nec_xhci_properties[] = {DEFINE_PROP_ON_OFF_AUTO ("msi" , XHCIPciState, msi,ON_OFF_AUTO_AUTO ),DEFINE_PROP_ON_OFF_AUTO ("msix" , XHCIPciState, msix,ON_OFF_AUTO_AUTO ), -DEFINE_PROP_BIT ("superspeed-ports-first" , XHCINecState, flags, -XHCI_FLAG_SS_FIRST , true),DEFINE_PROP_UINT32 ("intrs" , XHCINecState, intrs,XHCI_MAXINTRS ),DEFINE_PROP_UINT32 ("slots" , XHCINecState, slots,XHCI_MAXSLOTS ),DEFINE_PROP_END_OF_LIST (),
hw/usb/hcd-xhci-pci.c +0 -1
@@ -242,7 +242,6 @@ static void qemu_xhci_instance_init(Object *obj) s->msix =ON_OFF_AUTO_AUTO ; xhci->numintrs =XHCI_MAXINTRS ; xhci->numslots =XHCI_MAXSLOTS ; -xhci_set_flag (xhci,XHCI_FLAG_SS_FIRST ); }static const TypeInfo qemu_xhci_info = {
hw/usb/hcd-xhci.c +8 -34
74 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH v6 5/23 hw/i386/acpi: Remove PCMachineClass::legacy_acpi_table_size
In reply to Philippe Mathieu-DaudéPCMachineClass::legacy_acpi_table_size was only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplify acpi_build().
--- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 63 +++++++++----------------------------------- 2 files changed, 12 insertions(+), 52 deletions(-)
include/hw/i386/pc.h +0 -1
@@ -103,7 +103,6 @@ struct PCMachineClass {/* ACPI compat: */ bool has_acpi_build;bool rsdp_in_ram; -int legacy_acpi_table_size;unsigned acpi_data_size;int pci_root_uid;
hw/i386/acpi-build.c +12 -51
100 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH v6 6/23 hw/acpi/ich9: Remove 'memory-hotplug-support' property
In reply to Philippe Mathieu-DaudéNo external code sets the 'memory-hotplug-support' property, remove it.
--- hw/acpi/ich9.c | 18 ------------------ 1 file changed, 18 deletions(-)
hw/acpi/ich9.c +0 -18
@@ -351,21 +351,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_memory_hotplug_support (Object *obj,Error **errp) -{ -ICH9LPCState *s =ICH9_LPC_DEVICE (obj); - -return s->pm.acpi_memory_hotplug.is_enabled; -} - -static void ich9_pm_set_memory_hotplug_support (Object *obj,bool value, -Error **errp) -{ -ICH9LPCState *s =ICH9_LPC_DEVICE (obj); - - s->pm.acpi_memory_hotplug.is_enabled = value; -} -static bool ich9_pm_get_cpu_hotplug_legacy (Object *obj,Error **errp) {ICH9LPCState *s =ICH9_LPC_DEVICE (obj);
@@ -445,9 +430,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,"memory-hotplug-support" , - ich9_pm_get_memory_hotplug_support, - ich9_pm_set_memory_hotplug_support);object_property_add_bool (obj,"cpu-hotplug-legacy" , ich9_pm_get_cpu_hotplug_legacy, ich9_pm_set_cpu_hotplug_legacy);
Signature · 1 line
2.41.0
PATCH v6 7/23 hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug'
In reply to Philippe Mathieu-Daudéacpi_memory_hotplug::is_enabled is set to %true once via ich9_lpc_initfn() -> ich9_pm_add_properties(). No need to check it, so remove now dead code.
--- hw/acpi/ich9.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-)
hw/acpi/ich9.c +6 -22
@@ -153,17 +153,10 @@ static int ich9_pm_post_load(void *opaque, int version_id) .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ } -static bool vmstate_test_use_memhp (void *opaque) -{ -ICH9LPCPMRegs *s = opaque; -return s->acpi_memory_hotplug.is_enabled; -} -static const VMStateDescription vmstate_memhp_state = { .name ="ich9_pm/memhp" , .version_id =1 , .minimum_version_id =1 , - .needed = vmstate_test_use_memhp, .fields = (const VMStateField []) {VMSTATE_MEMORY_HOTPLUG (acpi_memory_hotplug, ICH9LPCPMRegs),VMSTATE_END_OF_LIST ()
@@ -335,11 +328,9 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq)legacy_acpi_cpu_hotplug_init (pci_address_space_io (lpc_pci),OBJECT (lpc_pci), &pm->gpe_cpu,ICH9_CPU_HOTPLUG_IO_BASE ); -if (pm->acpi_memory_hotplug.is_enabled) { -acpi_memory_hotplug_init (pci_address_space_io (lpc_pci),OBJECT (lpc_pci), - &pm->acpi_memory_hotplug, -ACPI_MEMORY_HOTPLUG_BASE ); - } +acpi_memory_hotplug_init (pci_address_space_io (lpc_pci),OBJECT (lpc_pci), + &pm->acpi_memory_hotplug, +ACPI_MEMORY_HOTPLUG_BASE ); } static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, const char *name,
@@ -460,12 +451,7 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } -if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM ) && - !lpc->pm.acpi_memory_hotplug.is_enabled) { -error_setg (errp, -"memory hotplug is not enabled: %s.memory-hotplug-support " -"is not set" ,object_get_typename (OBJECT (lpc))); - }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +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) &&
@@ -509,8 +495,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev); -if (lpc->pm.acpi_memory_hotplug.is_enabled && -object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) { +if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {acpi_memory_unplug_request_cb (hotplug_dev, &lpc->pm.acpi_memory_hotplug, dev, errp);
@@ -545,8 +530,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev); -if (lpc->pm.acpi_memory_hotplug.is_enabled && -object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) { +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) {
Signature · 1 line
2.41.0
PATCH v6 8/23 hw/i386/pc: Remove deprecated pc-i440fx-2.1 machine
In reply to Philippe Mathieu-DaudéThe pc-i440fx-2.1 machine was deprecated for the 8.2 release (see commit c7437f0ddb "docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated"), time to remove it.
--- docs/about/deprecated.rst | 2 +- docs/about/removed-features.rst | 2 +- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 7 ------- hw/i386/pc_piix.c | 23 ----------------------- 5 files changed, 2 insertions(+), 35 deletions(-)
docs/about/deprecated.rst +1 -1
@@ -212,7 +212,7 @@ deprecated; use the new name ``dtb-randomness`` instead. The new name better reflects the way this property affects all random data within the device tree blob, not just the ``kaslr-seed`` node. -``pc-i440fx-2.1`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) +``pc-i440fx-2.2`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have
docs/about/removed-features.rst +1 -1
@@ -948,7 +948,7 @@ mips ``fulong2e`` machine alias (removed in 6.0) This machine has been renamed ``fuloong2e``. -``pc-0.10`` up to ``pc-i440fx-2.0`` (removed in 4.0 up to 9.0) +``pc-0.10`` up to ``pc-i440fx-2.1`` (removed in 4.0 up to 9.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These machine types were very old and likely could not be used for live
include/hw/i386/pc.h +0 -3
@@ -314,9 +314,6 @@ extern const size_t pc_compat_2_3_len;extern GlobalProperty pc_compat_2_2[];extern const size_t pc_compat_2_2_len; -extern GlobalProperty pc_compat_2_1[]; -extern const size_t pc_compat_2_1_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \
hw/i386/pc.c +0 -7
@@ -313,13 +313,6 @@ GlobalProperty pc_compat_2_2[] = { };const size_t pc_compat_2_2_len =G_N_ELEMENTS (pc_compat_2_2); -GlobalProperty pc_compat_2_1[] = { - PC_CPU_MODEL_IDS("2.1.0") - {"coreduo" "-" TYPE_X86_CPU ,"vmx" ,"on" }, - {"core2duo" "-" TYPE_X86_CPU ,"vmx" ,"on" }, -}; -const size_t pc_compat_2_1_len =G_N_ELEMENTS (pc_compat_2_1); -GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
hw/i386/pc_piix.c +0 -23
@@ -66,7 +66,6 @@#include "hw/hyperv/vmbus-bridge.h" #include "hw/mem/nvdimm.h" #include "hw/i386/acpi-build.h" -#include "kvm/kvm-cpu.h" #include "target/i386/cpu.h" #define XEN_IOAPIC_NUM_PIRQS 128ULL
@@ -435,12 +434,6 @@ static void pc_compat_2_2_fn(MachineState *machine)pc_compat_2_3_fn (machine); } -static void pc_compat_2_1_fn (MachineState *machine) -{ -pc_compat_2_2_fn (machine); -x86_cpu_change_kvm_default ("svm" ,NULL ); -} -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {
@@ -866,22 +859,6 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v2_2,"pc-i440fx-2.2" , pc_compat_2_2_fn, pc_i440fx_2_2_machine_options); -static void pc_i440fx_2_1_machine_options (MachineClass *m) -{ -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_i440fx_2_2_machine_options (m); - m->hw_version ="2.1.0" ; - m->default_display =NULL ; -compat_props_add (m->compat_props, hw_compat_2_1, hw_compat_2_1_len); -compat_props_add (m->compat_props, pc_compat_2_1, pc_compat_2_1_len); - pcmc->smbios_uuid_encoded = false; - pcmc->enforce_aligned_dimm = false; -} - -DEFINE_I440FX_MACHINE (v2_1,"pc-i440fx-2.1" , pc_compat_2_1_fn, - pc_i440fx_2_1_machine_options); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
Signature · 1 line
2.41.0
PATCH v6 9/23 target/i386/kvm: Remove x86_cpu_change_kvm_default() and 'kvm-cpu.h'
In reply to Philippe Mathieu-Daudéx86_cpu_change_kvm_default() was only used out of kvm-cpu.c by the pc-i440fx-2.1 machine, which got removed. Make it static, and remove its declaration. "kvm-cpu.h" is now empty, remove it.
--- target/i386/kvm/kvm-cpu.h | 41 --------------------------------------- target/i386/kvm/kvm-cpu.c | 3 +-- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 target/i386/kvm/kvm-cpu.h
target/i386/kvm/kvm-cpu.h deleted +0 -41
@@ -1,41 +0,0 @@ -/* -* i386 KVM CPU type and functions -* -* Copyright (c) 2003 Fabrice Bellard -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef KVM_CPU_H -#define KVM_CPU_H - -#ifdef CONFIG_KVM -/* -* Change the value of a KVM-specific default -* -* If value is NULL, no default will be set and the original -* value from the CPU model table will be kept. -* -* It is valid to call this function only for properties that -* are already present in the kvm_default_props table. -*/ -void x86_cpu_change_kvm_default (const char *prop,const char *value); - -#else /* !CONFIG_KVM */ - -#define x86_cpu_change_kvm_default (a, b) - -#endif /* CONFIG_KVM */ - -#endif /* KVM_CPU_H */
target/i386/kvm/kvm-cpu.c +1 -2
@@ -10,7 +10,6 @@#include "qemu/osdep.h" #include "cpu.h" #include "host-cpu.h" -#include "kvm-cpu.h" #include "qapi/error.h" #include "sysemu/sysemu.h" #include "hw/boards.h"
@@ -178,7 +177,7 @@ static PropValue kvm_default_props[] = {/* * Only for builtin_x86_defs models initialized with x86_register_cpudef_types. */ -void x86_cpu_change_kvm_default (const char *prop,const char *value) +static void x86_cpu_change_kvm_default (const char *prop,const char *value) {PropValue *pv;for (pv = kvm_default_props; pv->prop; pv++) {
Signature · 1 line
2.41.0
PATCH v6 10/23 hw/i386/pc: Remove PCMachineClass::smbios_uuid_encoded
In reply to Philippe Mathieu-DaudéPCMachineClass::smbios_uuid_encoded was only used by the pc-i440fx-2.1 machine, which got removed. It is now always true, remove it.
--- include/hw/i386/pc.h | 1 - hw/i386/fw_cfg.c | 3 +-- hw/i386/pc.c | 1 - 3 files changed, 1 insertion(+), 4 deletions(-)
include/hw/i386/pc.h +0 -1
@@ -109,7 +109,6 @@ struct PCMachineClass {/* SMBIOS compat: */ bool smbios_defaults;bool smbios_legacy_mode; -bool smbios_uuid_encoded;SmbiosEntryPointType default_smbios_ep_type;/* RAM / address space compat: */
hw/i386/fw_cfg.c +1 -2
@@ -63,8 +63,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,if (pcmc->smbios_defaults) {/* These values are guest ABI, do not change */ -smbios_set_defaults ("QEMU" , mc->desc, mc->name, - pcmc->smbios_uuid_encoded); +smbios_set_defaults ("QEMU" , mc->desc, mc->name, true); }/* tell smbios about cpuid version and features */
hw/i386/pc.c +0 -1
@@ -1796,7 +1796,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->has_acpi_build = true; pcmc->rsdp_in_ram = true; pcmc->smbios_defaults = true; - pcmc->smbios_uuid_encoded = true; pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true; pcmc->enforce_aligned_dimm = true;
Signature · 1 line
2.41.0
PATCH v6 11/23 hw/smbios: Remove 'uuid_encoded' argument from smbios_set_defaults()
In reply to Philippe Mathieu-Daudé'uuid_encoded' is always true, remove it.
--- include/hw/firmware/smbios.h | 3 +-- hw/arm/virt.c | 3 +-- hw/i386/fw_cfg.c | 2 +- hw/loongarch/virt.c | 2 +- hw/riscv/virt.c | 2 +- hw/smbios/smbios.c | 6 ++---- 6 files changed, 7 insertions(+), 11 deletions(-)
include/hw/firmware/smbios.h +1 -2
@@ -331,8 +331,7 @@ void smbios_add_usr_blob_size(size_t size);void smbios_entry_add (QemuOpts *opts,Error **errp);void smbios_set_cpuid (uint32_t version,uint32_t features);void smbios_set_defaults (const char *manufacturer,const char *product, -const char *version, -bool uuid_encoded); +const char *version);void smbios_set_default_processor_family (uint16_t processor_family);uint8_t *smbios_get_table_legacy (size_t *length,Error **errp); void smbios_get_tables(MachineState *ms,
hw/arm/virt.c +1 -2
@@ -1677,8 +1677,7 @@ static void virt_build_smbios(VirtMachineState *vms) }smbios_set_defaults ("QEMU" , product, - vmc->smbios_old_sys_ver ?"1.0" : mc->name, - true); + vmc->smbios_old_sys_ver ?"1.0" : mc->name);/* build the array of physical mem area from base_memmap */ mem_array.address = vms->memmap[VIRT_MEM ].base;
hw/i386/fw_cfg.c +1 -1
@@ -63,7 +63,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,if (pcmc->smbios_defaults) {/* These values are guest ABI, do not change */ -smbios_set_defaults ("QEMU" , mc->desc, mc->name, true); +smbios_set_defaults ("QEMU" , mc->desc, mc->name); }/* tell smbios about cpuid version and features */
hw/loongarch/virt.c +1 -1
@@ -556,7 +556,7 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)return ; } -smbios_set_defaults ("QEMU" , product, mc->name, true); +smbios_set_defaults ("QEMU" , product, mc->name); smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64, NULL, 0,
hw/riscv/virt.c +1 -1
@@ -1277,7 +1277,7 @@ static void virt_build_smbios(RISCVVirtState *s) product ="KVM Virtual Machine" ; } -smbios_set_defaults ("QEMU" , product, mc->name, true); +smbios_set_defaults ("QEMU" , product, mc->name);if (riscv_is_32bit (&s->soc[0 ])) {smbios_set_default_processor_family (0x200 );
hw/smbios/smbios.c +2 -4
@@ -30,7 +30,7 @@#include "hw/pci/pci_device.h" #include "smbios_build.h" -static bool smbios_uuid_encoded = true; +static const bool smbios_uuid_encoded = true;/* * SMBIOS tables provided by user with '-smbios file=<foo>' option */
@@ -1017,11 +1017,9 @@ void smbios_set_default_processor_family(uint16_t processor_family) }void smbios_set_defaults (const char *manufacturer,const char *product, -const char *version, -bool uuid_encoded) +const char *version) { smbios_have_defaults = true; - smbios_uuid_encoded = uuid_encoded;SMBIOS_SET_DEFAULT (smbios_type1.manufacturer, manufacturer);SMBIOS_SET_DEFAULT (smbios_type1.product, product);
Signature · 1 line
2.41.0
PATCH v6 12/23 hw/smbios: Remove 'smbios_uuid_encoded', simplify smbios_encode_uuid()
In reply to Philippe Mathieu-Daudé'smbios_encode_uuid' is always true, remove it,
simplifying smbios_encode_uuid().
--- hw/smbios/smbios.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
hw/smbios/smbios.c +3 -6
@@ -30,7 +30,6 @@#include "hw/pci/pci_device.h" #include "smbios_build.h" -static const bool smbios_uuid_encoded = true;/* * SMBIOS tables provided by user with '-smbios file=<foo>' option */
@@ -600,11 +599,9 @@ static void smbios_build_type_0_table(void)static void smbios_encode_uuid (struct smbios_uuid *uuid,QemuUUID *in) {memcpy (uuid, in,16 ); -if (smbios_uuid_encoded) { - uuid->time_low =bswap32 (uuid->time_low); - uuid->time_mid =bswap16 (uuid->time_mid); - uuid->time_hi_and_version =bswap16 (uuid->time_hi_and_version); - } + uuid->time_low =bswap32 (uuid->time_low); + uuid->time_mid =bswap16 (uuid->time_mid); + uuid->time_hi_and_version =bswap16 (uuid->time_hi_and_version); }static void smbios_build_type_1_table (void )
Signature · 1 line
2.41.0
PATCH v6 13/23 hw/i386/pc: Remove PCMachineClass::enforce_aligned_dimm
In reply to Philippe Mathieu-DaudéPCMachineClass::enforce_aligned_dimm was only used by the pc-i440fx-2.1 machine, which got removed. It is now always true. Remove it, simplifying pc_get_device_memory_range(). Update the comment in Avocado test_phybits_low_pse36().
--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 14 +++----------- tests/avocado/mem-addr-space-check.py | 9 ++++----- 3 files changed, 7 insertions(+), 19 deletions(-)
include/hw/i386/pc.h +0 -3
@@ -74,8 +74,6 @@ typedef struct PCMachineState {* * Compat fields: * -* @enforce_aligned_dimm: check that DIMM's address/size is aligned by -* backend's alignment value if provided * @acpi_data_size: Size of the chunk of memory at the top of RAM * for the BIOS ACPI tables and other BIOS * datastructures.
@@ -114,7 +112,6 @@ struct PCMachineClass {/* RAM / address space compat: */ bool gigabyte_align;bool has_reserved_memory; -bool enforce_aligned_dimm;bool broken_reserved_end;bool enforce_amd_1tb_hole;bool isa_bios_alias;
hw/i386/pc.c +3 -11
@@ -728,7 +728,6 @@ static void pc_get_device_memory_range(PCMachineState *pcms, hwaddr *base, ram_addr_t *device_mem_size) { -PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (pcms);MachineState *machine =MACHINE (pcms);ram_addr_t size;hwaddr addr;
@@ -736,10 +735,8 @@ static void pc_get_device_memory_range(PCMachineState *pcms, size = machine->maxram_size - machine->ram_size; addr =ROUND_UP (pc_above_4g_end (pcms),1 * GiB); -if (pcmc->enforce_aligned_dimm) { -/* size device region assuming 1G page max alignment per slot */ - size += (1 * GiB) * machine->ram_slots; - } +/* size device region assuming 1G page max alignment per slot */ + size += (1 * GiB) * machine->ram_slots; *base = addr; *device_mem_size = size;
@@ -1303,12 +1300,9 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs)static void pc_memory_pre_plug (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) { -const PCMachineState *pcms =PC_MACHINE (hotplug_dev);const X86MachineState *x86ms =X86_MACHINE (hotplug_dev); -const PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (pcms);const MachineState *ms =MACHINE (hotplug_dev);const bool is_nvdimm =object_dynamic_cast (OBJECT (dev),TYPE_NVDIMM ); -const uint64_t legacy_align =TARGET_PAGE_SIZE ;Error *local_err =NULL ;/*
@@ -1333,8 +1327,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } -pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), - pcmc->enforce_aligned_dimm ?NULL : &legacy_align, errp); +pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev),NULL , errp); } static void pc_memory_plug(HotplugHandler *hotplug_dev,
@@ -1798,7 +1791,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->smbios_defaults = true; pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true; - pcmc->enforce_aligned_dimm = true; pcmc->enforce_amd_1tb_hole = true; pcmc->isa_bios_alias = true;/* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported
tests/avocado/mem-addr-space-check.py +4 -5
@@ -31,11 +31,10 @@ def test_phybits_low_pse36(self): at 4 GiB boundary when "above_4g_mem_size" is 0 (this would be true when we have 0.5 GiB of VM memory, see pc_q35_init()). This means total hotpluggable memory size is 60 GiB. Per slot, we reserve 1 GiB of memory - for dimm alignment for all newer machines (see enforce_aligned_dimm - property for pc machines and pc_get_device_memory_range()). That leaves - total hotpluggable actual memory size of 59 GiB. If the VM is started - with 0.5 GiB of memory, maxmem should be set to a maximum value of - 59.5 GiB to ensure that the processor can address all memory directly. + for dimm alignment for all machines. That leaves total hotpluggable + actual memory size of 59 GiB. If the VM is started with 0.5 GiB of + memory, maxmem should be set to a maximum value of 59.5 GiB to ensure + that the processor can address all memory directly. Note that 64-bit pci hole size is 0 in this case. If maxmem is set to 59.6G, QEMU should fail to start with a message "phy-bits are too low". If maxmem is set to 59.5G with all other QEMU parameters identical, QEMU
Signature · 1 line
2.41.0
PATCH v6 14/23 hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()
In reply to Philippe Mathieu-Daudé'legacy_align' is always NULL, remove it.
--- include/hw/mem/pc-dimm.h | 3 +-- hw/arm/virt.c | 2 +- hw/i386/pc.c | 2 +- hw/loongarch/virt.c | 2 +- hw/mem/pc-dimm.c | 6 ++---- hw/ppc/spapr.c | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-)
include/hw/mem/pc-dimm.h +1 -2
@@ -66,8 +66,7 @@ struct PCDIMMDeviceClass { void (*unrealize)(PCDIMMDevice *dimm); }; -void pc_dimm_pre_plug (PCDIMMDevice *dimm,MachineState *machine, -const uint64_t *legacy_align,Error **errp); +void pc_dimm_pre_plug (PCDIMMDevice *dimm,MachineState *machine,Error **errp);void pc_dimm_plug (PCDIMMDevice *dimm,MachineState *machine);void pc_dimm_unplug (PCDIMMDevice *dimm,MachineState *machine);#endif
hw/arm/virt.c +1 -1
@@ -2763,7 +2763,7 @@ static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } -pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev),NULL , errp); +pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), errp); } static void virt_memory_plug(HotplugHandler *hotplug_dev,
hw/i386/pc.c +1 -1
@@ -1327,7 +1327,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } -pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev),NULL , errp); +pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), errp); } static void pc_memory_plug(HotplugHandler *hotplug_dev,
hw/loongarch/virt.c +1 -1
@@ -1245,7 +1245,7 @@ static bool memhp_type_supported(DeviceState *dev)static void virt_mem_pre_plug (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) { -pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev),NULL , errp); +pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), errp); } static void virt_device_pre_plug(HotplugHandler *hotplug_dev,
hw/mem/pc-dimm.c +2 -4
@@ -44,8 +44,7 @@ static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm, Error **errp)return host_memory_backend_get_memory (dimm->hostmem); } -void pc_dimm_pre_plug (PCDIMMDevice *dimm,MachineState *machine, -const uint64_t *legacy_align,Error **errp) +void pc_dimm_pre_plug (PCDIMMDevice *dimm,MachineState *machine,Error **errp) {Error *local_err =NULL ;int slot;
@@ -70,8 +69,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine, &error_abort);trace_mhp_pc_dimm_assigned_slot (slot); -memory_device_pre_plug (MEMORY_DEVICE (dimm), machine, legacy_align, - errp); +memory_device_pre_plug (MEMORY_DEVICE (dimm), machine,NULL , errp); }void pc_dimm_plug (PCDIMMDevice *dimm,MachineState *machine)
hw/ppc/spapr.c +1 -1
@@ -3700,7 +3700,7 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } -pc_dimm_pre_plug (dimm,MACHINE (hotplug_dev),NULL , errp); +pc_dimm_pre_plug (dimm,MACHINE (hotplug_dev), errp); }struct SpaprDimmState {
Signature · 1 line
2.41.0
PATCH v6 15/23 hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
In reply to Philippe Mathieu-Daudé'legacy_align' is always NULL, remove it, simplifying memory_device_pre_plug().
--- include/hw/mem/memory-device.h | 2 +- hw/i386/pc.c | 3 +-- hw/mem/memory-device.c | 12 ++++-------- hw/mem/pc-dimm.c | 2 +- hw/virtio/virtio-md-pci.c | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-)
include/hw/mem/memory-device.h +1 -1
@@ -169,7 +169,7 @@ uint64_t get_plugged_memory_size(void);unsigned int memory_devices_get_reserved_memslots (void );bool memory_devices_memslot_auto_decision_active (void );void memory_device_pre_plug (MemoryDeviceState *md,MachineState *ms, -const uint64_t *legacy_align,Error **errp); +Error **errp);void memory_device_plug (MemoryDeviceState *md,MachineState *ms);void memory_device_unplug (MemoryDeviceState *md,MachineState *ms); uint64_t memory_device_get_region_size(const MemoryDeviceState *md,
hw/i386/pc.c +1 -2
@@ -1395,8 +1395,7 @@ static void pc_hv_balloon_pre_plug(HotplugHandler *hotplug_dev, {/* The vmbus handler has no hotplug handler; we should never end up here. */ g_assert (!dev->hotplugged); -memory_device_pre_plug (MEMORY_DEVICE (dev),MACHINE (hotplug_dev),NULL , - errp); +memory_device_pre_plug (MEMORY_DEVICE (dev),MACHINE (hotplug_dev), errp); } static void pc_hv_balloon_plug(HotplugHandler *hotplug_dev,
hw/mem/memory-device.c +4 -8
@@ -345,7 +345,7 @@ uint64_t get_plugged_memory_size(void) }void memory_device_pre_plug (MemoryDeviceState *md,MachineState *ms, -const uint64_t *legacy_align,Error **errp) +Error **errp) {const MemoryDeviceClass *mdc =MEMORY_DEVICE_GET_CLASS (md);Error *local_err =NULL ;
@@ -388,14 +388,10 @@ void memory_device_pre_plug(MemoryDeviceState *md, MachineState *ms,return ; } -if (legacy_align) { - align = *legacy_align; - }else { -if (mdc->get_min_alignment) { - align = mdc->get_min_alignment (md); - } - align =MAX (align,memory_region_get_alignment (mr)); +if (mdc->get_min_alignment) { + align = mdc->get_min_alignment (md); } + align =MAX (align,memory_region_get_alignment (mr)); addr = mdc->get_addr (md); addr =memory_device_get_free_addr (ms, !addr ?NULL : &addr, align,memory_region_size (mr), &local_err);
hw/mem/pc-dimm.c +1 -1
@@ -69,7 +69,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine, Error **errp) &error_abort);trace_mhp_pc_dimm_assigned_slot (slot); -memory_device_pre_plug (MEMORY_DEVICE (dimm), machine,NULL , errp); +memory_device_pre_plug (MEMORY_DEVICE (dimm), machine, errp); }void pc_dimm_plug (PCDIMMDevice *dimm,MachineState *machine)
hw/virtio/virtio-md-pci.c +1 -1
@@ -37,7 +37,7 @@ void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)* First, see if we can plug this memory device at all. If that * succeeds, branch of to the actual hotplug handler. */ -memory_device_pre_plug (md, ms,NULL , &local_err); +memory_device_pre_plug (md, ms, &local_err);if (!local_err && bus_handler) {hotplug_handler_pre_plug (bus_handler, dev, &local_err); }
Signature · 1 line
2.41.0
PATCH v6 16/23 hw/i386/pc: Remove deprecated pc-i440fx-2.2 machine
In reply to Philippe Mathieu-DaudéThe pc-i440fx-2.2 machine was deprecated for the 8.2 release (see commit c7437f0ddb "docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated"), time to remove it.
--- docs/about/deprecated.rst | 2 +- docs/about/removed-features.rst | 2 +- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 23 ----------------------- hw/i386/pc_piix.c | 21 --------------------- 5 files changed, 2 insertions(+), 49 deletions(-)
docs/about/deprecated.rst +1 -1
@@ -212,7 +212,7 @@ deprecated; use the new name ``dtb-randomness`` instead. The new name better reflects the way this property affects all random data within the device tree blob, not just the ``kaslr-seed`` node. -``pc-i440fx-2.2`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) +``pc-i440fx-2.3`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have
docs/about/removed-features.rst +1 -1
@@ -948,7 +948,7 @@ mips ``fulong2e`` machine alias (removed in 6.0) This machine has been renamed ``fuloong2e``. -``pc-0.10`` up to ``pc-i440fx-2.1`` (removed in 4.0 up to 9.0) +``pc-0.10`` up to ``pc-i440fx-2.2`` (removed in 4.0 up to 9.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These machine types were very old and likely could not be used for live
include/hw/i386/pc.h +0 -3
@@ -307,9 +307,6 @@ extern const size_t pc_compat_2_4_len;extern GlobalProperty pc_compat_2_3[];extern const size_t pc_compat_2_3_len; -extern GlobalProperty pc_compat_2_2[]; -extern const size_t pc_compat_2_2_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \
hw/i386/pc.c +0 -23
@@ -290,29 +290,6 @@ GlobalProperty pc_compat_2_3[] = { };const size_t pc_compat_2_3_len =G_N_ELEMENTS (pc_compat_2_3); -GlobalProperty pc_compat_2_2[] = { - PC_CPU_MODEL_IDS("2.2.0") - {"kvm64" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"kvm32" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Conroe" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Penryn" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Nehalem" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Westmere" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"SandyBridge" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Haswell" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Broadwell" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Opteron_G1" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Opteron_G2" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Opteron_G3" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Opteron_G4" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Opteron_G5" "-" TYPE_X86_CPU ,"vme" ,"off" }, - {"Haswell" "-" TYPE_X86_CPU ,"f16c" ,"off" }, - {"Haswell" "-" TYPE_X86_CPU ,"rdrand" ,"off" }, - {"Broadwell" "-" TYPE_X86_CPU ,"f16c" ,"off" }, - {"Broadwell" "-" TYPE_X86_CPU ,"rdrand" ,"off" }, -}; -const size_t pc_compat_2_2_len =G_N_ELEMENTS (pc_compat_2_2); -GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
hw/i386/pc_piix.c +0 -21
@@ -429,11 +429,6 @@ static void pc_compat_2_3_fn(MachineState *machine) } } -static void pc_compat_2_2_fn (MachineState *machine) -{ -pc_compat_2_3_fn (machine); -} -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {
@@ -843,22 +838,6 @@ static void pc_i440fx_2_3_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v2_3,"pc-i440fx-2.3" , pc_compat_2_3_fn, pc_i440fx_2_3_machine_options); -static void pc_i440fx_2_2_machine_options (MachineClass *m) -{ -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_i440fx_2_3_machine_options (m); - m->hw_version ="2.2.0" ; - m->default_machine_opts ="firmware=bios-256k.bin,suppress-vmdesc=on" ; -compat_props_add (m->compat_props, hw_compat_2_2, hw_compat_2_2_len); -compat_props_add (m->compat_props, pc_compat_2_2, pc_compat_2_2_len); - pcmc->rsdp_in_ram = false; - pcmc->resizable_acpi_blob = false; -} - -DEFINE_I440FX_MACHINE (v2_2,"pc-i440fx-2.2" , pc_compat_2_2_fn, - pc_i440fx_2_2_machine_options); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
Signature · 1 line
2.41.0
PATCH v6 17/23 hw/i386/pc: Remove PCMachineClass::resizable_acpi_blob
In reply to Philippe Mathieu-DaudéPCMachineClass::resizable_acpi_blob was only used by the pc-i440fx-2.2 machine, which got removed. It is now always true. Remove it, simplifying acpi_build().
--- include/hw/i386/pc.h | 3 --- hw/i386/acpi-build.c | 10 ---------- hw/i386/pc.c | 1 - 3 files changed, 14 deletions(-)
include/hw/i386/pc.h +0 -3
@@ -125,9 +125,6 @@ struct PCMachineClass {/* create kvmclock device even when KVM PV features are not exposed */ bool kvmclock_create_always; -/* resizable acpi blob compat */ -bool resizable_acpi_blob; -/* * whether the machine type implements broken 32-bit address space bound * check for memory.
hw/i386/acpi-build.c +0 -10
@@ -2687,16 +2687,6 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)* keep the table size stable for all (max_cpus, max_memory_slots) * combinations. */ -/* Make sure we have a buffer in case we need to resize the tables. */ -if ((tables_blob->len >ACPI_BUILD_TABLE_SIZE /2 ) && - !pcmc->resizable_acpi_blob) { -/* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots. */ -warn_report ("ACPI table size %u exceeds %d bytes," -" migration may not work" , - tables_blob->len,ACPI_BUILD_TABLE_SIZE /2 ); -error_printf ("Try removing CPUs, NUMA nodes, memory slots" -" or PCI bridges.\n" ); - }acpi_align_size (tables_blob,ACPI_BUILD_TABLE_SIZE );acpi_align_size (tables->linker->cmd_blob,ACPI_BUILD_ALIGN_SIZE );
hw/i386/pc.c +0 -1
@@ -1774,7 +1774,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->acpi_data_size =0x20000 +0x8000 ; pcmc->pvh_enabled = true; pcmc->kvmclock_create_always = true; - pcmc->resizable_acpi_blob = true; x86mc->apic_xrupt_override = true;assert (!mc->get_hotplug_handler); mc->get_hotplug_handler = pc_get_hotplug_handler;
Signature · 1 line
2.41.0
PATCH v6 18/23 hw/i386/pc: Remove PCMachineClass::rsdp_in_ram
In reply to Philippe Mathieu-DaudéPCMachineClass::rsdp_in_ram was only used by the pc-i440fx-2.2 machine, which got removed. It is now always true. Remove it, simplifying acpi_setup().
--- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 35 ++++------------------------------- hw/i386/pc.c | 1 - 3 files changed, 4 insertions(+), 33 deletions(-)
include/hw/i386/pc.h +0 -1
@@ -100,7 +100,6 @@ struct PCMachineClass {/* ACPI compat: */ bool has_acpi_build; -bool rsdp_in_ram;unsigned acpi_data_size;int pci_root_uid;
hw/i386/acpi-build.c +4 -31
@@ -2494,7 +2494,6 @@ staticvoid acpi_build (AcpiBuildTables *tables,MachineState *machine) {PCMachineState *pcms =PC_MACHINE (machine); -PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (pcms);X86MachineState *x86ms =X86_MACHINE (machine);DeviceState *iommu = pcms->iommu;GArray *table_offsets;
@@ -2666,16 +2665,6 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) .rsdt_tbl_offset = &rsdt, };build_rsdp (tables->rsdp, tables->linker, &rsdp_data); -if (!pcmc->rsdp_in_ram) { -/* We used to allocate some extra space for RSDP revision 2 but -* only used the RSDP revision 0 space. The extra bytes were -* zeroed out and not used. -* Here we continue wasting those extra 16 bytes to make sure we -* don't break migration for machine types 2.2 and older due to -* RSDP blob size mismatch. -*/ -build_append_int_noprefix (tables->rsdp,0 ,16 ); - } }/* We'll expose it all to Guest so we want to reduce
@@ -2754,7 +2743,6 @@ static const VMStateDescription vmstate_acpi_build = {void acpi_setup (void ) {PCMachineState *pcms =PC_MACHINE (qdev_get_machine ()); -PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (pcms);X86MachineState *x86ms =X86_MACHINE (pcms);AcpiBuildTables tables;AcpiBuildState *build_state;
@@ -2816,25 +2804,10 @@ void acpi_setup(void) tables.vmgenid); } -if (!pcmc->rsdp_in_ram) { -/* -* Keep for compatibility with old machine types. -* Though RSDP is small, its contents isn't immutable, so -* we'll update it along with the rest of tables on guest access. -*/ -uint32_t rsdp_size =acpi_data_len (tables.rsdp); - - build_state->rsdp =g_memdup (tables.rsdp->data, rsdp_size); -fw_cfg_add_file_callback (x86ms->fw_cfg,ACPI_BUILD_RSDP_FILE , - acpi_build_update,NULL , build_state, - build_state->rsdp, rsdp_size, true); - build_state->rsdp_mr =NULL ; - }else { - build_state->rsdp =NULL ; - build_state->rsdp_mr =acpi_add_rom_blob (acpi_build_update, - build_state, tables.rsdp, -ACPI_BUILD_RSDP_FILE ); - } + build_state->rsdp =NULL ; + build_state->rsdp_mr =acpi_add_rom_blob (acpi_build_update, + build_state, tables.rsdp, +ACPI_BUILD_RSDP_FILE );qemu_register_reset (acpi_build_reset, build_state);acpi_build_reset (build_state);
hw/i386/pc.c +0 -1
@@ -1763,7 +1763,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->pci_enabled = true; pcmc->has_acpi_build = true; - pcmc->rsdp_in_ram = true; pcmc->smbios_defaults = true; pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true;
Signature · 1 line
2.41.0
PATCH v6 19/23 hw/i386/acpi: Remove AcpiBuildState::rsdp field
In reply to Philippe Mathieu-DaudéAcpiBuildState::rsdp is always NULL, remove it,
simplifying acpi_build_update().
--- hw/i386/acpi-build.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/i386/acpi-build.c +1 -7
@@ -2458,7 +2458,6 @@ struct AcpiBuildState {MemoryRegion *table_mr;/* Is table patched? */ uint8_t patched; -void *rsdp;MemoryRegion *rsdp_mr;MemoryRegion *linker_mr; } AcpiBuildState;
@@ -2714,11 +2713,7 @@ static void acpi_build_update(void *build_opaque)acpi_ram_update (build_state->table_mr, tables.table_data); -if (build_state->rsdp) { -memcpy (build_state->rsdp, tables.rsdp->data,acpi_data_len (tables.rsdp)); - }else { -acpi_ram_update (build_state->rsdp_mr, tables.rsdp); - } +acpi_ram_update (build_state->rsdp_mr, tables.rsdp);acpi_ram_update (build_state->linker_mr, tables.linker->cmd_blob);acpi_build_tables_cleanup (&tables, true);
@@ -2804,7 +2799,6 @@ void acpi_setup(void) tables.vmgenid); } - build_state->rsdp =NULL ; build_state->rsdp_mr =acpi_add_rom_blob (acpi_build_update, build_state, tables.rsdp,ACPI_BUILD_RSDP_FILE );
Signature · 1 line
2.41.0
PATCH v6 20/23 hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine
In reply to Philippe Mathieu-DaudéThe pc-i440fx-2.3 machine was deprecated for the 8.2 release (see commit c7437f0ddb "docs/about: Mark the old pc-i440fx-2.0 - 2.3 machine types as deprecated"), time to remove it.
--- docs/about/deprecated.rst | 4 ++-- docs/about/removed-features.rst | 2 +- hw/i386/pc.c | 25 ------------------------- hw/i386/pc_piix.c | 19 ------------------- 4 files changed, 3 insertions(+), 47 deletions(-)
docs/about/deprecated.rst +2 -2
@@ -212,8 +212,8 @@ deprecated; use the new name ``dtb-randomness`` instead. The new name better reflects the way this property affects all random data within the device tree blob, not just the ``kaslr-seed`` node. -``pc-i440fx-2.3`` up to ``pc-i440fx-2.3`` (since 8.2) and ``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``pc-i440fx-2.4`` up to ``pc-i440fx-2.12`` (since 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have various pitfalls with regards to live migration. Use a newer machine type
docs/about/removed-features.rst +1 -1
@@ -948,7 +948,7 @@ mips ``fulong2e`` machine alias (removed in 6.0) This machine has been renamed ``fuloong2e``. -``pc-0.10`` up to ``pc-i440fx-2.2`` (removed in 4.0 up to 9.0) +``pc-0.10`` up to ``pc-i440fx-2.3`` (removed in 4.0 up to 9.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' These machine types were very old and likely could not be used for live
hw/i386/pc.c +0 -25
@@ -265,31 +265,6 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4); -GlobalProperty pc_compat_2_3[] = { - PC_CPU_MODEL_IDS("2.3.0") - {TYPE_X86_CPU ,"arat" ,"off" }, - {"qemu64" "-" TYPE_X86_CPU ,"min-level" ,"4" }, - {"kvm64" "-" TYPE_X86_CPU ,"min-level" ,"5" }, - {"pentium3" "-" TYPE_X86_CPU ,"min-level" ,"2" }, - {"n270" "-" TYPE_X86_CPU ,"min-level" ,"5" }, - {"Conroe" "-" TYPE_X86_CPU ,"min-level" ,"4" }, - {"Penryn" "-" TYPE_X86_CPU ,"min-level" ,"4" }, - {"Nehalem" "-" TYPE_X86_CPU ,"min-level" ,"4" }, - {"n270" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Penryn" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Conroe" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Nehalem" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Westmere" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"SandyBridge" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"IvyBridge" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Haswell" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Haswell-noTSX" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Broadwell" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {"Broadwell-noTSX" "-" TYPE_X86_CPU ,"min-xlevel" ,"0x8000000a" }, - {TYPE_X86_CPU ,"kvm-no-smi-migration" ,"on" }, -}; -const size_t pc_compat_2_3_len =G_N_ELEMENTS (pc_compat_2_3); -GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
hw/i386/pc_piix.c +0 -19
@@ -421,14 +421,6 @@ static void pc_set_south_bridge(Object *obj, int value, Error **errp)* hw_compat_*, pc_compat_*, or * pc_*_machine_options(). */ -static void pc_compat_2_3_fn (MachineState *machine) -{ -X86MachineState *x86ms =X86_MACHINE (machine); -if (kvm_enabled ()) { - x86ms->smm =ON_OFF_AUTO_OFF ; - } -} -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {
@@ -827,17 +819,6 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v2_4,"pc-i440fx-2.4" ,NULL , pc_i440fx_2_4_machine_options) -static void pc_i440fx_2_3_machine_options (MachineClass *m) -{ -pc_i440fx_2_4_machine_options (m); - m->hw_version ="2.3.0" ; -compat_props_add (m->compat_props, hw_compat_2_3, hw_compat_2_3_len); -compat_props_add (m->compat_props, pc_compat_2_3, pc_compat_2_3_len); -} - -DEFINE_I440FX_MACHINE (v2_3,"pc-i440fx-2.3" , pc_compat_2_3_fn, - pc_i440fx_2_3_machine_options); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
Signature · 1 line
2.41.0
PATCH v6 21/23 hw/i386/pc: Simplify DEFINE_I440FX_MACHINE() macro
In reply to Philippe Mathieu-DaudéLast commit removed the last non-NULL use of DEFINE_I440FX_MACHINE 3rd parameter. 'compatfn' is now obsolete, remove it.
--- hw/i386/pc_piix.c | 69 ++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 40 deletions(-)
hw/i386/pc_piix.c +29 -40
@@ -414,13 +414,6 @@ static void pc_set_south_bridge(Object *obj, int value, Error **errp) pcms->south_bridge = PCSouthBridgeOption_lookup.array[value]; } -/* Looking for a pc_compat_2_4() function? It doesn't exist. -* pc_compat_*() functions that run on machine-init time and -* change global QEMU state are deprecated. Please don't create -* one, and implement any pc-*-2.4 (and newer) compat code in -* hw_compat_*, pc_compat_*, or * pc_*_machine_options(). -*/ -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {
@@ -452,13 +445,9 @@ static void pc_xen_hvm_init(MachineState *machine) }#endif -#define DEFINE_I440FX_MACHINE (suffix, name, compatfn, optionfn) \ +#define DEFINE_I440FX_MACHINE (suffix, name, optionfn) \ static void pc_init_##suffix(MachineState *machine) \ { \ - void (*compat)(MachineState *m) = (compatfn); \ - if (compat) { \ - compat(machine); \ - } \ pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
@@ -496,7 +485,7 @@ static void pc_i440fx_9_1_machine_options(MachineClass *m) m->is_default = true; } -DEFINE_I440FX_MACHINE (v9_1,"pc-i440fx-9.1" ,NULL , +DEFINE_I440FX_MACHINE (v9_1,"pc-i440fx-9.1" , pc_i440fx_9_1_machine_options);static void pc_i440fx_9_0_machine_options (MachineClass *m)
@@ -512,7 +501,7 @@ static void pc_i440fx_9_0_machine_options(MachineClass *m) pcmc->isa_bios_alias = false; } -DEFINE_I440FX_MACHINE (v9_0,"pc-i440fx-9.0" ,NULL , +DEFINE_I440FX_MACHINE (v9_0,"pc-i440fx-9.0" , pc_i440fx_9_0_machine_options);static void pc_i440fx_8_2_machine_options (MachineClass *m)
@@ -527,7 +516,7 @@ static void pc_i440fx_8_2_machine_options(MachineClass *m) pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_64 ; } -DEFINE_I440FX_MACHINE (v8_2,"pc-i440fx-8.2" ,NULL , +DEFINE_I440FX_MACHINE (v8_2,"pc-i440fx-8.2" , pc_i440fx_8_2_machine_options);static void pc_i440fx_8_1_machine_options (MachineClass *m)
@@ -541,7 +530,7 @@ static void pc_i440fx_8_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_8_1, pc_compat_8_1_len); } -DEFINE_I440FX_MACHINE (v8_1,"pc-i440fx-8.1" ,NULL , +DEFINE_I440FX_MACHINE (v8_1,"pc-i440fx-8.1" , pc_i440fx_8_1_machine_options);static void pc_i440fx_8_0_machine_options (MachineClass *m)
@@ -556,7 +545,7 @@ static void pc_i440fx_8_0_machine_options(MachineClass *m) pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_32 ; } -DEFINE_I440FX_MACHINE (v8_0,"pc-i440fx-8.0" ,NULL , +DEFINE_I440FX_MACHINE (v8_0,"pc-i440fx-8.0" , pc_i440fx_8_0_machine_options);static void pc_i440fx_7_2_machine_options (MachineClass *m)
@@ -566,7 +555,7 @@ static void pc_i440fx_7_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } -DEFINE_I440FX_MACHINE (v7_2,"pc-i440fx-7.2" ,NULL , +DEFINE_I440FX_MACHINE (v7_2,"pc-i440fx-7.2" , pc_i440fx_7_2_machine_options);static void pc_i440fx_7_1_machine_options (MachineClass *m)
@@ -576,7 +565,7 @@ static void pc_i440fx_7_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_1, pc_compat_7_1_len); } -DEFINE_I440FX_MACHINE (v7_1,"pc-i440fx-7.1" ,NULL , +DEFINE_I440FX_MACHINE (v7_1,"pc-i440fx-7.1" , pc_i440fx_7_1_machine_options);static void pc_i440fx_7_0_machine_options (MachineClass *m)
@@ -588,7 +577,7 @@ static void pc_i440fx_7_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } -DEFINE_I440FX_MACHINE (v7_0,"pc-i440fx-7.0" ,NULL , +DEFINE_I440FX_MACHINE (v7_0,"pc-i440fx-7.0" , pc_i440fx_7_0_machine_options);static void pc_i440fx_6_2_machine_options (MachineClass *m)
@@ -598,7 +587,7 @@ static void pc_i440fx_6_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_6_2, pc_compat_6_2_len); } -DEFINE_I440FX_MACHINE (v6_2,"pc-i440fx-6.2" ,NULL , +DEFINE_I440FX_MACHINE (v6_2,"pc-i440fx-6.2" , pc_i440fx_6_2_machine_options);static void pc_i440fx_6_1_machine_options (MachineClass *m)
@@ -609,7 +598,7 @@ static void pc_i440fx_6_1_machine_options(MachineClass *m) m->smp_props.prefer_sockets = true; } -DEFINE_I440FX_MACHINE (v6_1,"pc-i440fx-6.1" ,NULL , +DEFINE_I440FX_MACHINE (v6_1,"pc-i440fx-6.1" , pc_i440fx_6_1_machine_options);static void pc_i440fx_6_0_machine_options (MachineClass *m)
@@ -619,7 +608,7 @@ static void pc_i440fx_6_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_6_0, pc_compat_6_0_len); } -DEFINE_I440FX_MACHINE (v6_0,"pc-i440fx-6.0" ,NULL , +DEFINE_I440FX_MACHINE (v6_0,"pc-i440fx-6.0" , pc_i440fx_6_0_machine_options);static void pc_i440fx_5_2_machine_options (MachineClass *m)
@@ -629,7 +618,7 @@ static void pc_i440fx_5_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_5_2, pc_compat_5_2_len); } -DEFINE_I440FX_MACHINE (v5_2,"pc-i440fx-5.2" ,NULL , +DEFINE_I440FX_MACHINE (v5_2,"pc-i440fx-5.2" , pc_i440fx_5_2_machine_options);static void pc_i440fx_5_1_machine_options (MachineClass *m)
@@ -643,7 +632,7 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m) pcmc->pci_root_uid =1 ; } -DEFINE_I440FX_MACHINE (v5_1,"pc-i440fx-5.1" ,NULL , +DEFINE_I440FX_MACHINE (v5_1,"pc-i440fx-5.1" , pc_i440fx_5_1_machine_options);static void pc_i440fx_5_0_machine_options (MachineClass *m)
@@ -655,7 +644,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m) m->auto_enable_numa_with_memdev = false; } -DEFINE_I440FX_MACHINE (v5_0,"pc-i440fx-5.0" ,NULL , +DEFINE_I440FX_MACHINE (v5_0,"pc-i440fx-5.0" , pc_i440fx_5_0_machine_options);static void pc_i440fx_4_2_machine_options (MachineClass *m)
@@ -665,7 +654,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); } -DEFINE_I440FX_MACHINE (v4_2,"pc-i440fx-4.2" ,NULL , +DEFINE_I440FX_MACHINE (v4_2,"pc-i440fx-4.2" , pc_i440fx_4_2_machine_options);static void pc_i440fx_4_1_machine_options (MachineClass *m)
@@ -675,7 +664,7 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_1, pc_compat_4_1_len); } -DEFINE_I440FX_MACHINE (v4_1,"pc-i440fx-4.1" ,NULL , +DEFINE_I440FX_MACHINE (v4_1,"pc-i440fx-4.1" , pc_i440fx_4_1_machine_options);static void pc_i440fx_4_0_machine_options (MachineClass *m)
@@ -687,7 +676,7 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_0, pc_compat_4_0_len); } -DEFINE_I440FX_MACHINE (v4_0,"pc-i440fx-4.0" ,NULL , +DEFINE_I440FX_MACHINE (v4_0,"pc-i440fx-4.0" , pc_i440fx_4_0_machine_options);static void pc_i440fx_3_1_machine_options (MachineClass *m)
@@ -701,7 +690,7 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } -DEFINE_I440FX_MACHINE (v3_1,"pc-i440fx-3.1" ,NULL , +DEFINE_I440FX_MACHINE (v3_1,"pc-i440fx-3.1" , pc_i440fx_3_1_machine_options);static void pc_i440fx_3_0_machine_options (MachineClass *m)
@@ -711,7 +700,7 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } -DEFINE_I440FX_MACHINE (v3_0,"pc-i440fx-3.0" ,NULL , +DEFINE_I440FX_MACHINE (v3_0,"pc-i440fx-3.0" , pc_i440fx_3_0_machine_options);static void pc_i440fx_2_12_machine_options (MachineClass *m)
@@ -722,7 +711,7 @@ static void pc_i440fx_2_12_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } -DEFINE_I440FX_MACHINE (v2_12,"pc-i440fx-2.12" ,NULL , +DEFINE_I440FX_MACHINE (v2_12,"pc-i440fx-2.12" , pc_i440fx_2_12_machine_options);static void pc_i440fx_2_11_machine_options (MachineClass *m)
@@ -732,7 +721,7 @@ static void pc_i440fx_2_11_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } -DEFINE_I440FX_MACHINE (v2_11,"pc-i440fx-2.11" ,NULL , +DEFINE_I440FX_MACHINE (v2_11,"pc-i440fx-2.11" , pc_i440fx_2_11_machine_options);static void pc_i440fx_2_10_machine_options (MachineClass *m)
@@ -743,7 +732,7 @@ static void pc_i440fx_2_10_machine_options(MachineClass *m) m->auto_enable_numa_with_memhp = false; } -DEFINE_I440FX_MACHINE (v2_10,"pc-i440fx-2.10" ,NULL , +DEFINE_I440FX_MACHINE (v2_10,"pc-i440fx-2.10" , pc_i440fx_2_10_machine_options);static void pc_i440fx_2_9_machine_options (MachineClass *m)
@@ -753,7 +742,7 @@ static void pc_i440fx_2_9_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_9, pc_compat_2_9_len); } -DEFINE_I440FX_MACHINE (v2_9,"pc-i440fx-2.9" ,NULL , +DEFINE_I440FX_MACHINE (v2_9,"pc-i440fx-2.9" , pc_i440fx_2_9_machine_options);static void pc_i440fx_2_8_machine_options (MachineClass *m)
@@ -763,7 +752,7 @@ static void pc_i440fx_2_8_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } -DEFINE_I440FX_MACHINE (v2_8,"pc-i440fx-2.8" ,NULL , +DEFINE_I440FX_MACHINE (v2_8,"pc-i440fx-2.8" , pc_i440fx_2_8_machine_options);static void pc_i440fx_2_7_machine_options (MachineClass *m)
@@ -773,7 +762,7 @@ static void pc_i440fx_2_7_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } -DEFINE_I440FX_MACHINE (v2_7,"pc-i440fx-2.7" ,NULL , +DEFINE_I440FX_MACHINE (v2_7,"pc-i440fx-2.7" , pc_i440fx_2_7_machine_options);static void pc_i440fx_2_6_machine_options (MachineClass *m)
@@ -788,7 +777,7 @@ static void pc_i440fx_2_6_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } -DEFINE_I440FX_MACHINE (v2_6,"pc-i440fx-2.6" ,NULL , +DEFINE_I440FX_MACHINE (v2_6,"pc-i440fx-2.6" , pc_i440fx_2_6_machine_options);static void pc_i440fx_2_5_machine_options (MachineClass *m)
@@ -802,7 +791,7 @@ static void pc_i440fx_2_5_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } -DEFINE_I440FX_MACHINE (v2_5,"pc-i440fx-2.5" ,NULL , +DEFINE_I440FX_MACHINE (v2_5,"pc-i440fx-2.5" , pc_i440fx_2_5_machine_options);static void pc_i440fx_2_4_machine_options (MachineClass *m)
@@ -816,7 +805,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } -DEFINE_I440FX_MACHINE (v2_4,"pc-i440fx-2.4" ,NULL , +DEFINE_I440FX_MACHINE (v2_4,"pc-i440fx-2.4" , pc_i440fx_2_4_machine_options)#ifdef CONFIG_ISAPC
Signature · 1 line
2.41.0
Re: [PATCH v6 21/23] hw/i386/pc: Simplify DEFINE_I440FX_MACHINE() macro
Quoted 8 lines · On Mon, 17 Jun 2024 09:11:16 +0200 Philippe Mathieu-Daudé <[email protected]>…
Last commit removed the last non-NULL use of
DEFINE_I440FX_MACHINE3rd parameter. 'compatfn' is now obsolete, remove it.Suggested-by Daniel P. Berrangé <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Reviewed-by Zhao Liu <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>
Quoted 289 lines
--- hw/i386/pc_piix.c | 69 ++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 40 deletions(-)hw/i386/pc_piix.c +29
-40@@ -414,13 +414,6 @@ static void pc_set_south_bridge(Object *obj, int value, Error **errp) pcms->south_bridge = PCSouthBridgeOption_lookup.array[value]; } -/* Looking for a pc_compat_2_4() function? It doesn't exist. -* pc_compat_*() functions that run on machine-init time and -* change global QEMU state are deprecated. Please don't create -* one, and implement any pc-*-2.4 (and newer) compat code in -* hw_compat_*, pc_compat_*, or * pc_*_machine_options(). -*/ -#ifdef CONFIG_ISAPC static void pc_init_isa (MachineState *machine) {@@ -452,13 +445,9 @@ static void pc_xen_hvm_init(MachineState *machine) }#endif -#define DEFINE_I440FX_MACHINE (suffix, name, compatfn, optionfn) \ +#define DEFINE_I440FX_MACHINE (suffix, name, optionfn) \ static void pc_init_##suffix(MachineState *machine) \ { \ - void (*compat)(MachineState *m) = (compatfn); \ - if (compat) { \ - compat(machine); \ - } \ pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)@@ -496,7 +485,7 @@ static void pc_i440fx_9_1_machine_options(MachineClass *m) m->is_default = true; } -DEFINE_I440FX_MACHINE (v9_1,"pc-i440fx-9.1" ,NULL , +DEFINE_I440FX_MACHINE (v9_1,"pc-i440fx-9.1" , pc_i440fx_9_1_machine_options);static void pc_i440fx_9_0_machine_options (MachineClass *m)@@ -512,7 +501,7 @@ static void pc_i440fx_9_0_machine_options(MachineClass *m) pcmc->isa_bios_alias = false; } -DEFINE_I440FX_MACHINE (v9_0,"pc-i440fx-9.0" ,NULL , +DEFINE_I440FX_MACHINE (v9_0,"pc-i440fx-9.0" , pc_i440fx_9_0_machine_options);static void pc_i440fx_8_2_machine_options (MachineClass *m)@@ -527,7 +516,7 @@ static void pc_i440fx_8_2_machine_options(MachineClass *m) pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_64 ; } -DEFINE_I440FX_MACHINE (v8_2,"pc-i440fx-8.2" ,NULL , +DEFINE_I440FX_MACHINE (v8_2,"pc-i440fx-8.2" , pc_i440fx_8_2_machine_options);static void pc_i440fx_8_1_machine_options (MachineClass *m)@@ -541,7 +530,7 @@ static void pc_i440fx_8_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_8_1, pc_compat_8_1_len); } -DEFINE_I440FX_MACHINE (v8_1,"pc-i440fx-8.1" ,NULL , +DEFINE_I440FX_MACHINE (v8_1,"pc-i440fx-8.1" , pc_i440fx_8_1_machine_options);static void pc_i440fx_8_0_machine_options (MachineClass *m)@@ -556,7 +545,7 @@ static void pc_i440fx_8_0_machine_options(MachineClass *m) pcmc->default_smbios_ep_type =SMBIOS_ENTRY_POINT_TYPE_32 ; } -DEFINE_I440FX_MACHINE (v8_0,"pc-i440fx-8.0" ,NULL , +DEFINE_I440FX_MACHINE (v8_0,"pc-i440fx-8.0" , pc_i440fx_8_0_machine_options);static void pc_i440fx_7_2_machine_options (MachineClass *m)@@ -566,7 +555,7 @@ static void pc_i440fx_7_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } -DEFINE_I440FX_MACHINE (v7_2,"pc-i440fx-7.2" ,NULL , +DEFINE_I440FX_MACHINE (v7_2,"pc-i440fx-7.2" , pc_i440fx_7_2_machine_options);static void pc_i440fx_7_1_machine_options (MachineClass *m)@@ -576,7 +565,7 @@ static void pc_i440fx_7_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_1, pc_compat_7_1_len); } -DEFINE_I440FX_MACHINE (v7_1,"pc-i440fx-7.1" ,NULL , +DEFINE_I440FX_MACHINE (v7_1,"pc-i440fx-7.1" , pc_i440fx_7_1_machine_options);static void pc_i440fx_7_0_machine_options (MachineClass *m)@@ -588,7 +577,7 @@ static void pc_i440fx_7_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } -DEFINE_I440FX_MACHINE (v7_0,"pc-i440fx-7.0" ,NULL , +DEFINE_I440FX_MACHINE (v7_0,"pc-i440fx-7.0" , pc_i440fx_7_0_machine_options);static void pc_i440fx_6_2_machine_options (MachineClass *m)@@ -598,7 +587,7 @@ static void pc_i440fx_6_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_6_2, pc_compat_6_2_len); } -DEFINE_I440FX_MACHINE (v6_2,"pc-i440fx-6.2" ,NULL , +DEFINE_I440FX_MACHINE (v6_2,"pc-i440fx-6.2" , pc_i440fx_6_2_machine_options);static void pc_i440fx_6_1_machine_options (MachineClass *m)@@ -609,7 +598,7 @@ static void pc_i440fx_6_1_machine_options(MachineClass *m) m->smp_props.prefer_sockets = true; } -DEFINE_I440FX_MACHINE (v6_1,"pc-i440fx-6.1" ,NULL , +DEFINE_I440FX_MACHINE (v6_1,"pc-i440fx-6.1" , pc_i440fx_6_1_machine_options);static void pc_i440fx_6_0_machine_options (MachineClass *m)@@ -619,7 +608,7 @@ static void pc_i440fx_6_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_6_0, pc_compat_6_0_len); } -DEFINE_I440FX_MACHINE (v6_0,"pc-i440fx-6.0" ,NULL , +DEFINE_I440FX_MACHINE (v6_0,"pc-i440fx-6.0" , pc_i440fx_6_0_machine_options);static void pc_i440fx_5_2_machine_options (MachineClass *m)@@ -629,7 +618,7 @@ static void pc_i440fx_5_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_5_2, pc_compat_5_2_len); } -DEFINE_I440FX_MACHINE (v5_2,"pc-i440fx-5.2" ,NULL , +DEFINE_I440FX_MACHINE (v5_2,"pc-i440fx-5.2" , pc_i440fx_5_2_machine_options);static void pc_i440fx_5_1_machine_options (MachineClass *m)@@ -643,7 +632,7 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m) pcmc->pci_root_uid =1 ; } -DEFINE_I440FX_MACHINE (v5_1,"pc-i440fx-5.1" ,NULL , +DEFINE_I440FX_MACHINE (v5_1,"pc-i440fx-5.1" , pc_i440fx_5_1_machine_options);static void pc_i440fx_5_0_machine_options (MachineClass *m)@@ -655,7 +644,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m) m->auto_enable_numa_with_memdev = false; } -DEFINE_I440FX_MACHINE (v5_0,"pc-i440fx-5.0" ,NULL , +DEFINE_I440FX_MACHINE (v5_0,"pc-i440fx-5.0" , pc_i440fx_5_0_machine_options);static void pc_i440fx_4_2_machine_options (MachineClass *m)@@ -665,7 +654,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_2, pc_compat_4_2_len); } -DEFINE_I440FX_MACHINE (v4_2,"pc-i440fx-4.2" ,NULL , +DEFINE_I440FX_MACHINE (v4_2,"pc-i440fx-4.2" , pc_i440fx_4_2_machine_options);static void pc_i440fx_4_1_machine_options (MachineClass *m)@@ -675,7 +664,7 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_1, pc_compat_4_1_len); } -DEFINE_I440FX_MACHINE (v4_1,"pc-i440fx-4.1" ,NULL , +DEFINE_I440FX_MACHINE (v4_1,"pc-i440fx-4.1" , pc_i440fx_4_1_machine_options);static void pc_i440fx_4_0_machine_options (MachineClass *m)@@ -687,7 +676,7 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_4_0, pc_compat_4_0_len); } -DEFINE_I440FX_MACHINE (v4_0,"pc-i440fx-4.0" ,NULL , +DEFINE_I440FX_MACHINE (v4_0,"pc-i440fx-4.0" , pc_i440fx_4_0_machine_options);static void pc_i440fx_3_1_machine_options (MachineClass *m)@@ -701,7 +690,7 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } -DEFINE_I440FX_MACHINE (v3_1,"pc-i440fx-3.1" ,NULL , +DEFINE_I440FX_MACHINE (v3_1,"pc-i440fx-3.1" , pc_i440fx_3_1_machine_options);static void pc_i440fx_3_0_machine_options (MachineClass *m)@@ -711,7 +700,7 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } -DEFINE_I440FX_MACHINE (v3_0,"pc-i440fx-3.0" ,NULL , +DEFINE_I440FX_MACHINE (v3_0,"pc-i440fx-3.0" , pc_i440fx_3_0_machine_options);static void pc_i440fx_2_12_machine_options (MachineClass *m)@@ -722,7 +711,7 @@ static void pc_i440fx_2_12_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } -DEFINE_I440FX_MACHINE (v2_12,"pc-i440fx-2.12" ,NULL , +DEFINE_I440FX_MACHINE (v2_12,"pc-i440fx-2.12" , pc_i440fx_2_12_machine_options);static void pc_i440fx_2_11_machine_options (MachineClass *m)@@ -732,7 +721,7 @@ static void pc_i440fx_2_11_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } -DEFINE_I440FX_MACHINE (v2_11,"pc-i440fx-2.11" ,NULL , +DEFINE_I440FX_MACHINE (v2_11,"pc-i440fx-2.11" , pc_i440fx_2_11_machine_options);static void pc_i440fx_2_10_machine_options (MachineClass *m)@@ -743,7 +732,7 @@ static void pc_i440fx_2_10_machine_options(MachineClass *m) m->auto_enable_numa_with_memhp = false; } -DEFINE_I440FX_MACHINE (v2_10,"pc-i440fx-2.10" ,NULL , +DEFINE_I440FX_MACHINE (v2_10,"pc-i440fx-2.10" , pc_i440fx_2_10_machine_options);static void pc_i440fx_2_9_machine_options (MachineClass *m)@@ -753,7 +742,7 @@ static void pc_i440fx_2_9_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_9, pc_compat_2_9_len); } -DEFINE_I440FX_MACHINE (v2_9,"pc-i440fx-2.9" ,NULL , +DEFINE_I440FX_MACHINE (v2_9,"pc-i440fx-2.9" , pc_i440fx_2_9_machine_options);static void pc_i440fx_2_8_machine_options (MachineClass *m)@@ -763,7 +752,7 @@ static void pc_i440fx_2_8_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } -DEFINE_I440FX_MACHINE (v2_8,"pc-i440fx-2.8" ,NULL , +DEFINE_I440FX_MACHINE (v2_8,"pc-i440fx-2.8" , pc_i440fx_2_8_machine_options);static void pc_i440fx_2_7_machine_options (MachineClass *m)@@ -773,7 +762,7 @@ static void pc_i440fx_2_7_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } -DEFINE_I440FX_MACHINE (v2_7,"pc-i440fx-2.7" ,NULL , +DEFINE_I440FX_MACHINE (v2_7,"pc-i440fx-2.7" , pc_i440fx_2_7_machine_options);static void pc_i440fx_2_6_machine_options (MachineClass *m)@@ -788,7 +777,7 @@ static void pc_i440fx_2_6_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } -DEFINE_I440FX_MACHINE (v2_6,"pc-i440fx-2.6" ,NULL , +DEFINE_I440FX_MACHINE (v2_6,"pc-i440fx-2.6" , pc_i440fx_2_6_machine_options);static void pc_i440fx_2_5_machine_options (MachineClass *m)@@ -802,7 +791,7 @@ static void pc_i440fx_2_5_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } -DEFINE_I440FX_MACHINE (v2_5,"pc-i440fx-2.5" ,NULL , +DEFINE_I440FX_MACHINE (v2_5,"pc-i440fx-2.5" , pc_i440fx_2_5_machine_options);static void pc_i440fx_2_4_machine_options (MachineClass *m)@@ -816,7 +805,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m)compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } -DEFINE_I440FX_MACHINE (v2_4,"pc-i440fx-2.4" ,NULL , +DEFINE_I440FX_MACHINE (v2_4,"pc-i440fx-2.4" , pc_i440fx_2_4_machine_options)#ifdef CONFIG_ISAPC
PATCH v6 22/23 target/i386: Remove X86CPU::kvm_no_smi_migration field
In reply to Philippe Mathieu-DaudéX86CPU::kvm_no_smi_migration was only used by the pc-i440fx-2.3 machine, which got removed. Remove it and simplify kvm_put_vcpu_events().
--- target/i386/cpu.h | 3 --- target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 7 +------ 3 files changed, 1 insertion(+), 11 deletions(-)
target/i386/cpu.h +0 -3
@@ -2107,9 +2107,6 @@ struct ArchCPU {/* if set, limit maximum value for phys_bits when host_phys_bits is true */ uint8_t host_phys_bits_limit; -/* Stop SMI delivery for migration compatibility with old machines */ -bool kvm_no_smi_migration; -/* Forcefully disable KVM PV features not exposed in guest CPUIDs */ bool kvm_pv_enforce_cpuid;
target/i386/cpu.c +0 -2
@@ -8283,8 +8283,6 @@ static Property x86_cpu_properties[] = {DEFINE_PROP_BOOL ("x-vendor-cpuid-only" ,X86CPU , vendor_cpuid_only, true),DEFINE_PROP_BOOL ("lmce" ,X86CPU , enable_lmce, false),DEFINE_PROP_BOOL ("l3-cache" ,X86CPU , enable_l3_cache, true), -DEFINE_PROP_BOOL ("kvm-no-smi-migration" ,X86CPU , kvm_no_smi_migration, - false),DEFINE_PROP_BOOL ("kvm-pv-enforce-cpuid" ,X86CPU , kvm_pv_enforce_cpuid, false), DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
target/i386/kvm/kvm.c +1 -6
@@ -4474,6 +4474,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.sipi_vector = env->sipi_vector;if (has_msr_smbase) { + events.flags |=KVM_VCPUEVENT_VALID_SMM ; events.smi.smm = !!(env->hflags &HF_SMM_MASK ); events.smi.smm_inside_nmi = !!(env->hflags2 &HF2_SMM_INSIDE_NMI_MASK );if (kvm_irqchip_in_kernel ()) {
@@ -4488,12 +4489,6 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.smi.pending =0 ; events.smi.latched_init =0 ; } -/* Stop SMI delivery on old machine types to avoid a reboot -* on an inward migration of an old VM. -*/ -if (!cpu->kvm_no_smi_migration) { - events.flags |=KVM_VCPUEVENT_VALID_SMM ; - } }if (level >=KVM_PUT_RESET_STATE ) {
Signature · 1 line
2.41.0
Re: [PATCH v6 22/23] target/i386: Remove X86CPU::kvm_no_smi_migration field
Quoted 7 lines · On Mon, 17 Jun 2024 09:11:17 +0200 Philippe Mathieu-Daudé <[email protected]>…
X86CPU::kvm_no_smi_migrationwas only used by the pc-i440fx-2.3 machine, which got removed. Remove it and simplifykvm_put_vcpu_events().Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Zhao Liu <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Quoted 58 lines
--- target/i386/cpu.h | 3 --- target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 7 +------ 3 files changed, 1 insertion(+), 11 deletions(-)target/i386/cpu.h +0
-3@@ -2107,9 +2107,6 @@ struct ArchCPU {/* if set, limit maximum value for phys_bits when host_phys_bits is true */ uint8_t host_phys_bits_limit; -/* Stop SMI delivery for migration compatibility with old machines */ -bool kvm_no_smi_migration; -/* Forcefully disable KVM PV features not exposed in guest CPUIDs */ bool kvm_pv_enforce_cpuid;target/i386/cpu.c +0
-2@@ -8283,8 +8283,6 @@ static Property x86_cpu_properties[] = {DEFINE_PROP_BOOL ("x-vendor-cpuid-only" ,X86CPU , vendor_cpuid_only, true),DEFINE_PROP_BOOL ("lmce" ,X86CPU , enable_lmce, false),DEFINE_PROP_BOOL ("l3-cache" ,X86CPU , enable_l3_cache, true), -DEFINE_PROP_BOOL ("kvm-no-smi-migration" ,X86CPU , kvm_no_smi_migration, - false),DEFINE_PROP_BOOL ("kvm-pv-enforce-cpuid" ,X86CPU , kvm_pv_enforce_cpuid, false), DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),target/i386/kvm/kvm.c +1
-6@@ -4474,6 +4474,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.sipi_vector = env->sipi_vector;if (has_msr_smbase) { + events.flags |=KVM_VCPUEVENT_VALID_SMM ; events.smi.smm = !!(env->hflags &HF_SMM_MASK ); events.smi.smm_inside_nmi = !!(env->hflags2 &HF2_SMM_INSIDE_NMI_MASK );if (kvm_irqchip_in_kernel ()) {@@ -4488,12 +4489,6 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.smi.pending =0 ; events.smi.latched_init =0 ; } -/* Stop SMI delivery on old machine types to avoid a reboot -* on an inward migration of an old VM. -*/ -if (!cpu->kvm_no_smi_migration) { - events.flags |=KVM_VCPUEVENT_VALID_SMM ; - } }if (level >=KVM_PUT_RESET_STATE ) {
PATCH v6 23/23 hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE
In reply to Philippe Mathieu-DaudéPCMachineClass::acpi_data_size was only used by the pc-i440fx-2.0 machine, which got removed. Since it is constant, replace the class field by a definition (local to hw/i386/pc.c, since not used elsewhere).
--- include/hw/i386/pc.h | 4 ---- hw/i386/pc.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-)
include/hw/i386/pc.h +0 -4
@@ -74,9 +74,6 @@ typedef struct PCMachineState {* * Compat fields: * -* @acpi_data_size: Size of the chunk of memory at the top of RAM -* for the BIOS ACPI tables and other BIOS -* datastructures. * @gigabyte_align: Make sure that guest addresses aligned at * 1Gbyte boundaries get mapped to host * addresses aligned at 1Gbyte boundaries. This
@@ -100,7 +97,6 @@ struct PCMachineClass {/* ACPI compat: */ bool has_acpi_build; -unsigned acpi_data_size;int pci_root_uid;/* SMBIOS compat: */
hw/i386/pc.c +12 -7
@@ -265,6 +265,16 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4); +/* +* @PC_FW_DATA: +* Size of the chunk of memory at the top of RAM for the BIOS ACPI tables +* and other BIOS datastructures. +* +* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K +* reported to be used at the moment, 32K should be enough for a while. +*/ +#define PC_FW_DATA (0x20000 + 0x8000) +GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
@@ -646,8 +656,7 @@ void xen_load_linux(PCMachineState *pcms)fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , x86ms->boot_cpus);rom_set_fw (fw_cfg); -x86_load_linux (x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); +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") ||
@@ -986,8 +995,7 @@ void pc_memory_init(PCMachineState *pcms, }if (linux_boot) { -x86_load_linux (x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); +x86_load_linux (x86ms, fw_cfg,PC_FW_DATA , pcmc->pvh_enabled); }for (i =0 ; i < nb_option_roms; i++) {
@@ -1743,9 +1751,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->has_reserved_memory = true; pcmc->enforce_amd_1tb_hole = true; pcmc->isa_bios_alias = true; -/* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported -* to be used at the moment, 32K should be enough for a while. */ - pcmc->acpi_data_size =0x20000 +0x8000 ; pcmc->pvh_enabled = true; pcmc->kvmclock_create_always = true; x86mc->apic_xrupt_override = true;
Signature · 1 line
2.41.0
Re: [PATCH v6 23/23] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE
Quoted 8 lines · On Mon, 17 Jun 2024 09:11:18 +0200 Philippe Mathieu-Daudé <[email protected]>…
PCMachineClass::acpi_data_sizewas only used by the pc-i440fx-2.0 machine, which got removed. Since it is constant, replace the class field by a definition (local tohw/i386/pc.c, since not used elsewhere).Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Reviewed-by Zhao Liu <[email protected]>
Quoted 78 lines
--- include/hw/i386/pc.h | 4 ---- hw/i386/pc.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-)include/hw/i386/pc.h +0
-4@@ -74,9 +74,6 @@ typedef struct PCMachineState {* * Compat fields: * -* @acpi_data_size: Size of the chunk of memory at the top of RAM -* for the BIOS ACPI tables and other BIOS -* datastructures. * @gigabyte_align: Make sure that guest addresses aligned at * 1Gbyte boundaries get mapped to host * addresses aligned at 1Gbyte boundaries. This @@ -100,7 +97,6 @@ struct PCMachineClass {/* ACPI compat: */ bool has_acpi_build; -unsigned acpi_data_size;int pci_root_uid;/* SMBIOS compat: */ hw/i386/pc.c +12
-7@@ -265,6 +265,16 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4); +/* +* @PC_FW_DATA: +* Size of the chunk of memory at the top of RAM for the BIOS ACPI tables +* and other BIOS datastructures. +* +* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K +* reported to be used at the moment, 32K should be enough for a while. +*/ +#define PC_FW_DATA (0x20000 + 0x8000) +GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;@@ -646,8 +656,7 @@ void xen_load_linux(PCMachineState *pcms)fw_cfg_add_i16 (fw_cfg,FW_CFG_NB_CPUS , x86ms->boot_cpus);rom_set_fw (fw_cfg); -x86_load_linux (x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); +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") ||@@ -986,8 +995,7 @@ void pc_memory_init(PCMachineState *pcms, }if (linux_boot) { -x86_load_linux (x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); +x86_load_linux (x86ms, fw_cfg,PC_FW_DATA , pcmc->pvh_enabled); }for (i =0 ; i < nb_option_roms; i++) {@@ -1743,9 +1751,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->has_reserved_memory = true; pcmc->enforce_amd_1tb_hole = true; pcmc->isa_bios_alias = true; -/* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported -* to be used at the moment, 32K should be enough for a while. */ - pcmc->acpi_data_size =0x20000 +0x8000 ; pcmc->pvh_enabled = true; pcmc->kvmclock_create_always = true; x86mc->apic_xrupt_override = true;
Quoted 18 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (23):
hw/i386/pc: Deprecate 2.4 to 2.12 pc-i440fx machines hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine hw/usb/hcd-xhci: RemoveXHCI_FLAG_FORCE_PCIE_ENDCAPflag hw/usb/hcd-xhci: RemoveXHCI_FLAG_SS_FIRSTflag hw/i386/acpi: RemovePCMachineClass::legacy_acpi_table_sizehw/acpi/ich9: Remove 'memory-hotplug-support' property hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' hw/i386/pc: Remove deprecated pc-i440fx-2.1 machine target/i386/kvm: Removex86_cpu_change_kvm_default()and 'kvm-cpu.h' hw/i386/pc: RemovePCMachineClass::smbios_uuid_encodedhw/smbios: Remove 'uuid_encoded' argument fromsmbios_set_defaults()hw/smbios: Remove 'smbios_uuid_encoded', simplifysmbios_encode_uuid()hw/i386/pc: RemovePCMachineClass::enforce_aligned_dimmhw/mem/pc-dimm: Removelegacy_alignargument frompc_dimm_pre_plug()hw/mem/memory-device: Removelegacy_alignfrom
memory_device_pre_plug()
hw/i386/pc: Remove deprecated pc-i440fx-2.2 machine
Quoted 8 lines
hw/i386/pc: Remove
PCMachineClass::resizable_acpi_blobhw/i386/pc: RemovePCMachineClass::rsdp_in_ramhw/i386/acpi: RemoveAcpiBuildState::rsdpfield hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine hw/i386/pc: SimplifyDEFINE_I440FX_MACHINE()macro target/i386: RemoveX86CPU::kvm_no_smi_migrationfield hw/i386/pc: ReplacePCMachineClass::acpi_data_sizeby
PC_ACPI_DATA_SIZE
Series queued.