hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
cover hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines
Kill legacy code, because we need to evolve.
I ended there via dynamic machine -> ICH9 -> legacy ACPI...
Based-on: <[email protected]>
"hw/i386/pc: Trivial cleanups"
Philippe Mathieu-Daudé (18):
hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine hw/usb/hcd-xhci: Enumerate xhci_flags setting values 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/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/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 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 | 7 --- docs/about/removed-features.rst | 2 +- hw/usb/hcd-xhci.h | 4 +- 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/arm/virt.c | 2 +- hw/i386/acpi-build.c | 94 +++------------------------- hw/i386/fw_cfg.c | 2 +- hw/i386/pc.c | 107 +++++--------------------------- hw/i386/pc_piix.c | 101 ------------------------------ hw/loongarch/virt.c | 2 +- hw/mem/memory-device.c | 12 ++-- hw/mem/pc-dimm.c | 6 +- hw/ppc/spapr.c | 2 +- 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 | 6 -- 24 files changed, 48 insertions(+), 427 deletions(-) delete mode 100644 target/i386/kvm/kvm-cpu.h
Signature · 1 line
2.41.0
PATCH 1/18 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.
--- 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
@@ -221,7 +221,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
@@ -801,7 +801,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) {
@@ -868,38 +863,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 01/18] hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine
Quoted 64 lines · 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.Signed-off-by Philippe Mathieu-Daudé <[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@@ -221,7 +221,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 havedocs/about/removed-features.rst +1
-1@@ -801,7 +801,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 liveinclude/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
-2@@ -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" )
hw/i386/pc.c GlobalProperty pc_compat_2_1[] = { · line 325
Quoted 10 lines
hw/i386/pc.c +0
-10- { "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" },
I think you could clean up memory-hotplug-support for the ICH9-LPC device now, too (in a separate patch).
For this patch here:
Re: [PATCH-for-9.1 01/18] hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine
Quoted 29 lines · Thomas Huth
Quoted 28 lines · 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.Signed-off-by Philippe Mathieu-Daudé <[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(-)hw/i386/pc.c +0
-6@@ -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" },
Quoted 8 lines
hw/i386/pc.c GlobalProperty pc_compat_2_1[] = { · line 325
Quoted 6 lines
hw/i386/pc.c +0
-6- { "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" },I think you could clean up memory-hotplug-support for the ICH9-LPC device now, too (in a separate patch).
Great suggestion, thanks!
Quoted 4 lines
For this patch here:
Reviewed-by Thomas Huth <[email protected]>
PATCH 2/18 hw/usb/hcd-xhci: Enumerate xhci_flags setting values
In reply to Philippe Mathieu-Daudéxhci_flags are used as bits for QOM properties, expected to be somehow stable (external interface).
Explicit their values so removing any enum doesn't modify the other ones.
--- hw/usb/hcd-xhci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/usb/hcd-xhci.h +2 -2
@@ -37,8 +37,8 @@ typedef struct XHCIEPContext XHCIEPContext;enum xhci_flags {XHCI_FLAG_SS_FIRST =1 , -XHCI_FLAG_FORCE_PCIE_ENDCAP , -XHCI_FLAG_ENABLE_STREAMS , +XHCI_FLAG_FORCE_PCIE_ENDCAP =2 , +XHCI_FLAG_ENABLE_STREAMS =3 , }; typedef enum TRBType {
Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumerate xhci_flags setting values
Hi Philippe,
Quoted 22 lines · Philippe Mathieu-Daudé
Date: Tue, 5 Mar 2024 14:42:04 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumeratexhci_flags
setting values
X-Mailer: git-send-email 2.41.0
xhci_flagsare used as bits for QOM properties, expected to be somehow stable (external interface).Explicit their values so removing any enum doesn't modify the other ones.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/hcd-xhci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/usb/hcd-xhci.h +0
-0
hw/usb/hcd-xhci.h typedef struct XHCIEPContext XHCIEPContext; · line 43
Quoted 9 lines
hw/usb/hcd-xhci.h +2
-2@@ -37,8 +37,8 @@ typedef struct XHCIEPContext XHCIEPContext;enum xhci_flags {XHCI_FLAG_SS_FIRST =1 , -XHCI_FLAG_FORCE_PCIE_ENDCAP , -XHCI_FLAG_ENABLE_STREAMS , +XHCI_FLAG_FORCE_PCIE_ENDCAP =2 , +XHCI_FLAG_ENABLE_STREAMS =3 , };
From the commit 290fd20db6e0 ("usb xhci: change msi/msix property type"), the enum values were modified directly.
So it seems not necessary to bind enum type with specific value, right?
Thanks,
Zhao
Re: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumerate xhci_flags setting values
Hi Zhao,
Quoted 38 lines · Zhao Liu
Hi Philippe,
Quoted 22 lines · Philippe Mathieu-Daudé
Date: Tue, 5 Mar 2024 14:42:04 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumeratexhci_flags
setting values
X-Mailer: git-send-email 2.41.0
xhci_flagsare used as bits for QOM properties, expected to be somehow stable (external interface).Explicit their values so removing any enum doesn't modify the other ones.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/hcd-xhci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/usb/hcd-xhci.h +0
-0hw/usb/hcd-xhci.h typedef struct XHCIEPContext XHCIEPContext; · line 43
Quoted 9 lines
hw/usb/hcd-xhci.h +2
-2@@ -37,8 +37,8 @@ typedef struct XHCIEPContext XHCIEPContext;enum xhci_flags {XHCI_FLAG_SS_FIRST =1 , -XHCI_FLAG_FORCE_PCIE_ENDCAP , -XHCI_FLAG_ENABLE_STREAMS , +XHCI_FLAG_FORCE_PCIE_ENDCAP =2 , +XHCI_FLAG_ENABLE_STREAMS =3 , };From the commit
290fd20db6e0("usb xhci: change msi/msix property
type"), the enum values were modified directly.
Quoted 2 lines
So it seems not necessary to bind enum type with specific value, right?
Indeed! Let's drop this patch then.
Thanks for referencing the commit,
Phil.
Quoted 4 lines
Thanks,
Zhao
PATCH 3/18 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 =2 ,XHCI_FLAG_ENABLE_STREAMS =3 , };
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 03/18] hw/usb/hcd-xhci: Remove XHCI_FLAG_FORCE_PCIE_ENDCAP flag
Quoted 10 lines · Philippe Mathieu-Daudé
XHCI_FLAG_FORCE_PCIE_ENDCAPwas only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplifyusb_xhci_pci_realize().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 4/18 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 | 1 - hw/usb/hcd-xhci-nec.c | 2 -- hw/usb/hcd-xhci-pci.c | 1 - hw/usb/hcd-xhci.c | 42 ++++++++---------------------------------- 4 files changed, 8 insertions(+), 38 deletions(-)
hw/usb/hcd-xhci.h +0 -1
@@ -36,7 +36,6 @@ typedef struct XHCIStreamContext XHCIStreamContext;typedef struct XHCIEPContext XHCIEPContext ;enum xhci_flags { -XHCI_FLAG_SS_FIRST =1 ,XHCI_FLAG_ENABLE_STREAMS =3 , };
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 04/18] hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST flag
Quoted 4 lines · Philippe Mathieu-Daudé
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
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 | 1 - hw/usb/hcd-xhci.c | 42 ++++++++---------------------------------- 4 files changed, 8 insertions(+), 38 deletions(-)
PATCH 5/18 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 | 60 +++++++++----------------------------------- 2 files changed, 12 insertions(+), 49 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 -48
93 lines not on this page · raw message
Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 05/18] hw/i386/acpi: Remove PCMachineClass::legacy_acpi_table_size
Quoted 65 lines · Philippe Mathieu-Daudé
PCMachineClass::legacy_acpi_table_sizewas only used by the pc-i440fx-2.0 machine, which got removed. Remove it and simplifyacpi_build().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 60 +++++++++----------------------------------- 2 files changed, 12 insertions(+), 49 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 +1
-9@@ -2496,13 +2496,12 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)X86MachineState *x86ms =X86_MACHINE (machine);DeviceState *iommu = pcms->iommu;GArray *table_offsets; -unsigned facs, dsdt, rsdt, fadt; +unsigned facs, dsdt, rsdt;AcpiPmInfo pm;AcpiMiscInfo misc;AcpiMcfgInfo mcfg;Range pci_hole = {}, pci_hole64 = {};uint8_t *u; -size_t aml_len =0 ;GArray *tables_blob = tables->table_data;AcpiSlicOem slic_oem = { .id =NULL , .table_id =NULL };Object *vmgenid_dev;@@ -2548,19 +2547,12 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)build_dsdt (tables_blob, tables->linker, &pm, &misc, &pci_hole, &pci_hole64, machine); -/* Count the size of the DSDT and SSDT, we will need it for legacy -* sizing of ACPI tables. -*/ - aml_len += tables_blob->len - dsdt; -/* ACPI tables pointed to by RSDT */ - fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); pm.fadt.facs_tbl_offset = &facs; pm.fadt.dsdt_tbl_offset = &dsdt; pm.fadt.xdsdt_tbl_offset = &dsdt;build_fadt (tables_blob, tables->linker, &pm.fadt, oem_id, oem_table_id); - aml_len += tables_blob->len - fadt;acpi_add_table (table_offsets, tables_blob); acpi_build_madt(tables_blob, tables->linker, x86ms,@@ -2691,49 +2683,21 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)* too simple to be enough. 4k turned out to be too small an * alignment very soon, and in fact it is almost impossible to * keep the table size stable for all (max_cpus, max_memory_slots)
hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2688
Quoted 10 lines
hw/i386/acpi-build.c +1
-7-* combinations. So the table size is always 64k for pc-i440fx-2.1 -* and we give an error if the table grows beyond that limit. -* -* We still have the problem of migrating from "-M pc-i440fx-2.0". For -* that, we exploit the fact that QEMU 2.1 generates _smaller_ tables -* than 2.0 and we can always pad the smaller tables with zeros. We can -* then use the exact size of the 2.0 tables. +* combinations. * * All this is for PIIX4, since QEMU 2.0 didn't support Q35 migration.
I think you could remove this "All this is for ..." sentence now, too?
Thomas
Quoted 47 lines
hw/i386/acpi-build.c +10
-32*/ -if (pcmc->legacy_acpi_table_size) { -/* Subtracting aml_len gives the size of fixed tables. Then add the -* size of the PIIX4 DSDT/SSDT in QEMU 2.0. -*/ -int legacy_aml_len = - pcmc->legacy_acpi_table_size + -ACPI_BUILD_LEGACY_CPU_AML_SIZE * x86ms->apic_id_limit; -int legacy_table_size = -ROUND_UP (tables_blob->len - aml_len + legacy_aml_len, -ACPI_BUILD_ALIGN_SIZE ); -if ((tables_blob->len > legacy_table_size) && - !pcmc->resizable_acpi_blob) { -/* Should happen only with PCI bridges and -M pc-i440fx-2.0. */ -warn_report ("ACPI table size %u exceeds %d bytes," -" migration may not work" , - tables_blob->len, legacy_table_size); -error_printf ("Try removing CPUs, NUMA nodes, memory slots" -" or PCI bridges.\n" ); - } -g_array_set_size (tables_blob, legacy_table_size); - }else { -/* 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 ); +/* 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 );
PATCH 6/18 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
@@ -221,7 +221,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
@@ -801,7 +801,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
@@ -65,7 +65,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) {
@@ -847,22 +840,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 06/18] hw/i386/pc: Remove deprecated pc-i440fx-2.1 machine
Quoted 5 lines · 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.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[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 7/18 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. Inline it, and remove its declaration. "kvm-cpu.h" is now empty, remove it too.
--- 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 07/18] target/i386/kvm: Remove x86_cpu_change_kvm_default() and 'kvm-cpu.h'
Quoted 2 lines · Philippe Mathieu-Daudé
x86_cpu_change_kvm_default()was only used out ofkvm-cpu.cby the pc-i440fx-2.1 machine, which got removed. Inline it, and
s/Inline/Make it static/ ?
(since it is not a real inlining here)
Quoted 8 lines
remove its declaration. "
kvm-cpu.h" is now empty, remove it too.Signed-off-by Philippe Mathieu-Daudé <[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
PATCH 8/18 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 | 2 +- hw/i386/pc.c | 1 - 3 files changed, 1 insertion(+), 3 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 -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, - pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, + pcmc->smbios_legacy_mode, true, pcms->smbios_entry_point_type); }
hw/i386/pc.c +0 -1
@@ -1791,7 +1791,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 08/18] hw/i386/pc: Remove PCMachineClass::smbios_uuid_encoded
Quoted 10 lines · Philippe Mathieu-Daudé
PCMachineClass::smbios_uuid_encodedwas only used by the pc-i440fx-2.1 machine, which got removed. It is now always true, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 1 - hw/i386/fw_cfg.c | 2 +- hw/i386/pc.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
PATCH 9/18 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().
--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 14 +++----------- 2 files changed, 3 insertions(+), 14 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
@@ -734,7 +734,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;
@@ -742,10 +741,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;
@@ -1301,12 +1298,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 ;/*
@@ -1331,8 +1325,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,
@@ -1793,7 +1786,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. */
Signature · 1 line
2.41.0
Re: [PATCH-for-9.1 09/18] hw/i386/pc: Remove PCMachineClass::enforce_aligned_dimm
Quoted 24 lines · Philippe Mathieu-Daudé
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().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 14 +++----------- 2 files changed, 3 insertions(+), 14 deletions(-)include/hw/i386/pc.h +0
-2@@ -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.
include/hw/i386/pc.h struct PCMachineClass { · line 117
Quoted 4 lines
include/hw/i386/pc.h +0
-1@@ -114,7 +112,6 @@ struct PCMachineClass {/* RAM / address space compat: */ bool gigabyte_align;bool has_reserved_memory; -bool enforce_aligned_dimm;
This is also mentioned in a comment in tests/avocado/mem-addr-space-check.py ... it would be nice if you could update that, too.
Thanks,
Thomas
PATCH 10/18 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
@@ -2720,7 +2720,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
@@ -1325,7 +1325,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
@@ -1024,7 +1024,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
@@ -3639,7 +3639,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 10/18] hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()
Quoted 11 lines · Philippe Mathieu-Daudé
'
legacy_align' is always NULL, remove it.Signed-off-by Philippe Mathieu-Daudé <[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(-)
PATCH 11/18 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
@@ -1393,8 +1393,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 11/18] hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
Quoted 11 lines · Philippe Mathieu-Daudé
'
legacy_align' is always NULL, remove it, simplifyingmemory_device_pre_plug().Signed-off-by Philippe Mathieu-Daudé <[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 12/18 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 | 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
@@ -221,10 +221,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
@@ -801,7 +801,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) {
@@ -824,22 +819,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 12/18] hw/i386/pc: Remove deprecated pc-i440fx-2.2 machine
Quoted 5 lines · 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.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[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 13/18 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 | 9 --------- hw/i386/pc.c | 1 - 3 files changed, 13 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 -9
@@ -2688,15 +2688,6 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)* All this is for PIIX4, since QEMU 2.0 didn't support Q35 migration. */ /* 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
@@ -1768,7 +1768,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 13/18] hw/i386/pc: Remove PCMachineClass::resizable_acpi_blob
Quoted 30 lines · Philippe Mathieu-Daudé
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().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/acpi-build.c | 9 --------- hw/i386/pc.c | 1 - 3 files changed, 13 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
-0
hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2690
Quoted 3 lines
hw/i386/acpi-build.c +0
-0@@ -2688,15 +2688,6 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)* All this is for PIIX4, since QEMU 2.0 didn't support Q35 migration. */ /* Make sure we have a buffer in case we need to resize the tables. */
Should the above comment be removed now, too?
hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2691
Quoted 10 lines
hw/i386/acpi-build.c +0
-9-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 );
Thomas
PATCH 14/18 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
@@ -2492,7 +2492,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;
@@ -2664,16 +2663,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
@@ -1758,7 +1758,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 14/18] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram
Quoted 10 lines · Philippe Mathieu-Daudé
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().Signed-off-by Philippe Mathieu-Daudé <[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 15/18 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
@@ -2456,7 +2456,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 15/18] hw/i386/acpi: Remove AcpiBuildState::rsdp field
Quoted 7 lines · Philippe Mathieu-Daudé
AcpiBuildState::rsdpis always NULL, remove it,
simplifyingacpi_build_update().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/i386/acpi-build.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
PATCH 16/18 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 | 7 ------- docs/about/removed-features.rst | 2 +- hw/i386/pc.c | 25 ------------------------- hw/i386/pc_piix.c | 20 -------------------- 4 files changed, 1 insertion(+), 53 deletions(-)
docs/about/deprecated.rst +0 -7
@@ -221,13 +221,6 @@ 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) -''''''''''''''''''''''''''''' - -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. - Nios II ``10m50-ghrd`` and ``nios2-generic-nommu`` machines (since 8.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
docs/about/removed-features.rst +1 -1
@@ -801,7 +801,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) {
@@ -807,18 +799,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 16/18] hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine
Quoted 18 lines · 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.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- docs/about/deprecated.rst | 7 ------- docs/about/removed-features.rst | 2 +- hw/i386/pc.c | 25 ------------------------- hw/i386/pc_piix.c | 20 -------------------- 4 files changed, 1 insertion(+), 53 deletions(-)docs/about/deprecated.rst +0
-0
docs/about/deprecated.rst deprecated; use the new name ``dtb-randomness`` instead. The new name · line 229
Quoted 9 lines
docs/about/deprecated.rst +0
-6@@ -221,13 +221,6 @@ 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) -''''''''''''''''''''''''''''' - -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.
Instead of removing this section, could you please change it to deprecate the next set of old PC machine types here (say 2.4 - 2.7 or so)?
Thanks,
Thomas
PATCH 17/18 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 | 6 ------ 3 files changed, 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 +0 -6
@@ -4344,12 +4344,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 17/18] target/i386: Remove X86CPU::kvm_no_smi_migration field
Quoted 43 lines · Philippe Mathieu-Daudé
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]>--- target/i386/cpu.h | 3 --- target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 6 ------ 3 files changed, 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 +0
-0
target/i386/kvm/kvm.c static int kvm_put_vcpu_events(X86CPU *cpu, int level) · line 4352
Quoted 9 lines
target/i386/kvm/kvm.c +0
-6@@ -4344,12 +4344,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 ; - }
Shouldn't it be the other way round, i.e. that the flag is now always set?
pc_compat_2_3[] had:
{ TYPE_X86_CPU, "kvm-no-smi-migration", "on" },... so I think kvm_no_smi_migration was set to true for the old machines?
Thomas
Re: [PATCH-for-9.1 17/18] target/i386: Remove X86CPU::kvm_no_smi_migration field
Quoted 22 lines · Thomas Huth
Quoted 21 lines · Philippe Mathieu-Daudé
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]>---
target/i386/cpu.h | 3 ---
target/i386/cpu.c | 2 --
target/i386/kvm/kvm.c| 6 ------3 files changed, 11 deletions(-)target/i386/kvm/kvm.c +0
-0@@ -4344,12 +4344,6 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.smi.pending = 0; events.smi.latched_init = 0; }
Quoted 8 lines
target/i386/kvm/kvm.c static int kvm_put_vcpu_events(X86CPU *cpu, int level) · line 4352
Quoted 6 lines
target/i386/kvm/kvm.c +0
-6- /* 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; - }Shouldn't it be the other way round, i.e. that the flag is now always set?
Oops you are right, good catch!
Quoted 9 lines
pc_compat_2_3[] had:
{
TYPE_X86_CPU, "kvm-no-smi-migration", "on" },... so I think
kvm_no_smi_migrationwas set to true for the old machines?Thomas
PATCH 18/18 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.
--- 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;
@@ -652,8 +662,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") ||
@@ -987,8 +996,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++) {
@@ -1737,9 +1745,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 18/18] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE
Quoted 9 lines · Philippe Mathieu-Daudé
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.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/i386/pc.h | 4 ---- hw/i386/pc.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-)