Skip to contentSkip to conversation

hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines

PATCH Superseded Philippe Mathieu-Daudé 3 participants 38 messages May 2, 2025 – May 8, 2025

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines

Since v2:
- Addressed Mark review comments and added his R-b tags

The versioned 'pc' and 'q35' machines up to 2.12 been marked as deprecated two releases ago, and are older than 6 years, so according to our support policy we can remove them.

This series only includes the 2.6 and 2.7 machines removal, as it is a big enough number of LoC removed. Rest will follow.

Based-on: <[email protected]>

Philippe Mathieu-Daudé (19):
hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem() hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled hw/i386/pc: Remove pc_compat_2_6[] array
hw/intc/apic: Remove APICCommonState::legacy_instance_id field hw/core/machine: Remove hw_compat_2_6[] array hw/virtio/virtio-mmio: Remove
VirtIOMMIOProxy::format_transport_address field
hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines hw/i386/pc: Remove pc_compat_2_7[] array
hw/audio/pcspk: Remove PCSpkState::migrate field hw/core/machine: Remove hw_compat_2_7[] array hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field hw/intc/ioapic: Remove IOAPICCommonState::version field hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features
field
hw/char/virtio-serial: Do not expose the 'emergency-write' property hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition

 hw/intc/ioapic_internal.h         |   3 +-
 include/hw/acpi/cpu_hotplug.h     |   3 -
 include/hw/boards.h               |   6 -
 include/hw/i386/apic_internal.h   |   1 -
 include/hw/i386/intel_iommu.h     |   1 -
 include/hw/i386/pc.h              |   9 --
 include/hw/i386/x86.h             |   2 -
 include/hw/virtio/virtio-mmio.h   |   1 -
 include/hw/virtio/virtio-pci.h    |   2 -
 include/hw/virtio/virtio-serial.h |   2 -
 hw/acpi/cpu_hotplug.c             | 230 ------------------------------
 hw/audio/pcspk.c                  |  10 --
 hw/char/virtio-serial-bus.c       |   9 +-
 hw/core/machine.c                 |  17 ---
 hw/display/virtio-vga.c           |  10 --
 hw/i386/acpi-build.c              |   4 +-
 hw/i386/intel_iommu.c             |   5 +-
 hw/i386/microvm.c                 |   3 -
 hw/i386/multiboot.c               |   7 +-
 hw/i386/pc.c                      |  18 ---
 hw/i386/pc_piix.c                 |  23 ---
 hw/i386/pc_q35.c                  |  24 ----
 hw/i386/x86-common.c              |   3 +-
 hw/i386/x86.c                     |   2 -
 hw/intc/apic_common.c             |   5 -
 hw/intc/ioapic.c                  |  18 +--
 hw/intc/ioapic_common.c           |   2 +-
 hw/mips/loongson3_virt.c          |   2 +-
 hw/nvram/fw_cfg.c                 |  46 +++---
 hw/virtio/virtio-mmio.c           |  15 --
 hw/virtio/virtio-pci.c            |  12 +-
 31 files changed, 37 insertions(+), 458 deletions(-)
Signature · 1 line
2.47.1
#1 lore raw

PATCH v3 1/19 hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines

These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.

---
 hw/i386/pc_piix.c | 14 --------------
 hw/i386/pc_q35.c  | 14 --------------
 2 files changed, 28 deletions(-)
hw/i386/pc_piix.c +0 -14
index 7a62bb06500..98a118fd4a0 100644
@@ -764,20 +764,6 @@ static void pc_i440fx_machine_2_7_options(MachineClass *m)
 
 DEFINE_I440FX_MACHINE(2, 7);
 
-static void pc_i440fx_machine_2_6_options(MachineClass *m)
-{
-    X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
-    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
-
-    pc_i440fx_machine_2_7_options(m);
-    pcmc->legacy_cpu_hotplug = true;
-    x86mc->fwcfg_dma_enabled = false;
-    compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len);
-    compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len);
-}
-
-DEFINE_I440FX_MACHINE(2, 6);
-
 #ifdef CONFIG_ISAPC
 static void isapc_machine_options(MachineClass *m)
 {
hw/i386/pc_q35.c +0 -14
index 33211b1876f..b7ffb5f1216 100644
@@ -658,17 +658,3 @@ static void pc_q35_machine_2_7_options(MachineClass *m)
 }
 
 DEFINE_Q35_MACHINE(2, 7);
-
-static void pc_q35_machine_2_6_options(MachineClass *m)
-{
-    X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
-    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
-
-    pc_q35_machine_2_7_options(m);
-    pcmc->legacy_cpu_hotplug = true;
-    x86mc->fwcfg_dma_enabled = false;
-    compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len);
-    compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len);
-}
-
-DEFINE_Q35_MACHINE(2, 6);
Signature · 1 line
2.47.1
Reviewed-by on v3 1/19
#2 lore raw

Re: [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines

Quoted 11 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:33 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and
pc-i440fx-2.6 machines
X-Mailer: git-send-email 2.47.1

These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.

Quoted 6 lines
---
 hw/i386/pc_piix.c | 14 --------------
 hw/i386/pc_q35.c  | 14 --------------
 2 files changed, 28 deletions(-)
#3 lore raw

PATCH v3 2/19 hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field

In reply to Philippe Mathieu-Daudé

The PCMachineClass::legacy_cpu_hotplug boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify build_dsdt(), removing build_legacy_cpu_hotplug_aml() altogether.

Note, this field was added by commit 679dd1a957d ("pc: use new CPU hotplug interface since 2.7 machine type"):

Quoted 11 lines

For compatibility reasons PC/Q35 will start with legacy CPU hotplug interface by default but with new CPU hotplug AML code since 2.7 machine type. That way legacy firmware that doesn't use QEMU generated ACPI tables will be able to continue using legacy CPU hotplug interface.

While new machine type, with firmware supporting QEMU provided ACPI tables, will generate new CPU hotplug AML, which will switch to new CPU hotplug interface when guest OS executes its _INI method on ACPI tables loading.

---
 include/hw/acpi/cpu_hotplug.h |   3 -
 include/hw/i386/pc.h          |   3 -
 hw/acpi/cpu_hotplug.c         | 230 ----------------------------------
 hw/i386/acpi-build.c          |   4 +-
 4 files changed, 1 insertion(+), 239 deletions(-)
include/hw/acpi/cpu_hotplug.h +0 -3
index 3b932abbbbe..aeee630cf05 100644
@@ -34,7 +34,4 @@ void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
 void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu,
                                 CPUHotplugState *cpuhp_state,
                                 uint16_t io_port);
-
-void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine,
-                                  uint16_t io_base);
 #endif
include/hw/i386/pc.h +0 -3
index 79b72c54dd3..a3de3e9560d 100644
@@ -110,9 +110,6 @@ struct PCMachineClass {
     bool enforce_amd_1tb_hole;
     bool isa_bios_alias;
 
-    /* generate legacy CPU hotplug AML */
-    bool legacy_cpu_hotplug;
-
     /* use PVH to load kernels that support this feature */
     bool pvh_enabled;
 
hw/acpi/cpu_hotplug.c +0 -230

233 lines not on this page · raw message

hw/i386/acpi-build.c +1 -3
index 3fffa4a3328..625889783ec 100644
@@ -1465,9 +1465,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     }
     aml_append(dsdt, scope);
 
-    if (pcmc->legacy_cpu_hotplug) {
-        build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
-    } else {
+    {
         CPUHotplugFeatures opts = {
             .acpi_1_compatible = true, .has_legacy_cphp = true,
             .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,
Signature · 1 line
2.47.1
Reviewed-by on v3 2/19
#4 lore raw

Re: [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1468

Quoted 12 lines
hw/i386/acpi-build.c +1 -3
index 3fffa4a3328..625889783ec 100644
@@ -1465,9 +1465,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     }
     aml_append(dsdt, scope);
 
-    if (pcmc->legacy_cpu_hotplug) {
-        build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
-    } else {
+    {

Why leave the {} here? for clarity?

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1471

Quoted 3 lines
hw/i386/acpi-build.c +0 -0
         CPUHotplugFeatures opts = {
             .acpi_1_compatible = true, .has_legacy_cphp = true,
             .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,

Otherwise,

#5 lore raw

Re: [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field

Quoted 8 lines · Zhao Liu
Quoted 8 lines
hw/i386/acpi-build.c +0 -0
index 3fffa4a3328..625889783ec 100644
@@ -1465,9 +1465,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
      }
      aml_append(dsdt, scope);
 
Quoted 6 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1468

Quoted 4 lines
hw/i386/acpi-build.c +1 -3
-    if (pcmc->legacy_cpu_hotplug) {
-        build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
-    } else {
+    {

Why leave the {} here? for clarity?

Exactly, the diff-stat contains already more than 200 lines, too much to my taste. If we de-indent this block, per our coding style we also need to declare 'CPUHotplugFeatures opts' earlier. If you really want the braces removed, I'd to it in a follow-up cleanup patch.

Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1471

Quoted 4 lines
hw/i386/acpi-build.c +0 -0
          CPUHotplugFeatures opts = {
              .acpi_1_compatible = true, .has_legacy_cphp = true,
              .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,

Otherwise,

Thanks!

#6 lore raw

PATCH v3 3/19 hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()

In reply to Philippe Mathieu-Daudé

fw_cfg_init_mem_wide() is prefered to initialize fw_cfg with DMA support. Without DMA, use fw_cfg_init_mem().

---
 hw/mips/loongson3_virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/loongson3_virt.c +1 -1
index de6fbcc0cb4..41733988729 100644
@@ -286,7 +286,7 @@ static void fw_conf_init(void)
     FWCfgState *fw_cfg;
     hwaddr cfg_addr = virt_memmap[VIRT_FW_CFG].base;
 
-    fw_cfg = fw_cfg_init_mem_wide(cfg_addr, cfg_addr + 8, 8, 0, NULL);
+    fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)current_machine->smp.cpus);
     fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)current_machine->smp.max_cpus);
     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, loaderparams.ram_size);
Signature · 1 line
2.47.1
#7 lore raw

Re: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()

Quoted 19 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:35 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using
fw_cfg_init_mem()
X-Mailer: git-send-email 2.47.1

fw_cfg_init_mem_wide() is prefered to initialize fw_cfg with DMA support. Without DMA, use fw_cfg_init_mem().

---
 hw/mips/loongson3_virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/loongson3_virt.c +0 -0
index de6fbcc0cb4..41733988729 100644

hw/mips/loongson3_virt.c static void fw_conf_init(void) · line 289

Quoted 5 lines
hw/mips/loongson3_virt.c +1 -1
@@ -286,7 +286,7 @@ static void fw_conf_init(void)
     FWCfgState *fw_cfg;
     hwaddr cfg_addr = virt_memmap[VIRT_FW_CFG].base;
 
-    fw_cfg = fw_cfg_init_mem_wide(cfg_addr, cfg_addr + 8, 8, 0, NULL);
+    fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8);

EMM, I'm not sure if I'm basing on the wrong code base... in which patch does fw_cfg_init_mem() accept the third argument?

Quoted 6 lines
hw/mips/loongson3_virt.c +0 -0
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)current_machine->smp.cpus);
     fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)current_machine->smp.max_cpus);
     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, loaderparams.ram_size);
Signature · 1 line
2.47.1
#8 lore raw

Re: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()

Quoted 23 lines · Zhao Liu
Quoted 22 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:35 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using
fw_cfg_init_mem()
X-Mailer: git-send-email 2.47.1

fw_cfg_init_mem_wide() is prefered to initialize fw_cfg with DMA support. Without DMA, use fw_cfg_init_mem().

---
  hw/mips/loongson3_virt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/loongson3_virt.c +0 -0
index de6fbcc0cb4..41733988729 100644
@@ -286,7 +286,7 @@ static void fw_conf_init(void)
      FWCfgState *fw_cfg;
      hwaddr cfg_addr = virt_memmap[VIRT_FW_CFG].base;
 
Quoted 5 lines

hw/mips/loongson3_virt.c static void fw_conf_init(void) · line 289

Quoted 2 lines
hw/mips/loongson3_virt.c +1 -1
-    fw_cfg = fw_cfg_init_mem_wide(cfg_addr, cfg_addr + 8, 8, 0, NULL);
+    fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8);

EMM, I'm not sure if I'm basing on the wrong code base... in which patch does fw_cfg_init_mem() accept the third argument?

Doh, I missed that, thanks :)

#9 lore raw

PATCH v3 4/19 hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out

In reply to Philippe Mathieu-Daudé

Factor fw_cfg_init_mem_internal() out of fw_cfg_init_mem_wide(). In fw_cfg_init_mem_wide(), assert DMA arguments are provided. Callers without DMA have to use the fw_cfg_init_mem() helper.

---
 hw/nvram/fw_cfg.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
hw/nvram/fw_cfg.c +14 -6
index 54cfa07d3f5..d119c10d308 100644
@@ -1053,9 +1053,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     return s;
 }
 
-FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
-                                 hwaddr data_addr, uint32_t data_width,
-                                 hwaddr dma_addr, AddressSpace *dma_as)
+static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr,
+                                         hwaddr data_addr, uint32_t data_width,
+                                         hwaddr dma_addr, AddressSpace *dma_as)
 {
     DeviceState *dev;
     SysBusDevice *sbd;
@@ -1087,11 +1087,19 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
     return s;
 }
 
+FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
+                                 hwaddr data_addr, uint32_t data_width,
+                                 hwaddr dma_addr, AddressSpace *dma_as)
+{
+    assert(dma_iobase && dma_as);
+    fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr, dma_addr, dma_as);
+}
+
 FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)
 {
-    return fw_cfg_init_mem_wide(ctl_addr, data_addr,
-                                fw_cfg_data_mem_ops.valid.max_access_size,
-                                0, NULL);
+    return fw_cfg_init_mem_internal(ctl_addr, data_addr,
+                                    fw_cfg_data_mem_ops.valid.max_access_size,
+                                    0, NULL);
 }
 
 
Signature · 1 line
2.47.1
#10 lore raw

Re: [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out

Quoted 33 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:36 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 04/19] hw/nvram/fw_cfg: Factor
fw_cfg_init_mem_internal() out
X-Mailer: git-send-email 2.47.1

Factor fw_cfg_init_mem_internal() out of fw_cfg_init_mem_wide(). In fw_cfg_init_mem_wide(), assert DMA arguments are provided. Callers without DMA have to use the fw_cfg_init_mem() helper.

---
 hw/nvram/fw_cfg.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
hw/nvram/fw_cfg.c +3 -3
index 54cfa07d3f5..d119c10d308 100644
@@ -1053,9 +1053,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     return s;
 }
 
-FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
-                                 hwaddr data_addr, uint32_t data_width,
-                                 hwaddr dma_addr, AddressSpace *dma_as)
+static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr,
+                                         hwaddr data_addr, uint32_t data_width,
+                                         hwaddr dma_addr, AddressSpace *dma_as)
 {
     DeviceState *dev;
     SysBusDevice *sbd;

hw/nvram/fw_cfg.c FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, · line 1092

Quoted 6 lines
hw/nvram/fw_cfg.c +3 -0
@@ -1087,11 +1087,19 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
     return s;
 }
 
+FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
+                                 hwaddr data_addr, uint32_t data_width,
+                                 hwaddr dma_addr, AddressSpace *dma_as)

How about mentioning DMA in the name? fw_cfg_init_mem_dma.

hw/nvram/fw_cfg.c FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, · line 1098

Quoted 6 lines
hw/nvram/fw_cfg.c +5 -0
+{
+    assert(dma_iobase && dma_as);
+    fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr, dma_addr, dma_as);
+}
+
 FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)

OK, now I'm sure fw_cfg_init_mem() only accepts 2 arguments. :-)

Quoted 13 lines
hw/nvram/fw_cfg.c +3 -3
 {
-    return fw_cfg_init_mem_wide(ctl_addr, data_addr,
-                                fw_cfg_data_mem_ops.valid.max_access_size,
-                                0, NULL);
+    return fw_cfg_init_mem_internal(ctl_addr, data_addr,
+                                    fw_cfg_data_mem_ops.valid.max_access_size,
+                                    0, NULL);
 }
 
 
Signature · 1 line
2.47.1
#11 lore raw

PATCH v3 5/19 hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field

In reply to Philippe Mathieu-Daudé

The X86MachineClass::fwcfg_dma_enabled boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify.

---
 include/hw/i386/x86.h | 2 --
 hw/i386/microvm.c     | 3 ---
 hw/i386/multiboot.c   | 7 +------
 hw/i386/x86-common.c  | 3 +--
 hw/i386/x86.c         | 2 --
 5 files changed, 2 insertions(+), 15 deletions(-)
include/hw/i386/x86.h +0 -2
index fc460b82f82..29d37af11e6 100644
@@ -29,8 +29,6 @@
 struct X86MachineClass {
     MachineClass parent;
 
-    /* use DMA capable linuxboot option rom */
-    bool fwcfg_dma_enabled;
     /* CPU and apic information: */
     bool apic_xrupt_override;
 };
hw/i386/microvm.c +0 -3
index e0daf0d4fc3..b1262fb1523 100644
@@ -637,7 +637,6 @@ GlobalProperty microvm_properties[] = {
 
 static void microvm_class_init(ObjectClass *oc, const void *data)
 {
-    X86MachineClass *x86mc = X86_MACHINE_CLASS(oc);
     MicrovmMachineClass *mmc = MICROVM_MACHINE_CLASS(oc);
     MachineClass *mc = MACHINE_CLASS(oc);
     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
@@ -671,8 +670,6 @@ static void microvm_class_init(ObjectClass *oc, const void *data)
     hc->unplug_request = microvm_device_unplug_request_cb;
     hc->unplug = microvm_device_unplug_cb;
 
-    x86mc->fwcfg_dma_enabled = true;
-
     object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
                               microvm_machine_get_rtc,
                               microvm_machine_set_rtc,
hw/i386/multiboot.c +1 -6
index 6e6b96bc345..bfa7e8f1e83 100644
@@ -153,7 +153,6 @@ int load_multiboot(X86MachineState *x86ms,
                    int kernel_file_size,
                    uint8_t *header)
 {
-    bool multiboot_dma_enabled = X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma_enabled;
     int i, is_multiboot = 0;
     uint32_t flags = 0;
     uint32_t mh_entry_addr;
@@ -402,11 +401,7 @@ int load_multiboot(X86MachineState *x86ms,
     fw_cfg_add_bytes(fw_cfg, FW_CFG_INITRD_DATA, mb_bootinfo_data,
                      sizeof(bootinfo));
 
-    if (multiboot_dma_enabled) {
-        option_rom[nb_option_roms].name = "multiboot_dma.bin";
-    } else {
-        option_rom[nb_option_roms].name = "multiboot.bin";
-    }
+    option_rom[nb_option_roms].name = "multiboot_dma.bin";
     option_rom[nb_option_roms].bootindex = 0;
     nb_option_roms++;
 
hw/i386/x86-common.c +1 -2
index 1b0671c5239..27254a0e9f1 100644
@@ -634,7 +634,6 @@ void x86_load_linux(X86MachineState *x86ms,
                     int acpi_data_size,
                     bool pvh_enabled)
 {
-    bool linuxboot_dma_enabled = X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma_enabled;
     uint16_t protocol;
     int setup_size, kernel_size, cmdline_size;
     int dtb_size, setup_data_offset;
@@ -993,7 +992,7 @@ void x86_load_linux(X86MachineState *x86ms,
 
     option_rom[nb_option_roms].bootindex = 0;
     option_rom[nb_option_roms].name = "linuxboot.bin";
-    if (linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) {
+    if (fw_cfg_dma_enabled(fw_cfg)) {
         option_rom[nb_option_roms].name = "linuxboot_dma.bin";
     }
     nb_option_roms++;
hw/i386/x86.c +0 -2
index f80533df1c5..dbf104d60af 100644
@@ -375,14 +375,12 @@ static void x86_machine_initfn(Object *obj)
 static void x86_machine_class_init(ObjectClass *oc, const void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
-    X86MachineClass *x86mc = X86_MACHINE_CLASS(oc);
     NMIClass *nc = NMI_CLASS(oc);
 
     mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
     mc->get_default_cpu_node_id = x86_get_default_cpu_node_id;
     mc->possible_cpu_arch_ids = x86_possible_cpu_arch_ids;
     mc->kvm_type = x86_kvm_type;
-    x86mc->fwcfg_dma_enabled = true;
     nc->nmi_monitor_handler = x86_nmi;
 
     object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto",
Signature · 1 line
2.47.1
Reviewed-by on v3 5/19
#12 lore raw

Re: [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field

Quoted 10 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:37 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 05/19] hw/i386/x86: Remove
X86MachineClass::fwcfg_dma_enabled field
X-Mailer: git-send-email 2.47.1

The X86MachineClass::fwcfg_dma_enabled boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify.

Quoted 8 lines
---
 include/hw/i386/x86.h | 2 --
 hw/i386/microvm.c     | 3 ---
 hw/i386/multiboot.c   | 7 +------
 hw/i386/x86-common.c  | 3 +--
 hw/i386/x86.c         | 2 --
 5 files changed, 2 insertions(+), 15 deletions(-)

Note for myself: fwcfg_dma_enabled is not a property.

#13 lore raw

PATCH v3 6/19 hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled

In reply to Philippe Mathieu-Daudé

Now than all calls to fw_cfg_init_io_dma() pass DMA arguments, the 'dma_enabled' of the TYPE_FW_CFG_IO type is not used anymore. Remove it, simplifying fw_cfg_init_io_dma() and fw_cfg_io_realize().

Note, we can not remove the equivalent in fw_cfg_mem_properties[] because it is still used in HPPA and MIPS Loongson3 machines:

  $ git grep -w fw_cfg_init_mem
  hw/hppa/machine.c:204:    fw_cfg = fw_cfg_init_mem(addr, addr + 4);
  hw/mips/loongson3_virt.c:289:    fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8);
---
 hw/nvram/fw_cfg.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)
hw/nvram/fw_cfg.c +8 -18
index d119c10d308..c1bd229e8f3 100644
@@ -1026,12 +1026,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     FWCfgIoState *ios;
     FWCfgState *s;
     MemoryRegion *iomem = get_system_io();
-    bool dma_requested = dma_iobase && dma_as;
 
+    assert(dma_iobase && dma_as);
     dev = qdev_new(TYPE_FW_CFG_IO);
-    if (!dma_requested) {
-        qdev_prop_set_bit(dev, "dma_enabled", false);
-    }
 
     object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG,
                               OBJECT(dev));
@@ -1042,13 +1039,10 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     memory_region_add_subregion(iomem, iobase, &ios->comb_iomem);
 
     s = FW_CFG(dev);
-
-    if (s->dma_enabled) {
-        /* 64 bits for the address field */
-        s->dma_as = dma_as;
-        s->dma_addr = 0;
-        memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem);
-    }
+    /* 64 bits for the address field */
+    s->dma_as = dma_as;
+    s->dma_addr = 0;
+    memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem);
 
     return s;
 }
@@ -1185,8 +1179,6 @@ static void fw_cfg_file_slots_allocate(FWCfgState *s, Error **errp)
 }
 
 static const Property fw_cfg_io_properties[] = {
-    DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled,
-                     true),
     DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots,
                        FW_CFG_FILE_SLOTS_DFLT),
 };
@@ -1207,11 +1199,9 @@ static void fw_cfg_io_realize(DeviceState *dev, Error **errp)
     memory_region_init_io(&s->comb_iomem, OBJECT(s), &fw_cfg_comb_mem_ops,
                           FW_CFG(s), "fwcfg", FW_CFG_CTL_SIZE);
 
-    if (FW_CFG(s)->dma_enabled) {
-        memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
-                              &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
-                              sizeof(dma_addr_t));
-    }
+    memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
+                          &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
+                          sizeof(dma_addr_t));
 
     fw_cfg_common_realize(dev, errp);
 }
Signature · 1 line
2.47.1
Reviewed-by on v3 6/19
#14 lore raw

Re: [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled

Quoted 10 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:38 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 06/19] hw/nvram/fw_cfg: Remove
fw_cfg_io_properties::dma_enabled
X-Mailer: git-send-email 2.47.1

Now than all calls to fw_cfg_init_io_dma() pass DMA arguments, the 'dma_enabled' of the TYPE_FW_CFG_IO type is not used anymore. Remove it, simplifying fw_cfg_init_io_dma() and fw_cfg_io_realize().

Quoted 6 lines

Note, we can not remove the equivalent in fw_cfg_mem_properties[] because it is still used in HPPA and MIPS Loongson3 machines:

  $ git grep -w fw_cfg_init_mem
  hw/hppa/machine.c:204:    fw_cfg = fw_cfg_init_mem(addr, addr + 4);
  hw/mips/loongson3_virt.c:289:    fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8);

The argument here is wrong. :-)

Quoted 4 lines
---
 hw/nvram/fw_cfg.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)
#15 lore raw

PATCH v3 7/19 hw/i386/pc: Remove pc_compat_2_6[] array

In reply to Philippe Mathieu-Daudé

The pc_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.

---
 include/hw/i386/pc.h | 3 ---
 hw/i386/pc.c         | 8 --------
 2 files changed, 11 deletions(-)
include/hw/i386/pc.h +0 -3
index a3de3e9560d..4fb2033bc54 100644
@@ -292,9 +292,6 @@ extern const size_t pc_compat_2_8_len;
 extern GlobalProperty pc_compat_2_7[];
 extern const size_t pc_compat_2_7_len;
 
-extern GlobalProperty pc_compat_2_6[];
-extern const size_t pc_compat_2_6_len;
-
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                  const void *data) \
hw/i386/pc.c +0 -8
index 49632b69d29..7573b880905 100644
@@ -251,14 +251,6 @@ GlobalProperty pc_compat_2_7[] = {
 };
 const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);
 
-GlobalProperty pc_compat_2_6[] = {
-    { TYPE_X86_CPU, "cpuid-0xb", "off" },
-    { "vmxnet3", "romfile", "" },
-    { TYPE_X86_CPU, "fill-mtrr-mask", "off" },
-    { "apic-common", "legacy-instance-id", "on", }
-};
-const size_t pc_compat_2_6_len = G_N_ELEMENTS(pc_compat_2_6);
-
 /*
  * @PC_FW_DATA:
  * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
Signature · 1 line
2.47.1
Reviewed-by on v3 7/19
#16 lore raw

Re: [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array

Quoted 8 lines · Philippe Mathieu-Daudé

Date: Fri, 2 May 2025 20:56:39 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array
X-Mailer: git-send-email 2.47.1

The pc_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.

Quoted 6 lines
---
 include/hw/i386/pc.h | 3 ---
 hw/i386/pc.c         | 8 --------
 2 files changed, 11 deletions(-)
#17 lore raw

PATCH v3 8/19 hw/intc/apic: Remove APICCommonState::legacy_instance_id field

In reply to Philippe Mathieu-Daudé

The APICCommonState::legacy_instance_id boolean was only set in the pc_compat_2_6[] array, via the 'legacy-instance-id=on' property. We removed all machines using that array, lets remove that property, simplifying apic_common_realize().

Because instance_id is initialized as initial_apic_id, we can not register vmstate_apic_common directly via dc->vmsd.

---
 include/hw/i386/apic_internal.h | 1 -
 hw/intc/apic_common.c           | 5 -----
 2 files changed, 6 deletions(-)
include/hw/i386/apic_internal.h +0 -1
index 429278da618..db6a9101530 100644
@@ -188,7 +188,6 @@ struct APICCommonState {
     uint32_t vapic_control;
     DeviceState *vapic;
     hwaddr vapic_paddr; /* note: persistence via kvmvapic */
-    bool legacy_instance_id;
     uint32_t extended_log_dest;
 };
 
hw/intc/apic_common.c +0 -5
index 37a7a7019d3..1d259b97e63 100644
@@ -294,9 +294,6 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
         info->enable_tpr_reporting(s, true);
     }
 
-    if (s->legacy_instance_id) {
-        instance_id = VMSTATE_INSTANCE_ID_ANY;
-    }
     vmstate_register_with_alias_id(NULL, instance_id, &vmstate_apic_common,
                                    s, -1, 0, NULL);
 
@@ -412,8 +409,6 @@ static const Property apic_properties_common[] = {
     DEFINE_PROP_UINT8("version", APICCommonState, version, 0x14),
     DEFINE_PROP_BIT("vapic", APICCommonState, vapic_control, VAPIC_ENABLE_BIT,
                     true),
-    DEFINE_PROP_BOOL("legacy-instance-id", APICCommonState, legacy_instance_id,
-                     false),
 };
 
 static void apic_common_get_id(Object *obj, Visitor *v, const char *name,
Signature · 1 line
2.47.1
#18 lore raw

PATCH v3 9/19 hw/core/machine: Remove hw_compat_2_6[] array

In reply to Philippe Mathieu-Daudé

The hw_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.

---
 include/hw/boards.h | 3 ---
 hw/core/machine.c   | 8 --------
 2 files changed, 11 deletions(-)
include/hw/boards.h +0 -3
index 5f1a0fb7e28..a881db8e7d6 100644
@@ -841,7 +841,4 @@ extern const size_t hw_compat_2_8_len;
 extern GlobalProperty hw_compat_2_7[];
 extern const size_t hw_compat_2_7_len;
 
-extern GlobalProperty hw_compat_2_6[];
-extern const size_t hw_compat_2_6_len;
-
 #endif
hw/core/machine.c +0 -8
index e7001bf92cd..ce98820f277 100644
@@ -275,14 +275,6 @@ GlobalProperty hw_compat_2_7[] = {
 };
 const size_t hw_compat_2_7_len = G_N_ELEMENTS(hw_compat_2_7);
 
-GlobalProperty hw_compat_2_6[] = {
-    { "virtio-mmio", "format_transport_address", "off" },
-    /* Optional because not all virtio-pci devices support legacy mode */
-    { "virtio-pci", "disable-modern", "on",  .optional = true },
-    { "virtio-pci", "disable-legacy", "off", .optional = true },
-};
-const size_t hw_compat_2_6_len = G_N_ELEMENTS(hw_compat_2_6);
-
 MachineState *current_machine;
 
 static char *machine_get_kernel(Object *obj, Error **errp)
Signature · 1 line
2.47.1
Reviewed-by on v3 9/19
#19 lore raw

Re: [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array

Quoted 9 lines · Philippe Mathieu-Daudé

The hw_compat_2_6[] array was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it.

---
  include/hw/boards.h | 3 ---
  hw/core/machine.c   | 8 --------
  2 files changed, 11 deletions(-)
#20 lore raw

PATCH v3 10/19 hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field

In reply to Philippe Mathieu-Daudé

The VirtIOMMIOProxy::format_transport_address boolean was only set in the hw_compat_2_6[] array, via the 'format_transport_address=off' property. We removed all machines using that array, lets remove that property, simplifying virtio_mmio_bus_get_dev_path().

---
 include/hw/virtio/virtio-mmio.h |  1 -
 hw/virtio/virtio-mmio.c         | 15 ---------------
 2 files changed, 16 deletions(-)
include/hw/virtio/virtio-mmio.h +0 -1
index aa492620228..8b19ec2291a 100644
@@ -66,7 +66,6 @@ struct VirtIOMMIOProxy {
     uint32_t guest_page_shift;
     /* virtio-bus */
     VirtioBusState bus;
-    bool format_transport_address;
     /* Fields only used for non-legacy (v2) devices */
     uint32_t guest_features[2];
     VirtIOMMIOQueue vqs[VIRTIO_QUEUE_MAX];
hw/virtio/virtio-mmio.c +0 -15
index 532c67107ba..b7ee115b990 100644
@@ -752,8 +752,6 @@ static void virtio_mmio_pre_plugged(DeviceState *d, Error **errp)
 /* virtio-mmio device */
 
 static const Property virtio_mmio_properties[] = {
-    DEFINE_PROP_BOOL("format_transport_address", VirtIOMMIOProxy,
-                     format_transport_address, true),
     DEFINE_PROP_BOOL("force-legacy", VirtIOMMIOProxy, legacy, true),
     DEFINE_PROP_BIT("ioeventfd", VirtIOMMIOProxy, flags,
                     VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD_BIT, true),
@@ -815,19 +813,6 @@ static char *virtio_mmio_bus_get_dev_path(DeviceState *dev)
     virtio_mmio_proxy = VIRTIO_MMIO(virtio_mmio_bus->parent);
     proxy_path = qdev_get_dev_path(DEVICE(virtio_mmio_proxy));
 
-    /*
-     * If @format_transport_address is false, then we just perform the same as
-     * virtio_bus_get_dev_path(): we delegate the address formatting for the
-     * device on the virtio-mmio bus to the bus that the virtio-mmio proxy
-     * (i.e., the device that implements the virtio-mmio bus) resides on. In
-     * this case the base address of the virtio-mmio transport will be
-     * invisible.
-     */
-    if (!virtio_mmio_proxy->format_transport_address) {
-        return proxy_path;
-    }
-
-    /* Otherwise, we append the base address of the transport. */
     section = memory_region_find(&virtio_mmio_proxy->iomem, 0, 0x200);
     assert(section.mr);
 
Signature · 1 line
2.47.1
Reviewed-by on v3 10/19
#21 lore raw

Re: [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field

Quoted 11 lines · Philippe Mathieu-Daudé

The VirtIOMMIOProxy::format_transport_address boolean was only set in the hw_compat_2_6[] array, via the 'format_transport_address=off' property. We removed all machines using that array, lets remove that property, simplifying virtio_mmio_bus_get_dev_path().

---
  include/hw/virtio/virtio-mmio.h |  1 -
  hw/virtio/virtio-mmio.c         | 15 ---------------
  2 files changed, 16 deletions(-)
#22 lore raw

PATCH v3 11/19 hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines

In reply to Philippe Mathieu-Daudé

These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.

---
 hw/i386/pc_piix.c |  9 ---------
 hw/i386/pc_q35.c  | 10 ----------
 2 files changed, 19 deletions(-)
hw/i386/pc_piix.c +0 -9
index 98a118fd4a0..98bd8d0e67b 100644
@@ -755,15 +755,6 @@ static void pc_i440fx_machine_2_8_options(MachineClass *m)
 
 DEFINE_I440FX_MACHINE(2, 8);
 
-static void pc_i440fx_machine_2_7_options(MachineClass *m)
-{
-    pc_i440fx_machine_2_8_options(m);
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_I440FX_MACHINE(2, 7);
-
 #ifdef CONFIG_ISAPC
 static void isapc_machine_options(MachineClass *m)
 {
hw/i386/pc_q35.c +0 -10
index b7ffb5f1216..a1f46cd8f03 100644
@@ -648,13 +648,3 @@ static void pc_q35_machine_2_8_options(MachineClass *m)
 }
 
 DEFINE_Q35_MACHINE(2, 8);
-
-static void pc_q35_machine_2_7_options(MachineClass *m)
-{
-    pc_q35_machine_2_8_options(m);
-    m->max_cpus = 255;
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_Q35_MACHINE(2, 7);
Signature · 1 line
2.47.1
#23 lore raw

Re: [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines

Quoted 40 lines · Philippe Mathieu-Daudé

These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.

---
  hw/i386/pc_piix.c |  9 ---------
  hw/i386/pc_q35.c  | 10 ----------
  2 files changed, 19 deletions(-)
hw/i386/pc_piix.c +0 -9
index 98a118fd4a0..98bd8d0e67b 100644
@@ -755,15 +755,6 @@ static void pc_i440fx_machine_2_8_options(MachineClass *m)
 
  DEFINE_I440FX_MACHINE(2, 8);
 
-static void pc_i440fx_machine_2_7_options(MachineClass *m)
-{
-    pc_i440fx_machine_2_8_options(m);
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_I440FX_MACHINE(2, 7);
-
  #ifdef CONFIG_ISAPC
  static void isapc_machine_options(MachineClass *m)
  {
hw/i386/pc_q35.c +0 -0
index b7ffb5f1216..a1f46cd8f03 100644
@@ -648,13 +648,3 @@ static void pc_q35_machine_2_8_options(MachineClass *m)
  }
 
  DEFINE_Q35_MACHINE(2, 8);

hw/i386/pc_q35.c static void pc_q35_machine_2_8_options(MachineClass *m) · line 660

Quoted 10 lines
hw/i386/pc_q35.c +0 -10
-
-static void pc_q35_machine_2_7_options(MachineClass *m)
-{
-    pc_q35_machine_2_8_options(m);
-    m->max_cpus = 255;
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_Q35_MACHINE(2, 7);

As noticed Thomas for 2.4, here I missed to squash:

-- >8 --

tests/qtest/test-x86-cpuid-compat.c +0 -11
index 456e2af6657..5e0547e81b7 100644
@@ -348,11 +347,0 @@ int main(int argc, char **argv)
-    if (qtest_has_machine("pc-i440fx-2.7")) {
-        add_cpuid_test("x86/cpuid/auto-level/pc-2.7",
-                       "486", "arat=on,avx512vbmi=on,xsaveopt=on",
-                       "pc-i440fx-2.7", "level", 1);
-        add_cpuid_test("x86/cpuid/auto-xlevel/pc-2.7",
-                       "486", "3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
-                       "pc-i440fx-2.7", "xlevel", 0);
-        add_cpuid_test("x86/cpuid/auto-xlevel2/pc-2.7",
-                       "486", "xstore=on", "pc-i440fx-2.7",
-                       "xlevel2", 0);
-    }

---

Reviewed-by
#24 lore raw

Re: [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines

Quoted 59 lines · Philippe Mathieu-Daudé
Quoted 38 lines · Philippe Mathieu-Daudé

These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.

---
  hw/i386/pc_piix.c |  9 ---------
  hw/i386/pc_q35.c  | 10 ----------

  2 files changed, 19 deletions(-)
hw/i386/pc_piix.c +0 -9
index 98a118fd4a0..98bd8d0e67b 100644
@@ -755,15 +755,6 @@ static void 
 pc_i440fx_machine_2_8_options(MachineClass *m)
   DEFINE_I440FX_MACHINE(2, 8);
-static void pc_i440fx_machine_2_7_options(MachineClass *m)
-{
-    pc_i440fx_machine_2_8_options(m);
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_I440FX_MACHINE(2, 7);
-
   #ifdef CONFIG_ISAPC
   static void isapc_machine_options(MachineClass *m)
   {
hw/i386/pc_q35.c +0 -0
index b7ffb5f1216..a1f46cd8f03 100644
@@ -648,13 +648,3 @@ static void pc_q35_machine_2_8_options(MachineClass *m)
   }
   DEFINE_Q35_MACHINE(2, 8);

hw/i386/pc_q35.c static void pc_q35_machine_2_8_options(MachineClass *m) · line 659

Quoted 10 lines
hw/i386/pc_q35.c +0 -10
-
-static void pc_q35_machine_2_7_options(MachineClass *m)
-{
-    pc_q35_machine_2_8_options(m);
-    m->max_cpus = 255;
-    compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len);
-    compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len);
-}
-
-DEFINE_Q35_MACHINE(2, 7);

As noticed Thomas for 2.4, here I missed to squash:

-- >8 --

tests/qtest/test-x86-cpuid-compat.c +0 -1
index 456e2af6657..5e0547e81b7 100644
@@ -348,11 +347,0 @@ int main(int argc, char **argv)
-    if (qtest_has_machine("pc-i440fx-2.7")) {

tests/qtest/test-x86-cpuid-compat.c int main(int argc, char **argv) · line 358

Quoted 10 lines
tests/qtest/test-x86-cpuid-compat.c +0 -10
-        add_cpuid_test("x86/cpuid/auto-level/pc-2.7",
-                       "486", "arat=on,avx512vbmi=on,xsaveopt=on",
-                       "pc-i440fx-2.7", "level", 1);
-        add_cpuid_test("x86/cpuid/auto-xlevel/pc-2.7",
-                       "486", "3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
-                       "pc-i440fx-2.7", "xlevel", 0);
-        add_cpuid_test("x86/cpuid/auto-xlevel2/pc-2.7",
-                       "486", "xstore=on", "pc-i440fx-2.7",
-                       "xlevel2", 0);
-    }

With that hunk added:

#25 lore raw

PATCH v3 12/19 hw/i386/pc: Remove pc_compat_2_7[] array

In reply to Philippe Mathieu-Daudé

The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
 include/hw/i386/pc.h |  3 ---
 hw/i386/pc.c         | 10 ----------
 2 files changed, 13 deletions(-)
include/hw/i386/pc.h +0 -3
index 4fb2033bc54..319ec82f709 100644
@@ -289,9 +289,6 @@ extern const size_t pc_compat_2_9_len;
 extern GlobalProperty pc_compat_2_8[];
 extern const size_t pc_compat_2_8_len;
 
-extern GlobalProperty pc_compat_2_7[];
-extern const size_t pc_compat_2_7_len;
-
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                  const void *data) \
hw/i386/pc.c +0 -10
index 7573b880905..ee7095c89a8 100644
@@ -241,16 +241,6 @@ GlobalProperty pc_compat_2_8[] = {
 };
 const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8);
 
-GlobalProperty pc_compat_2_7[] = {
-    { TYPE_X86_CPU, "l3-cache", "off" },
-    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
-    { "isa-pcspk", "migrate", "off" },
-};
-const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);
-
 /*
  * @PC_FW_DATA:
  * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
Signature · 1 line
2.47.1
Reviewed-by on v3 12/19
#26 lore raw

Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array

Quoted 31 lines · Philippe Mathieu-Daudé

The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
  include/hw/i386/pc.h |  3 ---
  hw/i386/pc.c         | 10 ----------
  2 files changed, 13 deletions(-)
include/hw/i386/pc.h +0 -3
index 4fb2033bc54..319ec82f709 100644
@@ -289,9 +289,6 @@ extern const size_t pc_compat_2_9_len;
  extern GlobalProperty pc_compat_2_8[];
  extern const size_t pc_compat_2_8_len;
 
-extern GlobalProperty pc_compat_2_7[];
-extern const size_t pc_compat_2_7_len;
-
  #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
      static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                   const void *data) \
hw/i386/pc.c +0 -0
index 7573b880905..ee7095c89a8 100644
@@ -241,16 +241,6 @@ GlobalProperty pc_compat_2_8[] = {
  };
  const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8);

hw/i386/pc.c GlobalProperty pc_compat_2_8[] = { · line 252

Quoted 10 lines
hw/i386/pc.c +0 -9
 
-GlobalProperty pc_compat_2_7[] = {
-    { TYPE_X86_CPU, "l3-cache", "off" },
-    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
-    { "isa-pcspk", "migrate", "off" },
-};
-const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);

I'd really appreciate if you could provide clean-up patches for TYPE_X86_CPU, too. Otherwise I'm pretty sure we'll forget that there is some clean up possibility here.

Anyway, for this patch here:

#27 lore raw

Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array

Hi Thomas,

Quoted 34 lines · Thomas Huth
Quoted 33 lines · Philippe Mathieu-Daudé

The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
  include/hw/i386/pc.h |  3 ---
  hw/i386/pc.c         | 10 ----------

  2 files changed, 13 deletions(-)
include/hw/i386/pc.h +0 -3
index 4fb2033bc54..319ec82f709 100644
@@ -289,9 +289,6 @@ extern const size_t pc_compat_2_9_len;
   extern GlobalProperty pc_compat_2_8[];
   extern const size_t pc_compat_2_8_len;
-extern GlobalProperty pc_compat_2_7[];
-extern const size_t pc_compat_2_7_len;
-
   #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
       static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                    const void *data) \
hw/i386/pc.c +0 -3
index 7573b880905..ee7095c89a8 100644
@@ -241,16 +241,6 @@ GlobalProperty pc_compat_2_8[] = {
   };
   const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8);
-GlobalProperty pc_compat_2_7[] = {
-    { TYPE_X86_CPU, "l3-cache", "off" },
-    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
Quoted 8 lines

hw/i386/pc.c GlobalProperty pc_compat_2_8[] = { · line 252

Quoted 6 lines
hw/i386/pc.c +0 -6
-    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
-    { "isa-pcspk", "migrate", "off" },
-};
-const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);

I'd really appreciate if you could provide clean-up patches for TYPE_X86_CPU, too. Otherwise I'm pretty sure we'll forget that there is some clean up possibility here.

Well TBH it is too exhausting to keep rebasing these patches without feedback from maintainers. I'll respin a v4 with Zhao and your comments addressed but without touching the TYPE_X86_CPU properties. If maintainers prefer to remove dead code in one go -- something I certainly understand from a maintainer PoV -- I'll let someone else do it, taking over my series.

Quoted 2 lines

Anyway, for this patch here:

Thank you for your support with these series.

Regards,

Phil.

#28 lore raw

Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array

Quoted 46 lines · Philippe Mathieu-Daudé

Hi Thomas,

Quoted 34 lines · Thomas Huth
Quoted 33 lines · Philippe Mathieu-Daudé

The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
  include/hw/i386/pc.h |  3 ---
  hw/i386/pc.c         | 10 ----------

  2 files changed, 13 deletions(-)
include/hw/i386/pc.h +0 -3
index 4fb2033bc54..319ec82f709 100644
@@ -289,9 +289,6 @@ extern const size_t pc_compat_2_9_len;
   extern GlobalProperty pc_compat_2_8[];
   extern const size_t pc_compat_2_8_len;
-extern GlobalProperty pc_compat_2_7[];
-extern const size_t pc_compat_2_7_len;
-
   #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
       static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                    const void *data) \
hw/i386/pc.c +0 -3
index 7573b880905..ee7095c89a8 100644
@@ -241,16 +241,6 @@ GlobalProperty pc_compat_2_8[] = {
   };
   const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8);
-GlobalProperty pc_compat_2_7[] = {
-    { TYPE_X86_CPU, "l3-cache", "off" },
-    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
Quoted 8 lines

hw/i386/pc.c GlobalProperty pc_compat_2_8[] = { · line 252

Quoted 6 lines
hw/i386/pc.c +0 -6
-    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
-    { "isa-pcspk", "migrate", "off" },
-};
-const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);

I'd really appreciate if you could provide clean-up patches for TYPE_X86_CPU, too. Otherwise I'm pretty sure we'll forget that there is some clean up possibility here.

Quoted 2 lines

Well TBH it is too exhausting to keep rebasing these patches without feedback from maintainers.

Ok, fair, if it's too much right now, it can of course also be done by someone else later.

Quoted 5 lines

I'll respin a v4 with Zhao and your comments
addressed but without touching the TYPE_X86_CPU properties. If maintainers prefer to remove dead code in one go -- something I certainly understand from a maintainer PoV -- I'll let someone else do it, taking over my series.

Since the x86 maintainers seem to be busy with other stuff right now ... I'm currently preparing a machine type cleanup pull request that contains Daniels patches to automatically disable the old machine types, and my own patches to remove the old s390x machine types. If nobody objects, I could also add your patches (at least the reviewed ones) there. Michael? Paolo?

Thomas

#29 lore raw

Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array

In reply to Philippe Mathieu-Daudé
Quoted 52 lines · Philippe Mathieu-Daudé

Date: Thu, 8 May 2025 12:40:35 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array

Hi Thomas,

Quoted 36 lines · Thomas Huth
Quoted 35 lines · Philippe Mathieu-Daudé

The pc_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
  include/hw/i386/pc.h |  3 ---
  hw/i386/pc.c         | 10 ----------

  2 files changed, 13 deletions(-)
include/hw/i386/pc.h +0 -3
index 4fb2033bc54..319ec82f709 100644
@@ -289,9 +289,6 @@ extern const size_t pc_compat_2_9_len;
   extern GlobalProperty pc_compat_2_8[];
   extern const size_t pc_compat_2_8_len;
-extern GlobalProperty pc_compat_2_7[];
-extern const size_t pc_compat_2_7_len;
-
   #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
       static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
                                                    const void *data) \
hw/i386/pc.c +0 -5
index 7573b880905..ee7095c89a8 100644
@@ -241,16 +241,6 @@ GlobalProperty pc_compat_2_8[] = {
   };
   const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8);
-GlobalProperty pc_compat_2_7[] = {
-    { TYPE_X86_CPU, "l3-cache", "off" },
-    { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
-    { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
Quoted 8 lines

hw/i386/pc.c GlobalProperty pc_compat_2_8[] = { · line 252

Quoted 4 lines
hw/i386/pc.c +0 -4
-    { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
-    { "isa-pcspk", "migrate", "off" },
-};
-const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7);

I'd really appreciate if you could provide clean-up patches for TYPE_X86_CPU, too. Otherwise I'm pretty sure we'll forget that there is some clean up possibility here.

Quoted 6 lines

Well TBH it is too exhausting to keep rebasing these patches without feedback from maintainers. I'll respin a v4 with Zhao and your comments addressed but without touching the TYPE_X86_CPU properties. If maintainers prefer to remove dead code in one go -- something I certainly understand from a maintainer PoV -- I'll let someone else do it, taking over my series.

Hi Philippe, I think I could volunteer help you to revisit the history of these properties (they're also too old for me :-)), and help identify if these properties should be removed or at least list the potential issues. Hopefully I can do this.

Thanks,
Zhao

#30 lore raw

PATCH v3 13/19 hw/audio/pcspk: Remove PCSpkState::migrate field

In reply to Philippe Mathieu-Daudé

The PCSpkState::migrate boolean was only set in the pc_compat_2_7[] array, via the 'migrate=off' property. We removed all machines using that array, lets remove that property, simplifying vmstate_spk[].

---
 hw/audio/pcspk.c | 10 ----------
 1 file changed, 10 deletions(-)
hw/audio/pcspk.c +0 -10
index a419161b5b1..0e83ba0bf73 100644
@@ -56,7 +56,6 @@ struct PCSpkState {
     unsigned int play_pos;
     uint8_t data_on;
     uint8_t dummy_refresh_clock;
-    bool migrate;
 };
 
 static const char *s_spk = "pcspk";
@@ -196,18 +195,10 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp)
     pcspk_state = s;
 }
 
-static bool migrate_needed(void *opaque)
-{
-    PCSpkState *s = opaque;
-
-    return s->migrate;
-}
-
 static const VMStateDescription vmstate_spk = {
     .name = "pcspk",
     .version_id = 1,
     .minimum_version_id = 1,
-    .needed = migrate_needed,
     .fields = (const VMStateField[]) {
         VMSTATE_UINT8(data_on, PCSpkState),
         VMSTATE_UINT8(dummy_refresh_clock, PCSpkState),
@@ -218,7 +209,6 @@ static const VMStateDescription vmstate_spk = {
 static const Property pcspk_properties[] = {
     DEFINE_AUDIO_PROPERTIES(PCSpkState, card),
     DEFINE_PROP_UINT32("iobase", PCSpkState, iobase,  0x61),
-    DEFINE_PROP_BOOL("migrate", PCSpkState, migrate,  true),
 };
 
 static void pcspk_class_initfn(ObjectClass *klass, const void *data)
Signature · 1 line
2.47.1
Reviewed-by on v3 13/19
#31 lore raw

Re: [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field

Quoted 10 lines · Philippe Mathieu-Daudé

The PCSpkState::migrate boolean was only set in the pc_compat_2_7[] array, via the 'migrate=off' property. We removed all machines using that array, lets remove that property, simplifying vmstate_spk[].

---
  hw/audio/pcspk.c | 10 ----------
  1 file changed, 10 deletions(-)
#32 lore raw

PATCH v3 14/19 hw/core/machine: Remove hw_compat_2_7[] array

In reply to Philippe Mathieu-Daudé

The hw_compat_2_7[] array was only used by the pc-q35-2.7 and pc-i440fx-2.7 machines, which got removed. Remove it.

---
 include/hw/boards.h | 3 ---
 hw/core/machine.c   | 9 ---------
 2 files changed, 12 deletions(-)
include/hw/boards.h +0 -3
index a881db8e7d6..77707c4376a 100644
@@ -838,7 +838,4 @@ extern const size_t hw_compat_2_9_len;
 extern GlobalProperty hw_compat_2_8[];
 extern const size_t hw_compat_2_8_len;
 
-extern GlobalProperty hw_compat_2_7[];
-extern const size_t hw_compat_2_7_len;
-
 #endif
hw/core/machine.c +0 -9
index ce98820f277..bde19a2ff67 100644
@@ -266,15 +266,6 @@ GlobalProperty hw_compat_2_8[] = {
 };
 const size_t hw_compat_2_8_len = G_N_ELEMENTS(hw_compat_2_8);
 
-GlobalProperty hw_compat_2_7[] = {
-    { "virtio-pci", "page-per-vq", "on" },
-    { "virtio-serial-device", "emergency-write", "off" },
-    { "ioapic", "version", "0x11" },
-    { "intel-iommu", "x-buggy-eim", "true" },
-    { "virtio-pci", "x-ignore-backend-features", "on" },
-};
-const size_t hw_compat_2_7_len = G_N_ELEMENTS(hw_compat_2_7);
-
 MachineState *current_machine;
 
 static char *machine_get_kernel(Object *obj, Error **errp)
Signature · 1 line
2.47.1
#33 lore raw

PATCH v3 15/19 hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field

In reply to Philippe Mathieu-Daudé

The IntelIOMMUState::buggy_eim boolean was only set in the hw_compat_2_7[] array, via the 'x-buggy-eim=true' property. We removed all machines using that array, lets remove that property, simplifying vtd_decide_config().

---
 include/hw/i386/intel_iommu.h | 1 -
 hw/i386/intel_iommu.c         | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/i386/intel_iommu.h +0 -1
index e95477e8554..29304329d05 100644
@@ -303,7 +303,6 @@ struct IntelIOMMUState {
     uint32_t intr_size;             /* Number of IR table entries */
     bool intr_eime;                 /* Extended interrupt mode enabled */
     OnOffAuto intr_eim;             /* Toggle for EIM cabability */
-    bool buggy_eim;                 /* Force buggy EIM unless eim=off */
     uint8_t aw_bits;                /* Host/IOVA address width (in bits) */
     bool dma_drain;                 /* Whether DMA r/w draining enabled */
     bool dma_translation;           /* Whether DMA translation supported */
hw/i386/intel_iommu.c +2 -3
index 5f8ed1243d1..c980cecb4ee 100644
@@ -3823,7 +3823,6 @@ static const Property vtd_properties[] = {
     DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),
     DEFINE_PROP_ON_OFF_AUTO("eim", IntelIOMMUState, intr_eim,
                             ON_OFF_AUTO_AUTO),
-    DEFINE_PROP_BOOL("x-buggy-eim", IntelIOMMUState, buggy_eim, false),
     DEFINE_PROP_UINT8("aw-bits", IntelIOMMUState, aw_bits,
                       VTD_HOST_ADDRESS_WIDTH),
     DEFINE_PROP_BOOL("caching-mode", IntelIOMMUState, caching_mode, FALSE),
@@ -4731,11 +4730,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
     }
 
     if (s->intr_eim == ON_OFF_AUTO_AUTO) {
-        s->intr_eim = (kvm_irqchip_in_kernel() || s->buggy_eim)
+        s->intr_eim = kvm_irqchip_in_kernel()
                       && x86_iommu_ir_supported(x86_iommu) ?
                                               ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;
     }
-    if (s->intr_eim == ON_OFF_AUTO_ON && !s->buggy_eim) {
+    if (s->intr_eim == ON_OFF_AUTO_ON) {
         if (kvm_irqchip_is_split() && !kvm_enable_x2apic()) {
             error_setg(errp, "eim=on requires support on the KVM side"
                              "(X2APIC_API, first shipped in v4.7)");
Signature · 1 line
2.47.1
#34 lore raw

PATCH v3 16/19 hw/intc/ioapic: Remove IOAPICCommonState::version field

In reply to Philippe Mathieu-Daudé

The IOAPICCommonState::version integer was only set in the hw_compat_2_7[] array, via the 'version=0x11' property. We removed all machines using that array, lets remove that property, simplify by only using the default version (defined as IOAPIC_VER_DEF).

For the record, this field was introduced in commit 20fd4b7b6d9 ("x86: ioapic: add support for explicit EOI"):

Quoted 14 lines

Some old Linux kernels (upstream before v4.0), or any released RHEL kernels has problem in sending APIC EOI when IR is enabled. Meanwhile, many of them only support explicit EOI for IOAPIC, which is only introduced in IOAPIC version 0x20. This patch provide a way to boost QEMU IOAPIC to version 0x20, in order for QEMU to correctly receive EOI messages.

Without boosting IOAPIC version to 0x20, kernels before commit d32932d ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces") will have trouble enabling both IR and level-triggered interrupt devices (like e1000).

To upgrade IOAPIC to version 0x20, we need to specify:

Quoted 8 lines
    -global ioapic.version=0x20

To be compatible with old systems, 0x11 will still be the default IOAPIC version. Here 0x11 and 0x20 are the only versions to be supported.

One thing to mention: this patch only applies to emulated IOAPIC. It does not affect kernel IOAPIC behavior.

---
 hw/intc/ioapic_internal.h |  3 +--
 hw/intc/ioapic.c          | 18 ++----------------
 hw/intc/ioapic_common.c   |  2 +-
 3 files changed, 4 insertions(+), 19 deletions(-)
hw/intc/ioapic_internal.h +1 -2
index 51205767f44..330ce195222 100644
@@ -82,7 +82,7 @@
 #define IOAPIC_ID_MASK                  0xf
 
 #define IOAPIC_VER_ENTRIES_SHIFT        16
-
+#define IOAPIC_VER_DEF                  0x20
 
 #define TYPE_IOAPIC_COMMON "ioapic-common"
 OBJECT_DECLARE_TYPE(IOAPICCommonState, IOAPICCommonClass, IOAPIC_COMMON)
@@ -104,7 +104,6 @@ struct IOAPICCommonState {
     uint32_t irr;
     uint64_t ioredtbl[IOAPIC_NUM_PINS];
     Notifier machine_done;
-    uint8_t version;
     uint64_t irq_count[IOAPIC_NUM_PINS];
     int irq_level[IOAPIC_NUM_PINS];
     int irq_eoi[IOAPIC_NUM_PINS];
hw/intc/ioapic.c +2 -16
index 133bef852d1..5cc97767d9d 100644
@@ -315,7 +315,7 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
             val = s->id << IOAPIC_ID_SHIFT;
             break;
         case IOAPIC_REG_VER:
-            val = s->version |
+            val = IOAPIC_VER_DEF |
                 ((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT);
             break;
         default:
@@ -411,8 +411,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
         }
         break;
     case IOAPIC_EOI:
-        /* Explicit EOI is only supported for IOAPIC version 0x20 */
-        if (size != 4 || s->version != 0x20) {
+        if (size != 4) {
             break;
         }
         ioapic_eoi_broadcast(val);
@@ -444,18 +443,10 @@ static void ioapic_machine_done_notify(Notifier *notifier, void *data)
 #endif
 }
 
-#define IOAPIC_VER_DEF 0x20
-
 static void ioapic_realize(DeviceState *dev, Error **errp)
 {
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
 
-    if (s->version != 0x11 && s->version != 0x20) {
-        error_setg(errp, "IOAPIC only supports version 0x11 or 0x20 "
-                   "(default: 0x%x).", IOAPIC_VER_DEF);
-        return;
-    }
-
     memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s,
                           "ioapic", 0x1000);
 
@@ -476,10 +467,6 @@ static void ioapic_unrealize(DeviceState *dev)
     timer_free(s->delayed_ioapic_service_timer);
 }
 
-static const Property ioapic_properties[] = {
-    DEFINE_PROP_UINT8("version", IOAPICCommonState, version, IOAPIC_VER_DEF),
-};
-
 static void ioapic_class_init(ObjectClass *klass, const void *data)
 {
     IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
@@ -493,7 +480,6 @@ static void ioapic_class_init(ObjectClass *klass, const void *data)
      */
     k->post_load = ioapic_update_kvm_routes;
     device_class_set_legacy_reset(dc, ioapic_reset_common);
-    device_class_set_props(dc, ioapic_properties);
 }
 
 static const TypeInfo ioapic_info = {
hw/intc/ioapic_common.c +1 -1
index fce3486e519..8b3e2ba9384 100644
@@ -83,7 +83,7 @@ static void ioapic_print_redtbl(GString *buf, IOAPICCommonState *s)
     int i;
 
     g_string_append_printf(buf, "ioapic0: ver=0x%x id=0x%02x sel=0x%02x",
-                           s->version, s->id, s->ioregsel);
+                           IOAPIC_VER_DEF, s->id, s->ioregsel);
     if (s->ioregsel) {
         g_string_append_printf(buf, " (redir[%u])\n",
                                (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1);
Signature · 1 line
2.47.1
#35 lore raw

PATCH v3 17/19 hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field

In reply to Philippe Mathieu-Daudé

The VirtIOPCIProxy::ignore_backend_features boolean was only set in the hw_compat_2_7[] array, via the 'x-ignore-backend-features=on' property. We removed all machines using that array, lets remove that property, simplify by only using the default version.

---
 include/hw/virtio/virtio-pci.h | 1 -
 hw/virtio/virtio-pci.c         | 5 +----
 2 files changed, 1 insertion(+), 5 deletions(-)
include/hw/virtio/virtio-pci.h +0 -1
index f962c9116c1..9838e8650a6 100644
@@ -149,7 +149,6 @@ struct VirtIOPCIProxy {
     int config_cap;
     uint32_t flags;
     bool disable_modern;
-    bool ignore_backend_features;
     OnOffAuto disable_legacy;
     /* Transitional device id */
     uint16_t trans_devid;
hw/virtio/virtio-pci.c +1 -4
index 8d68e56641a..7c965771907 100644
@@ -1965,8 +1965,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
      * Virtio capabilities present without
      * VIRTIO_F_VERSION_1 confuses guests
      */
-    if (!proxy->ignore_backend_features &&
-            !virtio_has_feature(vdev->host_features, VIRTIO_F_VERSION_1)) {
+    if (!virtio_has_feature(vdev->host_features, VIRTIO_F_VERSION_1)) {
         virtio_pci_disable_modern(proxy);
 
         if (!legacy) {
@@ -2351,8 +2350,6 @@ static const Property virtio_pci_properties[] = {
                     VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT, false),
     DEFINE_PROP_BIT("page-per-vq", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT, false),
-    DEFINE_PROP_BOOL("x-ignore-backend-features", VirtIOPCIProxy,
-                     ignore_backend_features, false),
     DEFINE_PROP_BIT("ats", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_ATS_BIT, false),
     DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
Signature · 1 line
2.47.1
#36 lore raw

PATCH v3 18/19 hw/char/virtio-serial: Do not expose the 'emergency-write' property

In reply to Philippe Mathieu-Daudé

The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=off' property. We removed all machines using that array, lets remove that property. All instances have this feature bit set and it can not be disabled. VirtIOSerial::host_features mask is now unused, remove it.

---
 include/hw/virtio/virtio-serial.h | 2 --
 hw/char/virtio-serial-bus.c       | 9 +++------
 2 files changed, 3 insertions(+), 8 deletions(-)
include/hw/virtio/virtio-serial.h +0 -2
index d87c62eab7a..e6ceacec309 100644
@@ -185,8 +185,6 @@ struct VirtIOSerial {
     struct VirtIOSerialPostLoad *post_load;
 
     virtio_serial_conf serial;
-
-    uint64_t host_features;
 };
 
 /* Interface to the virtio-serial bus */
hw/char/virtio-serial-bus.c +3 -6
index eb79f5258b6..cfc8fa42186 100644
@@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t features,
 
     vser = VIRTIO_SERIAL(vdev);
 
-    features |= vser->host_features;
+    features |= BIT_ULL(VIRTIO_CONSOLE_F_EMERG_WRITE);
     if (vser->bus.max_nr_ports > 1) {
         virtio_add_feature(&features, VIRTIO_CONSOLE_F_MULTIPORT);
     }
@@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_t *config_data)
     VirtIOSerialPortClass *vsc;
     uint8_t emerg_wr_lo;
 
-    if (!virtio_has_feature(vser->host_features,
-        VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) {
+    if (!config->emerg_wr) {
         return;
     }
 
@@ -1039,7 +1038,7 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (!virtio_has_feature(vser->host_features,
+    if (!virtio_has_feature(vdev->host_features,
                             VIRTIO_CONSOLE_F_EMERG_WRITE)) {
         config_size = offsetof(struct virtio_console_config, emerg_wr);
     }
@@ -1155,8 +1154,6 @@ static const VMStateDescription vmstate_virtio_console = {
 static const Property virtio_serial_properties[] = {
     DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_ports,
                                                   31),
-    DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features,
-                      VIRTIO_CONSOLE_F_EMERG_WRITE, true),
 };
 
 static void virtio_serial_class_init(ObjectClass *klass, const void *data)
Signature · 1 line
2.47.1
#37 lore raw

PATCH v3 19/19 hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition

In reply to Philippe Mathieu-Daudé

VIRTIO_PCI_FLAG_PAGE_PER_VQ was only used by the hw_compat_2_7[] array, via the 'page-per-vq=on' property. We removed all machines using that array, lets remove all the code around VIRTIO_PCI_FLAG_PAGE_PER_VQ (see commit 9a4c0e220d8 for similar VIRTIO_PCI_FLAG_* enum removal).

---
 include/hw/virtio/virtio-pci.h |  1 -
 hw/display/virtio-vga.c        | 10 ----------
 hw/virtio/virtio-pci.c         |  7 +------
 3 files changed, 1 insertion(+), 17 deletions(-)
include/hw/virtio/virtio-pci.h +0 -1
index 9838e8650a6..8abc5f8f20d 100644
@@ -33,7 +33,6 @@ enum {
     VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT,
     VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT,
     VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT,
-    VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT,
     VIRTIO_PCI_FLAG_ATS_BIT,
     VIRTIO_PCI_FLAG_INIT_DEVERR_BIT,
     VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT,
hw/display/virtio-vga.c +0 -10
index 40e60f70fcd..83d01f089b5 100644
@@ -141,16 +141,6 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
                                VIRTIO_GPU_SHM_ID_HOST_VISIBLE);
     }
 
-    if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) {
-        /*
-         * with page-per-vq=off there is no padding space we can use
-         * for the stdvga registers.  Make the common and isr regions
-         * smaller then.
-         */
-        vpci_dev->common.size /= 2;
-        vpci_dev->isr.size /= 2;
-    }
-
     offset = memory_region_size(&vpci_dev->modern_bar);
     offset -= vpci_dev->notify.size;
     vpci_dev->notify.offset = offset;
hw/virtio/virtio-pci.c +1 -6
index 7c965771907..4e0d4bda6ed 100644
@@ -314,12 +314,9 @@ static bool virtio_pci_ioeventfd_enabled(DeviceState *d)
     return (proxy->flags & VIRTIO_PCI_FLAG_USE_IOEVENTFD) != 0;
 }
 
-#define QEMU_VIRTIO_PCI_QUEUE_MEM_MULT 0x1000
-
 static inline int virtio_pci_queue_mem_mult(struct VirtIOPCIProxy *proxy)
 {
-    return (proxy->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ) ?
-        QEMU_VIRTIO_PCI_QUEUE_MEM_MULT : 4;
+    return 4;
 }
 
 static int virtio_pci_ioeventfd_assign(DeviceState *d, EventNotifier *notifier,
@@ -2348,8 +2345,6 @@ static const Property virtio_pci_properties[] = {
                     VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, false),
     DEFINE_PROP_BIT("modern-pio-notify", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT, false),
-    DEFINE_PROP_BIT("page-per-vq", VirtIOPCIProxy, flags,
-                    VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT, false),
     DEFINE_PROP_BIT("ats", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_ATS_BIT, false),
     DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
Signature · 1 line
2.47.1