qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
@ 2025-05-02 18:56 Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
                   ` (18 more replies)
  0 siblings, 19 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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: <20250429140825.25964-1-philmd@linaro.org>

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(-)

-- 
2.47.1



^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:10   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/i386/pc_piix.c | 14 --------------
 hw/i386/pc_q35.c  | 14 --------------
 2 files changed, 28 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 7a62bb06500..98a118fd4a0 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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)
 {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 33211b1876f..b7ffb5f1216 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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);
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:23   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem() Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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"):

 >  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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 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(-)

diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
index 3b932abbbbe..aeee630cf05 100644
--- a/include/hw/acpi/cpu_hotplug.h
+++ b/include/hw/acpi/cpu_hotplug.h
@@ -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
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 79b72c54dd3..a3de3e9560d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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;
 
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index aa0e1e3efa5..fe439705bda 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -116,233 +116,3 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu,
     memory_region_del_subregion(parent, &gpe_cpu->io);
     cpu_hotplug_hw_init(parent, gpe_cpu->device, cpuhp_state, io_port);
 }
-
-void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine,
-                                  uint16_t io_base)
-{
-    Aml *dev;
-    Aml *crs;
-    Aml *pkg;
-    Aml *field;
-    Aml *method;
-    Aml *if_ctx;
-    Aml *else_ctx;
-    int i, apic_idx;
-    Aml *sb_scope = aml_scope("_SB");
-    uint8_t madt_tmpl[8] = {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0};
-    Aml *cpu_id = aml_arg(1);
-    Aml *apic_id = aml_arg(0);
-    Aml *cpu_on = aml_local(0);
-    Aml *madt = aml_local(1);
-    Aml *cpus_map = aml_name(CPU_ON_BITMAP);
-    Aml *zero = aml_int(0);
-    Aml *one = aml_int(1);
-    MachineClass *mc = MACHINE_GET_CLASS(machine);
-    const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(machine);
-    X86MachineState *x86ms = X86_MACHINE(machine);
-
-    /*
-     * _MAT method - creates an madt apic buffer
-     * apic_id = Arg0 = Local APIC ID
-     * cpu_id  = Arg1 = Processor ID
-     * cpu_on = Local0 = CPON flag for this cpu
-     * madt = Local1 = Buffer (in madt apic form) to return
-     */
-    method = aml_method(CPU_MAT_METHOD, 2, AML_NOTSERIALIZED);
-    aml_append(method,
-        aml_store(aml_derefof(aml_index(cpus_map, apic_id)), cpu_on));
-    aml_append(method,
-        aml_store(aml_buffer(sizeof(madt_tmpl), madt_tmpl), madt));
-    /* Update the processor id, lapic id, and enable/disable status */
-    aml_append(method, aml_store(cpu_id, aml_index(madt, aml_int(2))));
-    aml_append(method, aml_store(apic_id, aml_index(madt, aml_int(3))));
-    aml_append(method, aml_store(cpu_on, aml_index(madt, aml_int(4))));
-    aml_append(method, aml_return(madt));
-    aml_append(sb_scope, method);
-
-    /*
-     * _STA method - return ON status of cpu
-     * apic_id = Arg0 = Local APIC ID
-     * cpu_on = Local0 = CPON flag for this cpu
-     */
-    method = aml_method(CPU_STATUS_METHOD, 1, AML_NOTSERIALIZED);
-    aml_append(method,
-        aml_store(aml_derefof(aml_index(cpus_map, apic_id)), cpu_on));
-    if_ctx = aml_if(cpu_on);
-    {
-        aml_append(if_ctx, aml_return(aml_int(0xF)));
-    }
-    aml_append(method, if_ctx);
-    else_ctx = aml_else();
-    {
-        aml_append(else_ctx, aml_return(zero));
-    }
-    aml_append(method, else_ctx);
-    aml_append(sb_scope, method);
-
-    method = aml_method(CPU_EJECT_METHOD, 2, AML_NOTSERIALIZED);
-    aml_append(method, aml_sleep(200));
-    aml_append(sb_scope, method);
-
-    method = aml_method(CPU_SCAN_METHOD, 0, AML_NOTSERIALIZED);
-    {
-        Aml *while_ctx, *if_ctx2, *else_ctx2;
-        Aml *bus_check_evt = aml_int(1);
-        Aml *remove_evt = aml_int(3);
-        Aml *status_map = aml_local(5); /* Local5 = active cpu bitmap */
-        Aml *byte = aml_local(2); /* Local2 = last read byte from bitmap */
-        Aml *idx = aml_local(0); /* Processor ID / APIC ID iterator */
-        Aml *is_cpu_on = aml_local(1); /* Local1 = CPON flag for cpu */
-        Aml *status = aml_local(3); /* Local3 = active state for cpu */
-
-        aml_append(method, aml_store(aml_name(CPU_STATUS_MAP), status_map));
-        aml_append(method, aml_store(zero, byte));
-        aml_append(method, aml_store(zero, idx));
-
-        /* While (idx < SizeOf(CPON)) */
-        while_ctx = aml_while(aml_lless(idx, aml_sizeof(cpus_map)));
-        aml_append(while_ctx,
-            aml_store(aml_derefof(aml_index(cpus_map, idx)), is_cpu_on));
-
-        if_ctx = aml_if(aml_and(idx, aml_int(0x07), NULL));
-        {
-            /* Shift down previously read bitmap byte */
-            aml_append(if_ctx, aml_shiftright(byte, one, byte));
-        }
-        aml_append(while_ctx, if_ctx);
-
-        else_ctx = aml_else();
-        {
-            /* Read next byte from cpu bitmap */
-            aml_append(else_ctx, aml_store(aml_derefof(aml_index(status_map,
-                       aml_shiftright(idx, aml_int(3), NULL))), byte));
-        }
-        aml_append(while_ctx, else_ctx);
-
-        aml_append(while_ctx, aml_store(aml_and(byte, one, NULL), status));
-        if_ctx = aml_if(aml_lnot(aml_equal(is_cpu_on, status)));
-        {
-            /* State change - update CPON with new state */
-            aml_append(if_ctx, aml_store(status, aml_index(cpus_map, idx)));
-            if_ctx2 = aml_if(aml_equal(status, one));
-            {
-                aml_append(if_ctx2,
-                    aml_call2(AML_NOTIFY_METHOD, idx, bus_check_evt));
-            }
-            aml_append(if_ctx, if_ctx2);
-            else_ctx2 = aml_else();
-            {
-                aml_append(else_ctx2,
-                    aml_call2(AML_NOTIFY_METHOD, idx, remove_evt));
-            }
-        }
-        aml_append(if_ctx, else_ctx2);
-        aml_append(while_ctx, if_ctx);
-
-        aml_append(while_ctx, aml_increment(idx)); /* go to next cpu */
-        aml_append(method, while_ctx);
-    }
-    aml_append(sb_scope, method);
-
-    /* The current AML generator can cover the APIC ID range [0..255],
-     * inclusive, for VCPU hotplug. */
-    QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256);
-    if (x86ms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) {
-        error_report("max_cpus is too large. APIC ID of last CPU is %u",
-                     x86ms->apic_id_limit - 1);
-        exit(1);
-    }
-
-    /* create PCI0.PRES device and its _CRS to reserve CPU hotplug MMIO */
-    dev = aml_device("PCI0." stringify(CPU_HOTPLUG_RESOURCE_DEVICE));
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A06")));
-    aml_append(dev,
-        aml_name_decl("_UID", aml_string("CPU Hotplug resources"))
-    );
-    /* device present, functioning, decoding, not shown in UI */
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
-    crs = aml_resource_template();
-    aml_append(crs,
-        aml_io(AML_DECODE16, io_base, io_base, 1, ACPI_GPE_PROC_LEN)
-    );
-    aml_append(dev, aml_name_decl("_CRS", crs));
-    aml_append(sb_scope, dev);
-    /* declare CPU hotplug MMIO region and PRS field to access it */
-    aml_append(sb_scope, aml_operation_region(
-        "PRST", AML_SYSTEM_IO, aml_int(io_base), ACPI_GPE_PROC_LEN));
-    field = aml_field("PRST", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
-    aml_append(field, aml_named_field("PRS", 256));
-    aml_append(sb_scope, field);
-
-    /* build Processor object for each processor */
-    for (i = 0; i < apic_ids->len; i++) {
-        int cpu_apic_id = apic_ids->cpus[i].arch_id;
-
-        assert(cpu_apic_id < ACPI_CPU_HOTPLUG_ID_LIMIT);
-
-        dev = aml_processor(i, 0, 0, "CP%.02X", cpu_apic_id);
-
-        method = aml_method("_MAT", 0, AML_NOTSERIALIZED);
-        aml_append(method,
-            aml_return(aml_call2(CPU_MAT_METHOD,
-                                 aml_int(cpu_apic_id), aml_int(i))
-        ));
-        aml_append(dev, method);
-
-        method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-        aml_append(method,
-            aml_return(aml_call1(CPU_STATUS_METHOD, aml_int(cpu_apic_id))));
-        aml_append(dev, method);
-
-        method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
-        aml_append(method,
-            aml_return(aml_call2(CPU_EJECT_METHOD, aml_int(cpu_apic_id),
-                aml_arg(0)))
-        );
-        aml_append(dev, method);
-
-        aml_append(sb_scope, dev);
-    }
-
-    /* build this code:
-     *   Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...}
-     */
-    /* Arg0 = APIC ID */
-    method = aml_method(AML_NOTIFY_METHOD, 2, AML_NOTSERIALIZED);
-    for (i = 0; i < apic_ids->len; i++) {
-        int cpu_apic_id = apic_ids->cpus[i].arch_id;
-
-        if_ctx = aml_if(aml_equal(aml_arg(0), aml_int(cpu_apic_id)));
-        aml_append(if_ctx,
-            aml_notify(aml_name("CP%.02X", cpu_apic_id), aml_arg(1))
-        );
-        aml_append(method, if_ctx);
-    }
-    aml_append(sb_scope, method);
-
-    /* build "Name(CPON, Package() { One, One, ..., Zero, Zero, ... })"
-     *
-     * Note: The ability to create variable-sized packages was first
-     * introduced in ACPI 2.0. ACPI 1.0 only allowed fixed-size packages
-     * ith up to 255 elements. Windows guests up to win2k8 fail when
-     * VarPackageOp is used.
-     */
-    pkg = x86ms->apic_id_limit <= 255 ? aml_package(x86ms->apic_id_limit) :
-                                        aml_varpackage(x86ms->apic_id_limit);
-
-    for (i = 0, apic_idx = 0; i < apic_ids->len; i++) {
-        int cpu_apic_id = apic_ids->cpus[i].arch_id;
-
-        for (; apic_idx < cpu_apic_id; apic_idx++) {
-            aml_append(pkg, aml_int(0));
-        }
-        aml_append(pkg, aml_int(apic_ids->cpus[i].cpu ? 1 : 0));
-        apic_idx = cpu_apic_id + 1;
-    }
-    aml_append(sb_scope, aml_name_decl(CPU_ON_BITMAP, pkg));
-    aml_append(ctx, sb_scope);
-
-    method = aml_method("\\_GPE._E02", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_call0("\\_SB." CPU_SCAN_METHOD));
-    aml_append(ctx, method);
-}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 3fffa4a3328..625889783ec 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -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,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:31   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/mips/loongson3_virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index de6fbcc0cb4..41733988729 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -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);
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem() Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:36   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/nvram/fw_cfg.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 54cfa07d3f5..d119c10d308 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -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);
 }
 
 
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:41   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 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(-)

diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index fc460b82f82..29d37af11e6 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -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;
 };
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index e0daf0d4fc3..b1262fb1523 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -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,
diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 6e6b96bc345..bfa7e8f1e83 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -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++;
 
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index 1b0671c5239..27254a0e9f1 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -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++;
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index f80533df1c5..dbf104d60af 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -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",
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:46   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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);

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/nvram/fw_cfg.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index d119c10d308..c1bd229e8f3 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -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);
 }
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-07  6:47   ` Zhao Liu
  2025-05-02 18:56 ` [PATCH v3 08/19] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/i386/pc.h | 3 ---
 hw/i386/pc.c         | 8 --------
 2 files changed, 11 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index a3de3e9560d..4fb2033bc54 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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) \
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 49632b69d29..7573b880905 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 08/19] hw/intc/apic: Remove APICCommonState::legacy_instance_id field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/i386/apic_internal.h | 1 -
 hw/intc/apic_common.c           | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 429278da618..db6a9101530 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -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;
 };
 
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 37a7a7019d3..1d259b97e63 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -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,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 08/19] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-08  7:49   ` Thomas Huth
  2025-05-02 18:56 ` [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/boards.h | 3 ---
 hw/core/machine.c   | 8 --------
 2 files changed, 11 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 5f1a0fb7e28..a881db8e7d6 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -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
diff --git a/hw/core/machine.c b/hw/core/machine.c
index e7001bf92cd..ce98820f277 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -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)
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-08  7:51   ` Thomas Huth
  2025-05-02 18:56 ` [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/virtio/virtio-mmio.h |  1 -
 hw/virtio/virtio-mmio.c         | 15 ---------------
 2 files changed, 16 deletions(-)

diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmio.h
index aa492620228..8b19ec2291a 100644
--- a/include/hw/virtio/virtio-mmio.h
+++ b/include/hw/virtio/virtio-mmio.h
@@ -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];
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index 532c67107ba..b7ee115b990 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -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);
 
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-05  9:50   ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/i386/pc_piix.c |  9 ---------
 hw/i386/pc_q35.c  | 10 ----------
 2 files changed, 19 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 98a118fd4a0..98bd8d0e67b 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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)
 {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index b7ffb5f1216..a1f46cd8f03 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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);
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-08  7:55   ` Thomas Huth
  2025-05-02 18:56 ` [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/i386/pc.h |  3 ---
 hw/i386/pc.c         | 10 ----------
 2 files changed, 13 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4fb2033bc54..319ec82f709 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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) \
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 7573b880905..ee7095c89a8 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-08  7:57   ` Thomas Huth
  2025-05-02 18:56 ` [PATCH v3 14/19] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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[].

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/audio/pcspk.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index a419161b5b1..0e83ba0bf73 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -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)
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 14/19] hw/core/machine: Remove hw_compat_2_7[] array
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 15/19] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/boards.h | 3 ---
 hw/core/machine.c   | 9 ---------
 2 files changed, 12 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index a881db8e7d6..77707c4376a 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -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
diff --git a/hw/core/machine.c b/hw/core/machine.c
index ce98820f277..bde19a2ff67 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -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)
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 15/19] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 14/19] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 16/19] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/i386/intel_iommu.h | 1 -
 hw/i386/intel_iommu.c         | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index e95477e8554..29304329d05 100644
--- a/include/hw/i386/intel_iommu.h
+++ b/include/hw/i386/intel_iommu.h
@@ -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 */
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 5f8ed1243d1..c980cecb4ee 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -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)");
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 16/19] hw/intc/ioapic: Remove IOAPICCommonState::version field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 15/19] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 17/19] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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"):

 >   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:
 >
 >     -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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/intc/ioapic_internal.h |  3 +--
 hw/intc/ioapic.c          | 18 ++----------------
 hw/intc/ioapic_common.c   |  2 +-
 3 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/hw/intc/ioapic_internal.h b/hw/intc/ioapic_internal.h
index 51205767f44..330ce195222 100644
--- a/hw/intc/ioapic_internal.h
+++ b/hw/intc/ioapic_internal.h
@@ -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];
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 133bef852d1..5cc97767d9d 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -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 = {
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index fce3486e519..8b3e2ba9384 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -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);
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 17/19] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 16/19] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 18/19] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 19/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 include/hw/virtio/virtio-pci.h | 1 -
 hw/virtio/virtio-pci.c         | 5 +----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index f962c9116c1..9838e8650a6 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -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;
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 8d68e56641a..7c965771907 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -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,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 18/19] hw/char/virtio-serial: Do not expose the 'emergency-write' property
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 17/19] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  2025-05-02 18:56 ` [PATCH v3 19/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/virtio/virtio-serial.h | 2 --
 hw/char/virtio-serial-bus.c       | 9 +++------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h
index d87c62eab7a..e6ceacec309 100644
--- a/include/hw/virtio/virtio-serial.h
+++ b/include/hw/virtio/virtio-serial.h
@@ -185,8 +185,6 @@ struct VirtIOSerial {
     struct VirtIOSerialPostLoad *post_load;
 
     virtio_serial_conf serial;
-
-    uint64_t host_features;
 };
 
 /* Interface to the virtio-serial bus */
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index eb79f5258b6..cfc8fa42186 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -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)
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 19/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
  2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2025-05-02 18:56 ` [PATCH v3 18/19] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
@ 2025-05-02 18:56 ` Philippe Mathieu-Daudé
  18 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-02 18:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Zhao Liu, Marc-André Lureau,
	Yi Liu, Michael S. Tsirkin, Mark Cave-Ayland

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).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 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(-)

diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index 9838e8650a6..8abc5f8f20d 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -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,
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 40e60f70fcd..83d01f089b5 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -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;
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 7c965771907..4e0d4bda6ed 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -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,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-02 18:56 ` [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
@ 2025-05-05  9:50   ` Philippe Mathieu-Daudé
  2025-05-08  7:53     ` Thomas Huth
  0 siblings, 1 reply; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-05  9:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 2/5/25 20:56, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   hw/i386/pc_piix.c |  9 ---------
>   hw/i386/pc_q35.c  | 10 ----------
>   2 files changed, 19 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 98a118fd4a0..98bd8d0e67b 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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)
>   {
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index b7ffb5f1216..a1f46cd8f03 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -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);

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

-- >8 --
diff --git a/tests/qtest/test-x86-cpuid-compat.c 
b/tests/qtest/test-x86-cpuid-compat.c
index 456e2af6657..5e0547e81b7 100644
--- a/tests/qtest/test-x86-cpuid-compat.c
+++ b/tests/qtest/test-x86-cpuid-compat.c
@@ -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);
-    }

---


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-05-02 18:56 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
@ 2025-05-07  6:10   ` Zhao Liu
  0 siblings, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On Fri, May 02, 2025 at 08:56:33PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:33 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  hw/i386/pc_piix.c | 14 --------------
>  hw/i386/pc_q35.c  | 14 --------------
>  2 files changed, 28 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
  2025-05-02 18:56 ` [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
@ 2025-05-07  6:23   ` Zhao Liu
  2025-05-08 13:02     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 3fffa4a3328..625889783ec 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -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?

>          CPUHotplugFeatures opts = {
>              .acpi_1_compatible = true, .has_legacy_cphp = true,
>              .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,

Otherwise,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()
  2025-05-02 18:56 ` [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem() Philippe Mathieu-Daudé
@ 2025-05-07  6:31   ` Zhao Liu
  2025-05-07 11:59     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin

On Fri, May 02, 2025 at 08:56:35PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:35 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/mips/loongson3_virt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
> index de6fbcc0cb4..41733988729 100644
> --- a/hw/mips/loongson3_virt.c
> +++ b/hw/mips/loongson3_virt.c
> @@ -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?

>      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);
> -- 
> 2.47.1
> 


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-02 18:56 ` [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
@ 2025-05-07  6:36   ` Zhao Liu
  0 siblings, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin

On Fri, May 02, 2025 at 08:56:36PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:36 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/nvram/fw_cfg.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 54cfa07d3f5..d119c10d308 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -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)

How about mentioning DMA in the name? fw_cfg_init_mem_dma.

> +{
> +    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. :-)

>  {
> -    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);
>  }
>  
>  
> -- 
> 2.47.1
> 


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-02 18:56 ` [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
@ 2025-05-07  6:41   ` Zhao Liu
  0 siblings, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin

On Fri, May 02, 2025 at 08:56:37PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:37 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  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.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  2025-05-02 18:56 ` [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
@ 2025-05-07  6:46   ` Zhao Liu
  0 siblings, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin

On Fri, May 02, 2025 at 08:56:38PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:38 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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().
> 
> 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. :-)
 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/nvram/fw_cfg.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array
  2025-05-02 18:56 ` [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-07  6:47   ` Zhao Liu
  0 siblings, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-07  6:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On Fri, May 02, 2025 at 08:56:39PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri,  2 May 2025 20:56:39 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  include/hw/i386/pc.h | 3 ---
>  hw/i386/pc.c         | 8 --------
>  2 files changed, 11 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem()
  2025-05-07  6:31   ` Zhao Liu
@ 2025-05-07 11:59     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-07 11:59 UTC (permalink / raw)
  To: Zhao Liu
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin

On 7/5/25 08:31, Zhao Liu wrote:
> On Fri, May 02, 2025 at 08:56:35PM +0200, Philippe Mathieu-Daudé wrote:
>> Date: Fri,  2 May 2025 20:56:35 +0200
>> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>> 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().
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/mips/loongson3_virt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
>> index de6fbcc0cb4..41733988729 100644
>> --- a/hw/mips/loongson3_virt.c
>> +++ b/hw/mips/loongson3_virt.c
>> @@ -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?

Doh, I missed that, thanks :)



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array
  2025-05-02 18:56 ` [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-08  7:49   ` Thomas Huth
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Huth @ 2025-05-08  7:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   include/hw/boards.h | 3 ---
>   hw/core/machine.c   | 8 --------
>   2 files changed, 11 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field
  2025-05-02 18:56 ` [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
@ 2025-05-08  7:51   ` Thomas Huth
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Huth @ 2025-05-08  7:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
> 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().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   include/hw/virtio/virtio-mmio.h |  1 -
>   hw/virtio/virtio-mmio.c         | 15 ---------------
>   2 files changed, 16 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-05  9:50   ` Philippe Mathieu-Daudé
@ 2025-05-08  7:53     ` Thomas Huth
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Huth @ 2025-05-08  7:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 05/05/2025 11.50, Philippe Mathieu-Daudé wrote:
> On 2/5/25 20:56, Philippe Mathieu-Daudé wrote:
>> 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.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
>> ---
>>   hw/i386/pc_piix.c |  9 ---------
>>   hw/i386/pc_q35.c  | 10 ----------
>>   2 files changed, 19 deletions(-)
>>
>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
>> index 98a118fd4a0..98bd8d0e67b 100644
>> --- a/hw/i386/pc_piix.c
>> +++ b/hw/i386/pc_piix.c
>> @@ -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)
>>   {
>> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
>> index b7ffb5f1216..a1f46cd8f03 100644
>> --- a/hw/i386/pc_q35.c
>> +++ b/hw/i386/pc_q35.c
>> @@ -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);
> 
> As noticed Thomas for 2.4, here I missed to squash:
> 
> -- >8 --
> diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86- 
> cpuid-compat.c
> index 456e2af6657..5e0547e81b7 100644
> --- a/tests/qtest/test-x86-cpuid-compat.c
> +++ b/tests/qtest/test-x86-cpuid-compat.c
> @@ -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);
> -    }

With that hunk added:

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-02 18:56 ` [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-08  7:55   ` Thomas Huth
  2025-05-08 10:40     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 38+ messages in thread
From: Thomas Huth @ 2025-05-08  7:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   include/hw/i386/pc.h |  3 ---
>   hw/i386/pc.c         | 10 ----------
>   2 files changed, 13 deletions(-)
> 
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 4fb2033bc54..319ec82f709 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -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) \
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 7573b880905..ee7095c89a8 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -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);

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:
Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field
  2025-05-02 18:56 ` [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
@ 2025-05-08  7:57   ` Thomas Huth
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Huth @ 2025-05-08  7:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
> 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[].
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   hw/audio/pcspk.c | 10 ----------
>   1 file changed, 10 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-08  7:55   ` Thomas Huth
@ 2025-05-08 10:40     ` Philippe Mathieu-Daudé
  2025-05-08 11:41       ` Thomas Huth
  2025-05-08 12:09       ` Zhao Liu
  0 siblings, 2 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 10:40 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

Hi Thomas,

On 8/5/25 09:55, Thomas Huth wrote:
> On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
>> 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.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
>> ---
>>   include/hw/i386/pc.h |  3 ---
>>   hw/i386/pc.c         | 10 ----------
>>   2 files changed, 13 deletions(-)
>>
>> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
>> index 4fb2033bc54..319ec82f709 100644
>> --- a/include/hw/i386/pc.h
>> +++ b/include/hw/i386/pc.h
>> @@ -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) \
>> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>> index 7573b880905..ee7095c89a8 100644
>> --- a/hw/i386/pc.c
>> +++ b/hw/i386/pc.c
>> @@ -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);
> 
> 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.

> Anyway, for this patch here:
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Thank you for your support with these series.

Regards,

Phil.



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-08 10:40     ` Philippe Mathieu-Daudé
@ 2025-05-08 11:41       ` Thomas Huth
  2025-05-08 12:09       ` Zhao Liu
  1 sibling, 0 replies; 38+ messages in thread
From: Thomas Huth @ 2025-05-08 11:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel, Michael S. Tsirkin,
	Paolo Bonzini
  Cc: Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Eduardo Habkost,
	Jiaxun Yang, Jason Wang, Richard Henderson, Yanan Wang,
	Gerd Hoffmann, Clément Mathieu--Drif, Zhao Liu,
	Marc-André Lureau, Yi Liu, Mark Cave-Ayland

On 08/05/2025 12.40, Philippe Mathieu-Daudé wrote:
> Hi Thomas,
> 
> On 8/5/25 09:55, Thomas Huth wrote:
>> On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
>>> 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.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
>>> ---
>>>   include/hw/i386/pc.h |  3 ---
>>>   hw/i386/pc.c         | 10 ----------
>>>   2 files changed, 13 deletions(-)
>>>
>>> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
>>> index 4fb2033bc54..319ec82f709 100644
>>> --- a/include/hw/i386/pc.h
>>> +++ b/include/hw/i386/pc.h
>>> @@ -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) \
>>> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>>> index 7573b880905..ee7095c89a8 100644
>>> --- a/hw/i386/pc.c
>>> +++ b/hw/i386/pc.c
>>> @@ -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);
>>
>> 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.

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

> 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



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-08 10:40     ` Philippe Mathieu-Daudé
  2025-05-08 11:41       ` Thomas Huth
@ 2025-05-08 12:09       ` Zhao Liu
  1 sibling, 0 replies; 38+ messages in thread
From: Zhao Liu @ 2025-05-08 12:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, qemu-devel, Laurent Vivier, Igor Mammedov,
	Huacai Chen, Amit Shah, Marcel Apfelbaum, Sergio Lopez, Ani Sinha,
	Paolo Bonzini, Eduardo Habkost, Jiaxun Yang, Jason Wang,
	Richard Henderson, Yanan Wang, Gerd Hoffmann,
	Clément Mathieu--Drif, Marc-André Lureau, Yi Liu,
	Michael S. Tsirkin, Mark Cave-Ayland

On Thu, May 08, 2025 at 12:40:35PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu, 8 May 2025 12:40:35 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: Re: [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array
> 
> Hi Thomas,
> 
> On 8/5/25 09:55, Thomas Huth wrote:
> > On 02/05/2025 20.56, Philippe Mathieu-Daudé wrote:
> > > 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.
> > > 
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > > Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> > > ---
> > >   include/hw/i386/pc.h |  3 ---
> > >   hw/i386/pc.c         | 10 ----------
> > >   2 files changed, 13 deletions(-)
> > > 
> > > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> > > index 4fb2033bc54..319ec82f709 100644
> > > --- a/include/hw/i386/pc.h
> > > +++ b/include/hw/i386/pc.h
> > > @@ -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) \
> > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > > index 7573b880905..ee7095c89a8 100644
> > > --- a/hw/i386/pc.c
> > > +++ b/hw/i386/pc.c
> > > @@ -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);
> > 
> > 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.

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



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
  2025-05-07  6:23   ` Zhao Liu
@ 2025-05-08 13:02     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 38+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:02 UTC (permalink / raw)
  To: Zhao Liu
  Cc: qemu-devel, Laurent Vivier, Igor Mammedov, Huacai Chen, Amit Shah,
	Marcel Apfelbaum, Sergio Lopez, Ani Sinha, Paolo Bonzini,
	Eduardo Habkost, Jiaxun Yang, Jason Wang, Richard Henderson,
	Yanan Wang, Gerd Hoffmann, Clément Mathieu--Drif,
	Marc-André Lureau, Yi Liu, Michael S. Tsirkin,
	Mark Cave-Ayland

On 7/5/25 08:23, Zhao Liu wrote:
>> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
>> index 3fffa4a3328..625889783ec 100644
>> --- a/hw/i386/acpi-build.c
>> +++ b/hw/i386/acpi-build.c
>> @@ -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?

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.

> 
>>           CPUHotplugFeatures opts = {
>>               .acpi_1_compatible = true, .has_legacy_cphp = true,
>>               .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,
> 
> Otherwise,
> 
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>

Thanks!


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2025-05-08 13:03 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 18:56 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
2025-05-07  6:10   ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
2025-05-07  6:23   ` Zhao Liu
2025-05-08 13:02     ` Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 03/19] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem() Philippe Mathieu-Daudé
2025-05-07  6:31   ` Zhao Liu
2025-05-07 11:59     ` Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 04/19] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
2025-05-07  6:36   ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 05/19] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
2025-05-07  6:41   ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 06/19] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
2025-05-07  6:46   ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 07/19] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
2025-05-07  6:47   ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 08/19] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 09/19] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
2025-05-08  7:49   ` Thomas Huth
2025-05-02 18:56 ` [PATCH v3 10/19] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
2025-05-08  7:51   ` Thomas Huth
2025-05-02 18:56 ` [PATCH v3 11/19] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
2025-05-05  9:50   ` Philippe Mathieu-Daudé
2025-05-08  7:53     ` Thomas Huth
2025-05-02 18:56 ` [PATCH v3 12/19] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
2025-05-08  7:55   ` Thomas Huth
2025-05-08 10:40     ` Philippe Mathieu-Daudé
2025-05-08 11:41       ` Thomas Huth
2025-05-08 12:09       ` Zhao Liu
2025-05-02 18:56 ` [PATCH v3 13/19] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
2025-05-08  7:57   ` Thomas Huth
2025-05-02 18:56 ` [PATCH v3 14/19] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 15/19] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 16/19] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 17/19] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 18/19] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
2025-05-02 18:56 ` [PATCH v3 19/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).