hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
v2 cover hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
Missing review: 4-6, 10-12, 16, 19-20
Since v1:
- Addressed Zhao and Thomas review comments
- Removal around ICH9 acpi_memory_hotplug (Thomas)
Kill legacy code, because we need to evolve.
I ended there via dynamic machine -> ICH9 -> legacy ACPI...
This should also help Igor cleanups:
http://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (21):
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 2.3 and deprecate 2.4 to 2.7 pc-i440fx machines 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 | 2 +- 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 | 95 ++--------------------- hw/i386/fw_cfg.c | 3 +- hw/i386/pc.c | 107 ++++---------------------- hw/i386/pc_piix.c | 101 ------------------------ 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 | 3 +- 29 files changed, 64 insertions(+), 481 deletions(-) delete mode 100644 target/i386/kvm/kvm-cpu.h
Signature · 1 line
2.41.0
PATCH v2 1/21 hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine
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.
Message-Id: <[email protected]>
--- 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
@@ -219,7 +219,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) +``pc-i440fx-2.1`` up to ``pc-i440fx-2.3`` (since 8.2) ''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have
docs/about/removed-features.rst +1 -1
@@ -816,7 +816,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
@@ -285,9 +285,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
@@ -311,21 +311,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) {
@@ -872,38 +867,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
Re: [PATCH-for-9.1 v2 01/21] hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine
Quoted 13 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:03 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 01/21] hw/i386/pc: Remove deprecated
pc-i440fx-2.0 machine
X-Mailer: git-send-email 2.41.0The 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.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Quoted 8 lines
Message-Id: <[email protected]>
--- 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(-)
PATCH v2 2/21 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
Re: [PATCH-for-9.1 v2 02/21] hw/usb/hcd-xhci: Remove XHCI_FLAG_FORCE_PCIE_ENDCAP flag
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:04 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 02/21] hw/usb/hcd-xhci: Remove
XHCI_FLAG_FORCE_PCIE_ENDCAPflag
X-Mailer: git-send-email 2.41.0
XHCI_FLAG_FORCE_PCIE_ENDCAPwas only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplifyusb_xhci_pci_realize().
Quoted 7 lines
Reviewed-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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(-)
PATCH v2 3/21 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
Re: [PATCH-for-9.1 v2 03/21] hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST flag
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:05 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 03/21] hw/usb/hcd-xhci: Remove
XHCI_FLAG_SS_FIRSTflag
X-Mailer: git-send-email 2.41.0
XHCI_FLAG_SS_FIRSTwas only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplify various functions inhcd-xhci.c.
Quoted 8 lines
Reviewed-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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(-)
PATCH v2 4/21 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 | 62 +++++++++----------------------------------- 2 files changed, 12 insertions(+), 51 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 -50
93 lines not on this page · raw message
Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 v2 04/21] hw/i386/acpi: Remove PCMachineClass::legacy_acpi_table_size
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:06 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 04/21] hw/i386/acpi: Remove
PCMachineClass::legacy_acpi_table_size
X-Mailer: git-send-email 2.41.0
PCMachineClass::legacy_acpi_table_sizewas only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplifyacpi_build().
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 62 +++++++++----------------------------------- 2 files changed, 12 insertions(+), 51 deletions(-)
PATCH v2 5/21 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
Re: [PATCH-for-9.1 v2 05/21] hw/acpi/ich9: Remove 'memory-hotplug-support' property
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:07 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 05/21] hw/acpi/ich9: Remove
'memory-hotplug-support' property
X-Mailer: git-send-email 2.41.0
Quoted 8 lines
No external code sets the 'memory-hotplug-support' property, remove it.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/acpi/ich9.c | 18 ------------------ 1 file changed, 18 deletions(-)
PATCH v2 6/21 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
Re: [PATCH-for-9.1 v2 06/21] hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug'
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:08 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 06/21] hw/acpi/ich9: Remove dead code related to
'acpi_memory_hotplug'
X-Mailer: git-send-email 2.41.0
Quoted 8 lines
acpi_memory_hotplug::is_enabledis set to %true once viaich9_lpc_initfn()->ich9_pm_add_properties(). No need to check it, so remove now dead code.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/acpi/ich9.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-)
PATCH v2 7/21 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.
Message-Id: <[email protected]>
--- 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
@@ -219,7 +219,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) +``pc-i440fx-2.2`` up to ``pc-i440fx-2.3`` (since 8.2) ''''''''''''''''''''''''''''''''''''''''''''''''''''' These old machine types are quite neglected nowadays and thus might have
docs/about/removed-features.rst +1 -1
@@ -816,7 +816,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
@@ -281,9 +281,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
@@ -304,13 +304,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) {
@@ -851,22 +844,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
Re: [PATCH-for-9.1 v2 07/21] hw/i386/pc: Remove deprecated pc-i440fx-2.1 machine
Quoted 13 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:09 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 07/21] hw/i386/pc: Remove deprecated
pc-i440fx-2.1 machine
X-Mailer: git-send-email 2.41.0The 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.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Quoted 8 lines
Message-Id: <[email protected]>
--- 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(-)
PATCH v2 8/21 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.
Message-Id: <[email protected]>
--- 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"
@@ -144,7 +143,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
Re: [PATCH-for-9.1 v2 08/21] target/i386/kvm: Remove x86_cpu_change_kvm_default() and 'kvm-cpu.h'
Quoted 48 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:10 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 08/21] target/i386/kvm: Remove
x86_cpu_change_kvm_default()and 'kvm-cpu.h'
X-Mailer: git-send-email 2.41.0
x86_cpu_change_kvm_default()was only used out ofkvm-cpu.cby the pc-i440fx-2.1 machine, which got removed. Make it static, and remove its declaration. "kvm-cpu.h" is now empty, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
--- 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.htarget/i386/kvm/kvm-cpu.h deleted +0
-23@@ -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
target/i386/kvm/kvm-cpu.h line 33
Quoted 10 lines
target/i386/kvm/kvm-cpu.h deleted +0
-10-/* -* 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);
Features in kvm_default_props[] are supposed to be supported on the oldest kernal version (v4.5, from docs/system/target-i386.rst).
So future PC machines will not use this interface to adjust compatibility with the oldest v4.5 kernel. And it makes sense to stop exposing this interface in the header. Thus,
PATCH v2 9/21 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
@@ -1776,7 +1776,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
Re: [PATCH-for-9.1 v2 09/21] hw/i386/pc: Remove PCMachineClass::smbios_uuid_encoded
Hi Philippe,
On Wed, Mar 27, 2024 at 10:51:11AM +0100, Philippe Mathieu-Daudé wrote:
[snip]
hw/i386/fw_cfg.c void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, · line 66
Quoted 11 lines
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);
Since this parameter is always ture, then we can drop it and further clean up the static flag "smbios_uuid_encoded" in hw/smbios/smbios.c.
Re: [PATCH-for-9.1 v2 09/21] hw/i386/pc: Remove PCMachineClass::smbios_uuid_encoded
Quoted 2 lines
Since this parameter is always ture, then we can drop it and further clean up the static flag "
smbios_uuid_encoded" inhw/smbios/smbios.c.
Oops, my email didn't sync up well, the next two patches were doing just that.
Thanks,
Zhao
PATCH v2 10/21 hw/smbios: Remove 'uuid_encoded' argument from smbios_set_defaults()
In reply to Philippe Mathieu-Daudé'uuid_encoded' is always NULL, 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
@@ -1650,8 +1650,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
@@ -355,7 +355,7 @@ static void virt_build_smbios(LoongArchMachineState *lams)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
Re: [PATCH-for-9.1 v2 10/21] hw/smbios: Remove 'uuid_encoded' argument from smbios_set_defaults()
Quoted 7 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:12 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 10/21] hw/smbios: Remove 'uuid_encoded' argument
fromsmbios_set_defaults()
X-Mailer: git-send-email 2.41.0'
uuid_encoded' is always NULL, remove it.
It's a boolean, so,
s/NULL/true/.
Quoted 9 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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(-)
Re: [PATCH-for-9.1 v2 10/21] hw/smbios: Remove 'uuid_encoded' argument from smbios_set_defaults()
Quoted 7 lines · Zhao Liu
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:12 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 10/21] hw/smbios: Remove 'uuid_encoded' argument
fromsmbios_set_defaults()
X-Mailer: git-send-email 2.41.0
Quoted 5 lines
Quoted 1 line
'
uuid_encoded' is always NULL, remove it.It's a boolean, so,
s/NULL/true/.
Oops, thanks ;)
Quoted 14 lines
Quoted 11 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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(-)Reviewed-by Zhao Liu <[email protected]>
PATCH v2 11/21 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
Re: [PATCH-for-9.1 v2 11/21] hw/smbios: Remove 'smbios_uuid_encoded', simplify smbios_encode_uuid()
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:13 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 11/21] hw/smbios: Remove 'smbios_uuid_encoded',
simplifysmbios_encode_uuid()
X-Mailer: git-send-email 2.41.0
Quoted 7 lines
'
smbios_encode_uuid' is always true, remove it,
simplifyingsmbios_encode_uuid().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/smbios/smbios.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
PATCH v2 12/21 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 | 3 +-- 3 files changed, 4 insertions(+), 16 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;
hw/i386/pc.c +3 -11
@@ -716,7 +716,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;
@@ -724,10 +723,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;
@@ -1285,12 +1282,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 ;/*
@@ -1315,8 +1309,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,
@@ -1778,7 +1771,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;/* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported * to be used at the moment, 32K should be enough for a while. */
tests/avocado/mem-addr-space-check.py +1 -2
@@ -31,8 +31,7 @@ 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 + 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.
Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 v2 12/21] hw/i386/pc: Remove PCMachineClass::enforce_aligned_dimm
Quoted 17 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:14 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 12/21] hw/i386/pc: Remove
PCMachineClass::enforce_aligned_dimm
X-Mailer: git-send-email 2.41.0
PCMachineClass::enforce_aligned_dimmwas only used by the pc-i440fx-2.1 machine, which got removed. It is now always true. Remove it, simplifyingpc_get_device_memory_range(). Update the comment in Avocadotest_phybits_low_pse36().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 14 +++----------- tests/avocado/mem-addr-space-check.py | 3 +-- 3 files changed, 4 insertions(+), 16 deletions(-)
[snip]
tests/avocado/mem-addr-space-check.py def test_phybits_low_pse36(self): · line 34
Quoted 11 lines
tests/avocado/mem-addr-space-check.py +1
-2@@ -31,8 +31,7 @@ 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 + for dimm alignment for all machines. That leaves
Just nit, better align it here.
Quoted 6 lines
tests/avocado/mem-addr-space-check.py +0
-0total 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.Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 v2 12/21] hw/i386/pc: Remove PCMachineClass::enforce_aligned_dimm
Quoted 20 lines · Zhao Liu
Quoted 17 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:14 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 12/21] hw/i386/pc: Remove
PCMachineClass::enforce_aligned_dimm
X-Mailer: git-send-email 2.41.0
PCMachineClass::enforce_aligned_dimmwas only used by the pc-i440fx-2.1 machine, which got removed. It is now always true. Remove it, simplifyingpc_get_device_memory_range(). Update the comment in Avocadotest_phybits_low_pse36().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 14 +++----------- tests/avocado/mem-addr-space-check.py | 3 +-- 3 files changed, 4 insertions(+), 16 deletions(-)
Quoted 11 lines
tests/avocado/mem-addr-space-check.py def test_phybits_low_pse36(self): · line 34
Quoted 9 lines
tests/avocado/mem-addr-space-check.py +1
-2@@ -31,8 +31,7 @@ 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 + for dimm alignment for all machines. That leavesJust nit, better align it here.
Well, I wanted to avoid too much churn, but OK.
Quoted 8 lines
Reviewed-by Zhao Liu <[email protected]>Quoted 6 lines
tests/avocado/mem-addr-space-check.py +0
-0total 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.Signature · 1 line
2.41.0
PATCH v2 13/21 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.
Message-Id: <[email protected]>
--- 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
@@ -2736,7 +2736,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
@@ -1309,7 +1309,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
@@ -1025,7 +1025,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_machine_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
@@ -3667,7 +3667,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
Re: [PATCH-for-9.1 v2 13/21] hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()
Quoted 6 lines · Philippe Mathieu-Daudé
'
legacy_align' is always NULL, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
---
I was really confused for a second until I saw that this series is dependent on another one.
Please make sure to CC people you CC on patches to also CC on the cover letter.
Signature · 3 lines
Cheers, David / dhildenb
Re: [PATCH-for-9.1 v2 13/21] hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()
Quoted 11 lines · David Hildenbrand
Quoted 6 lines · Philippe Mathieu-Daudé
'
legacy_align' is always NULL, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
---I was really confused for a second until I saw that this series is dependent on another one.
Please make sure to CC people you CC on patches to also CC on the cover letter.
Oops, sorry. I really should patch that on git-publish...
Quoted 1 line
Reviewed-by David Hildenbrand <[email protected]>
Thanks!
Re: [PATCH-for-9.1 v2 13/21] hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()
In reply to Philippe Mathieu-DaudéQuoted 11 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:15 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 13/21] hw/mem/pc-dimm: Removelegacy_align
argument frompc_dimm_pre_plug()
X-Mailer: git-send-email 2.41.0'
legacy_align' is always NULL, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
Quoted 8 lines
--- 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(-)
PATCH v2 14/21 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().
Message-Id: <[email protected]>
--- 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
@@ -1377,8 +1377,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
Re: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
Quoted 14 lines
void memory_device_pre_plug(MemoryDeviceState *md, MachineState *ms,
hw/mem/memory-device.c +1
-5- 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) {
hw/mem/memory-device.c void memory_device_pre_plug(MemoryDeviceState *md, MachineState *ms, · line 397
Quoted 10 lines
hw/mem/memory-device.c +3
-3- 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);
Very nice!
Signature · 3 lines
Cheers, David / dhildenb
Re: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
In reply to Philippe Mathieu-DaudéQuoted 11 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:16 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Removelegacy_align
frommemory_device_pre_plug()
X-Mailer: git-send-email 2.41.0'
legacy_align' is always NULL, remove it, simplifyingmemory_device_pre_plug().Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Quoted 8 lines
Message-Id: <[email protected]>
--- 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(-)
PATCH v2 15/21 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.
Message-Id: <[email protected]>
--- docs/about/deprecated.rst | 6 +++--- 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, 4 insertions(+), 51 deletions(-)
docs/about/deprecated.rst +3 -3
@@ -219,10 +219,10 @@ 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) -''''''''''''''''''''''''''''''''''''''''''''''''''''' +``pc-i440fx-2.3`` (since 8.2) +''''''''''''''''''''''''''''' -These old machine types are quite neglected nowadays and thus might have +This old machine type is quite neglected nowadays and thus might have various pitfalls with regards to live migration. Use a newer machine type instead.
docs/about/removed-features.rst +1 -1
@@ -816,7 +816,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
@@ -274,9 +274,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
@@ -281,29 +281,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) {
@@ -828,22 +823,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
Re: [PATCH-for-9.1 v2 15/21] hw/i386/pc: Remove deprecated pc-i440fx-2.2 machine
Quoted 13 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:17 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 15/21] hw/i386/pc: Remove deprecated
pc-i440fx-2.2 machine
X-Mailer: git-send-email 2.41.0The 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.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Quoted 8 lines
Message-Id: <[email protected]>
--- docs/about/deprecated.rst | 6 +++--- 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, 4 insertions(+), 51 deletions(-)
PATCH v2 16/21 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
@@ -124,9 +124,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
@@ -2688,16 +2688,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
@@ -1753,7 +1753,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
Re: [PATCH-for-9.1 v2 16/21] hw/i386/pc: Remove PCMachineClass::resizable_acpi_blob
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:18 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 16/21] hw/i386/pc: Remove
PCMachineClass::resizable_acpi_blob
X-Mailer: git-send-email 2.41.0
PCMachineClass::resizable_acpi_blobwas only used by the pc-i440fx-2.2 machine, which got removed. It is now always true. Remove it, simplifyingacpi_build().
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/acpi-build.c | 10 ---------- hw/i386/pc.c | 1 - 3 files changed, 14 deletions(-)
PATCH v2 17/21 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().
Message-Id: <[email protected]>
--- 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
@@ -2495,7 +2495,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;
@@ -2667,16 +2666,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
@@ -2755,7 +2744,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;
@@ -2817,25 +2805,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
@@ -1743,7 +1743,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
Re: [PATCH-for-9.1 v2 17/21] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:19 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 17/21] hw/i386/pc: Remove
PCMachineClass::rsdp_in_ram
X-Mailer: git-send-email 2.41.0
PCMachineClass::rsdp_in_ramwas only used by the pc-i440fx-2.2 machine, which got removed. It is now always true. Remove it, simplifyingacpi_setup().
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
--- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 35 ++++------------------------------- hw/i386/pc.c | 1 - 3 files changed, 4 insertions(+), 33 deletions(-)
PATCH v2 18/21 hw/i386/acpi: Remove AcpiBuildState::rsdp field
In reply to Philippe Mathieu-DaudéAcpiBuildState::rsdp is always NULL, remove it,
simplifying acpi_build_update().
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/i386/acpi-build.c +1 -7
@@ -2459,7 +2459,6 @@ struct AcpiBuildState {MemoryRegion *table_mr;/* Is table patched? */ uint8_t patched; -void *rsdp;MemoryRegion *rsdp_mr;MemoryRegion *linker_mr; } AcpiBuildState;
@@ -2715,11 +2714,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);
@@ -2805,7 +2800,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
Re: [PATCH-for-9.1 v2 18/21] hw/i386/acpi: Remove AcpiBuildState::rsdp field
Quoted 9 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:20 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 18/21] hw/i386/acpi: RemoveAcpiBuildState::rsdp
field
X-Mailer: git-send-email 2.41.0
AcpiBuildState::rsdpis always NULL, remove it, simplifyingacpi_build_update().
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
PATCH v2 19/21 hw/i386/pc: Remove 2.3 and deprecate 2.4 to 2.7 pc-i440fx machines
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. Similarly to the cited commit, deprecate the 2.4 to 2.7 machines.
--- docs/about/deprecated.rst | 6 +++--- docs/about/removed-features.rst | 2 +- hw/i386/pc.c | 25 ------------------------- hw/i386/pc_piix.c | 20 -------------------- 4 files changed, 4 insertions(+), 49 deletions(-)
docs/about/deprecated.rst +3 -3
@@ -219,10 +219,10 @@ 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`` (since 8.2) -''''''''''''''''''''''''''''' +``pc-i440fx-2.4`` up to ``pc-i440fx-2.7`` (since 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''' -This old machine type is quite neglected nowadays and thus might have +These old machine types are quite neglected nowadays and thus might have various pitfalls with regards to live migration. Use a newer machine type instead.
docs/about/removed-features.rst +1 -1
@@ -816,7 +816,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
@@ -256,31 +256,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 -20
@@ -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) {
@@ -811,18 +803,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" ; - 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); -} - -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
Re: [PATCH-for-9.1 v2 19/21] hw/i386/pc: Remove 2.3 and deprecate 2.4 to 2.7 pc-i440fx machines
Hi Philippe,
Quoted 11 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:21 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 19/21] hw/i386/pc: Remove 2.3 and deprecate 2.4
to 2.7 pc-i440fx machines
X-Mailer: git-send-email 2.41.0The 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. Similarly to the cited commit, deprecate the 2.4 to 2.7 machines.
I suggest split the deprecation of 2.4-2.7 in another patch.
And when a old machine is marked as deprecated, is it necessary to set "deprecation_reason" as commit c7437f0ddb?
I tend to set that field since boards.h said:
/**
* MachineClass:
* @deprecation_reason: If set, the machine is marked as deprecated. The
* string should provide some clear information about what to use instead.
*...
*/
And that field would be printed when user boots the machine.
Additionally, could we define rules for deprecating old machines? For example, if it's more than 8 years old (as commit c7437f0ddb) or after how many releases, the old machine can be considered for deprecation.
Thanks,
Zhao
Re: [PATCH-for-9.1 v2 19/21] hw/i386/pc: Remove 2.3 and deprecate 2.4 to 2.7 pc-i440fx machines
Hi Zhao,
Quoted 9 lines · Zhao Liu
Hi Philippe,
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:21 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 19/21] hw/i386/pc: Remove 2.3 and deprecate 2.4
to 2.7 pc-i440fx machines
X-Mailer: git-send-email 2.41.0
Quoted 7 lines
Quoted 5 lines
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. Similarly to the cited commit, deprecate the 2.4 to 2.7 machines.I suggest split the deprecation of 2.4-2.7 in another patch.
Thomas suggested to do it in the same commit to avoid churn in documentation:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 2 lines
And when a old machine is marked as deprecated, is it necessary to set "
deprecation_reason" as commitc7437f0ddb?
Indeed you are right, I forgot that.
Quoted 9 lines
I tend to set that field since
boards.hsaid:/**
* MachineClass:
* @deprecation_reason: If set, the machine is marked as deprecated. The
* string should provide some clear information about what to use instead.
*...
*/
Quoted 6 lines
And that field would be printed when user boots the machine.
Additionally, could we define rules for deprecating old machines? For example, if it's more than 8 years old (as commit
c7437f0ddb) or after how many releases, the old machine can be considered for deprecation.
Daniel recently (last 2 months) replied to a thread with a coherent rule set, but I can't find it.
Older post:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 3 lines
Thanks,
Zhao
PATCH v2 20/21 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
@@ -2018,9 +2018,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
@@ -7905,8 +7905,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
@@ -4337,6 +4337,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 ()) {
@@ -4351,12 +4352,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-for-9.1 v2 20/21] target/i386: Remove X86CPU::kvm_no_smi_migration field
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:22 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 20/21] target/i386: Remove
X86CPU::kvm_no_smi_migrationfield
X-Mailer: git-send-email 2.41.0
X86CPU::kvm_no_smi_migrationwas only used by the pc-i440fx-2.3 machine, which got removed. Remove it and simplifykvm_put_vcpu_events().
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/cpu.h | 3 --- target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 7 +------ 3 files changed, 1 insertion(+), 11 deletions(-)
PATCH v2 21/21 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.
Message-Id: <[email protected]>
--- 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
@@ -256,6 +256,16 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4); +/* +* @PC_ACPI_DATA_SIZE: +* 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_ACPI_DATA_SIZE (0x20000 + 0x8000) +GSIState *pc_gsi_create (qemu_irq **irqs,bool pci_enabled) {GSIState *s;
@@ -634,8 +644,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_ACPI_DATA_SIZE , 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") ||
@@ -969,8 +978,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_ACPI_DATA_SIZE , pcmc->pvh_enabled); }for (i =0 ; i < nb_option_roms; i++) {
@@ -1722,9 +1730,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true; pcmc->enforce_amd_1tb_hole = 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-for-9.1 v2 21/21] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE
Hi Philippe,
Quoted 5 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:23 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 21/21] hw/i386/pc: Replace
PCMachineClass::acpi_data_sizebyPC_ACPI_DATA_SIZE
X-Mailer: git-send-email 2.41.0
[snip]
Quoted 8 lines
hw/i386/pc.c +0
-0@@ -256,6 +256,16 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4);
hw/i386/pc.c GlobalProperty pc_compat_2_4[] = { · line 268
Quoted 10 lines
hw/i386/pc.c +10
-0+/* +* @PC_ACPI_DATA_SIZE: +* 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_ACPI_DATA_SIZE (0x20000 + 0x8000) +
What about putting this in pc.h? Because it is a general definition for PC.
Others are good for me,
Re: [PATCH-for-9.1 v2 21/21] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE
Quoted 19 lines · Zhao Liu
Hi Philippe,
Quoted 5 lines · Philippe Mathieu-Daudé
Date: Wed, 27 Mar 2024 10:51:23 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 v2 21/21] hw/i386/pc: Replace
PCMachineClass::acpi_data_sizebyPC_ACPI_DATA_SIZE
X-Mailer: git-send-email 2.41.0[snip]
Quoted 8 lines
hw/i386/pc.c +0
-0@@ -256,6 +256,16 @@ GlobalProperty pc_compat_2_4[] = { };const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4);
Quoted 13 lines
hw/i386/pc.c GlobalProperty pc_compat_2_4[] = { · line 268
Quoted 10 lines
hw/i386/pc.c +10
-0+/* +* @PC_ACPI_DATA_SIZE: +* 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_ACPI_DATA_SIZE (0x20000 + 0x8000) +What about putting this in
pc.h? Because it is a general definition for PC.
Since nothing out of hw/i386/pc.c uses this definition, I rather avoid exposing it.
Quoted 4 lines
Others are good for me,
Reviewed-by Zhao Liu <[email protected]>
Thanks!