kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
@ 2025-05-08 13:35 Philippe Mathieu-Daudé
  2025-05-08 13:35 ` [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
                   ` (27 more replies)
  0 siblings, 28 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Since v3:
- Addressed Thomas and Zhao review comments
- Rename fw_cfg_init_mem_[no]dma() helpers
- Remove unused CPU properties
- Remove {multi,linux}boot.bin
- Added R-b tags

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

Philippe Mathieu-Daudé (27):
  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/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
  hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
  hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() ->
    fw_cfg_init_mem_dma()
  hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  hw/i386/pc: Remove multiboot.bin
  hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  hw/i386/pc: Remove linuxboot.bin
  hw/i386/pc: Remove pc_compat_2_6[] array
  target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field
  target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field
  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
  target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field
  target/i386/cpu: Remove CPUX86State::enable_l3_cache field
  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/nvram/fw_cfg.h           |   9 +-
 include/hw/virtio/virtio-mmio.h     |   1 -
 include/hw/virtio/virtio-pci.h      |   2 -
 include/hw/virtio/virtio-serial.h   |   2 -
 pc-bios/optionrom/optionrom.h       |   4 -
 target/i386/cpu.h                   |  15 --
 hw/acpi/cpu_hotplug.c               | 230 ---------------------------
 hw/arm/virt.c                       |   2 +-
 hw/audio/pcspk.c                    |  10 --
 hw/char/virtio-serial-bus.c         |   9 +-
 hw/core/machine.c                   |  17 --
 hw/display/virtio-vga.c             |  10 --
 hw/hppa/machine.c                   |   2 +-
 hw/i386/acpi-build.c                |   4 +-
 hw/i386/fw_cfg.c                    |   5 +-
 hw/i386/intel_iommu.c               |   5 +-
 hw/i386/microvm.c                   |   3 -
 hw/i386/multiboot.c                 |   7 +-
 hw/i386/pc.c                        |  22 +--
 hw/i386/pc_piix.c                   |  23 ---
 hw/i386/pc_q35.c                    |  24 ---
 hw/i386/x86-common.c                |   6 +-
 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                   |  48 +++---
 hw/riscv/virt.c                     |   4 +-
 hw/virtio/virtio-mmio.c             |  15 --
 hw/virtio/virtio-pci.c              |  12 +-
 target/i386/cpu.c                   | 152 ++++++++----------
 target/i386/kvm/kvm.c               |  10 +-
 tests/qtest/test-x86-cpuid-compat.c |  11 --
 pc-bios/meson.build                 |   2 -
 pc-bios/multiboot.bin               | Bin 1024 -> 0 bytes
 pc-bios/optionrom/Makefile          |   2 +-
 pc-bios/optionrom/linuxboot.S       | 195 -----------------------
 pc-bios/optionrom/multiboot.S       | 232 ---------------------------
 pc-bios/optionrom/multiboot_dma.S   | 234 +++++++++++++++++++++++++++-
 47 files changed, 349 insertions(+), 1034 deletions(-)
 delete mode 100644 pc-bios/multiboot.bin
 delete mode 100644 pc-bios/optionrom/linuxboot.S
 delete mode 100644 pc-bios/optionrom/multiboot.S

-- 
2.47.1


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

* [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09 15:23   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
                   ` (26 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.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] 108+ messages in thread

* [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
  2025-05-08 13:35 ` [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09 15:18   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
                   ` (25 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.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] 108+ messages in thread

* [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
  2025-05-08 13:35 ` [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
  2025-05-08 13:35 ` [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
                     ` (2 more replies)
  2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
                   ` (24 subsequent siblings)
  27 siblings, 3 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma()
to distinct with the DMA version (currently named
fw_cfg_init_mem_wide).

Suggested-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/nvram/fw_cfg.h | 3 ++-
 hw/hppa/machine.c         | 2 +-
 hw/nvram/fw_cfg.c         | 7 +++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index d41b9328fd1..d5161a79436 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -307,7 +307,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s,
 
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
                                 AddressSpace *dma_as);
-FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
+FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
+                                  unsigned data_width);
 FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
                                  hwaddr data_addr, uint32_t data_width,
                                  hwaddr dma_addr, AddressSpace *dma_as);
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index dacedc5409c..0d768cb90b0 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -201,7 +201,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus,
     int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env);
     int len;
 
-    fw_cfg = fw_cfg_init_mem(addr, addr + 4);
+    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus);
     fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS);
     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 54cfa07d3f5..10f8f8db86f 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1087,11 +1087,10 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
     return s;
 }
 
-FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)
+FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
+                                  unsigned data_width)
 {
-    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_wide(ctl_addr, data_addr, data_width, 0, NULL);
 }
 
 
-- 
2.47.1


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

* [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
                     ` (2 more replies)
  2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
                   ` (23 subsequent siblings)
  27 siblings, 3 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

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

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..654a2f0999f 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_nodma(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] 108+ messages in thread

* [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  2:50   ` Zhao Liu
                     ` (2 more replies)
  2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
                   ` (22 subsequent siblings)
  27 siblings, 3 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

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 | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 10f8f8db86f..4067324fb09 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,10 +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_addr && dma_as);
+    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr,
+                                    dma_addr, dma_as);
+}
+
 FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
                                   unsigned data_width)
 {
-    return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL);
+    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, 0, NULL);
 }
 
 
-- 
2.47.1


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

* [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  2:52   ` Zhao Liu
                     ` (2 more replies)
  2025-05-08 13:35 ` [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
                   ` (21 subsequent siblings)
  27 siblings, 3 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

"wide" in fw_cfg_init_mem_wide() means "DMA support".
Rename for clarity.

Suggested-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/nvram/fw_cfg.h | 6 +++---
 hw/arm/virt.c             | 2 +-
 hw/nvram/fw_cfg.c         | 6 +++---
 hw/riscv/virt.c           | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index d5161a79436..c4c49886754 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
                                 AddressSpace *dma_as);
 FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
                                   unsigned data_width);
-FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
-                                 hwaddr data_addr, uint32_t data_width,
-                                 hwaddr dma_addr, AddressSpace *dma_as);
+FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
+                                hwaddr data_addr, uint32_t data_width,
+                                hwaddr dma_addr, AddressSpace *dma_as);
 
 FWCfgState *fw_cfg_find(void);
 bool fw_cfg_dma_enabled(void *opaque);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9a6cd085a37..7583f0a85d9 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1361,7 +1361,7 @@ static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as)
     FWCfgState *fw_cfg;
     char *nodename;
 
-    fw_cfg = fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as);
+    fw_cfg = fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, as);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus);
 
     nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 4067324fb09..51b028b5d0a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1087,9 +1087,9 @@ static FWCfgState *fw_cfg_init_mem_internal(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)
+FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
+                                hwaddr data_addr, uint32_t data_width,
+                                hwaddr dma_addr, AddressSpace *dma_as)
 {
     assert(dma_addr && dma_as);
     return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr,
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index be1bf0f6468..3ddea18c93e 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -1266,8 +1266,8 @@ static FWCfgState *create_fw_cfg(const MachineState *ms)
     hwaddr base = virt_memmap[VIRT_FW_CFG].base;
     FWCfgState *fw_cfg;
 
-    fw_cfg = fw_cfg_init_mem_wide(base + 8, base, 8, base + 16,
-                                  &address_space_memory);
+    fw_cfg = fw_cfg_init_mem_dma(base + 8, base, 8, base + 16,
+                                 &address_space_memory);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus);
 
     return fw_cfg;
-- 
2.47.1


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

* [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  3:23   ` Zhao Liu
  2025-05-09 15:41   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin Philippe Mathieu-Daudé
                   ` (20 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

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.

'multiboot.bin' isn't used anymore, we'll remove it in the
next commit.

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] 108+ messages in thread

* [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  6:11   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
                   ` (19 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Thomas Huth

All PC machines now use the multiboot_dma.bin binary,
we can remove the non-DMA version (multiboot.bin).

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 pc-bios/optionrom/optionrom.h     |   4 -
 hw/i386/pc.c                      |   1 -
 pc-bios/meson.build               |   1 -
 pc-bios/multiboot.bin             | Bin 1024 -> 0 bytes
 pc-bios/optionrom/Makefile        |   2 +-
 pc-bios/optionrom/multiboot.S     | 232 -----------------------------
 pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++++++++++++++++++++-
 7 files changed, 233 insertions(+), 241 deletions(-)
 delete mode 100644 pc-bios/multiboot.bin
 delete mode 100644 pc-bios/optionrom/multiboot.S

diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
index 7bcdf0eeb24..2e6e2493f83 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -117,16 +117,12 @@
  *
  * Clobbers: %eax, %edx, %es, %ecx, %edi and adresses %esp-20 to %esp
  */
-#ifdef USE_FW_CFG_DMA
 #define read_fw_blob_dma(var)                           \
         read_fw         var ## _SIZE;                   \
         mov             %eax, %ecx;                     \
         read_fw         var ## _ADDR;                   \
         mov             %eax, %edi ;                    \
         read_fw_dma     var ## _DATA, %ecx, %edi
-#else
-#define read_fw_blob_dma(var) read_fw_blob(var)
-#endif
 
 #define read_fw_blob_pre(var)                           \
         read_fw         var ## _SIZE;                   \
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 49632b69d29..524d2fd98e8 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -657,7 +657,6 @@ void xen_load_linux(PCMachineState *pcms)
         assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
                !strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
                !strcmp(option_rom[i].name, "pvh.bin") ||
-               !strcmp(option_rom[i].name, "multiboot.bin") ||
                !strcmp(option_rom[i].name, "multiboot_dma.bin"));
         rom_add_option(option_rom[i].name, option_rom[i].bootindex);
     }
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 79bb2e18008..f2d4dc416a4 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -62,7 +62,6 @@ blobs = [
   'efi-e1000e.rom',
   'efi-vmxnet3.rom',
   'qemu-nsis.bmp',
-  'multiboot.bin',
   'multiboot_dma.bin',
   'linuxboot.bin',
   'linuxboot_dma.bin',
diff --git a/pc-bios/multiboot.bin b/pc-bios/multiboot.bin
deleted file mode 100644
index e772713c95749bee82c20002b50ec6d05b2d4987..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1024
zcmeHFF-Tic6utlZQ$OjD#Hxcx2u0GNQv6GySOkZR(ulaX<>%N!Y#>cWhY}nf36J7X
zN(%*X6NHY>xcqO11dG^02a8L@B~ihln|%1*|7(haWa`)l@80w7;U4Ziyv0rZ8{K-w
zX(Ib3tLZ)RgZ}w1ei{~QEqQq9q1J-iHc<Nk_t=0qf%XfPZVHw2DY#ujc2P|}*P%6X
z5J{pPlX4<yP&N5pXK;s@UhB~&!E&UdqEwGZF6xQMIcu9YL#zeSRCoLGt{Nh+08t>}
z{m%E-b32A??+@XljSYirtWObwngi<ymS1Ta*dFGMp;8@=_3Z52!v09{UU~`QnFsB_
z7BiEC)uZxH%SW9kPWCicN{_iUjmk<~D^H|R%@|m9%43Woc(Pkeq%n{&8ND5Z*tPt#
zJua+xXAQhN4K(1MMs0{u_6sp>l#NmvPZ7KC<lsLdQgMFC@A6POvMoDMgW=M+K;T<o
zTkpnNq6x*`vM0CGE>t40l-CQ}*)y<y--c)(x}o&1TMzwX+ToGS@VER4zR&s70fl+(
qI)9<-H_-!n#lLJmGq*^~<$US&%R-@)$`@YPx#A6#|L`9<;9UXPG71m?

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 30d07026c79..1183ef88922 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -2,7 +2,7 @@ include config.mak
 SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom
 VPATH = $(SRC_DIR)
 
-all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
+all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
 # Dummy command so that make thinks it has done something
 	@true
 
diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
deleted file mode 100644
index 181a4b03a3f..00000000000
--- a/pc-bios/optionrom/multiboot.S
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Multiboot Option ROM
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright Novell Inc, 2009
- *   Authors: Alexander Graf <agraf@suse.de>
- */
-
-#include "optionrom.h"
-
-#define BOOT_ROM_PRODUCT "multiboot loader"
-
-#define MULTIBOOT_MAGIC		0x2badb002
-
-#define GS_PROT_JUMP		0
-#define GS_GDT_DESC		6
-
-
-BOOT_ROM_START
-
-run_multiboot:
-
-	cli
-	cld
-
-	mov		%cs, %eax
-	shl		$0x4, %eax
-
-	/* set up a long jump descriptor that is PC relative */
-
-	/* move stack memory to %gs */
-	mov		%ss, %ecx
-	shl		$0x4, %ecx
-	mov		%esp, %ebx
-	add		%ebx, %ecx
-	sub		$0x20, %ecx
-	sub		$0x30, %esp
-	shr		$0x4, %ecx
-	mov		%cx, %gs
-
-	/* now push the indirect jump descriptor there */
-	mov		(prot_jump), %ebx
-	add		%eax, %ebx
-	movl		%ebx, %gs:GS_PROT_JUMP
-	mov		$8, %bx
-	movw		%bx, %gs:GS_PROT_JUMP + 4
-
-	/* fix the gdt descriptor to be PC relative */
-	movw		(gdt_desc), %bx
-	movw		%bx, %gs:GS_GDT_DESC
-	movl		(gdt_desc+2), %ebx
-	add		%eax, %ebx
-	movl		%ebx, %gs:GS_GDT_DESC + 2
-
-	xor		%eax, %eax
-	mov		%eax, %es
-
-	/* Read the bootinfo struct into RAM */
-	read_fw_blob_dma(FW_CFG_INITRD)
-
-	/* FS = bootinfo_struct */
-	read_fw		FW_CFG_INITRD_ADDR
-	shr		$4, %eax
-	mov		%ax, %fs
-
-	/* Account for the EBDA in the multiboot structure's e801
-	 * map.
-	 */
-	int		$0x12
-	cwtl
-	movl		%eax, %fs:4
-
-	/* ES = mmap_addr */
-	mov 		%fs:48, %eax
-	shr		$4, %eax
-	mov		%ax, %es
-
-	/* Initialize multiboot mmap structs using int 0x15(e820) */
-	xor		%ebx, %ebx
-	/* Start storing mmap data at %es:0 */
-	xor		%edi, %edi
-
-mmap_loop:
-	/* The multiboot entry size has offset -4, so leave some space */
-	add		$4, %di
-	/* entry size (mmap struct) & max buffer size (int15) */
-	movl		$20, %ecx
-	/* e820 */
-	movl		$0x0000e820, %eax
-	/* 'SMAP' magic */
-	movl		$0x534d4150, %edx
-	int		$0x15
-
-mmap_check_entry:
-	/* Error or last entry already done? */
-	jb		mmap_done
-
-mmap_store_entry:
-	/* store entry size */
-	/* old as(1) doesn't like this insn so emit the bytes instead:
-	movl		%ecx, %es:-4(%edi)
-	*/
-	.dc.b		0x26,0x67,0x66,0x89,0x4f,0xfc
-
-	/* %edi += entry_size, store as mbs_mmap_length */
-	add		%ecx, %edi
-	movw		%di, %fs:0x2c
-
-	/* Continuation value 0 means last entry */
-	test		%ebx, %ebx
-	jnz		mmap_loop
-
-mmap_done:
-	/* Calculate upper_mem field: The amount of memory between 1 MB and
-	   the first upper memory hole. Get it from the mmap. */
-	xor		%di, %di
-	mov		$0x100000, %edx
-upper_mem_entry:
-	cmp		%fs:0x2c, %di
-	je		upper_mem_done
-	add		$4, %di
-
-	/* Skip if type != 1 */
-	cmpl		$1, %es:16(%di)
-	jne		upper_mem_next
-
-	/* Skip if > 4 GB */
-	movl		%es:4(%di), %eax
-	test		%eax, %eax
-	jnz		upper_mem_next
-
-	/* Check for contiguous extension (base <= %edx < base + length) */
-	movl		%es:(%di), %eax
-	cmp		%eax, %edx
-	jb		upper_mem_next
-	addl		%es:8(%di), %eax
-	cmp		%eax, %edx
-	jae		upper_mem_next
-
-	/* If so, update %edx, and restart the search (mmap isn't ordered) */
-	mov		%eax, %edx
-	xor		%di, %di
-	jmp		upper_mem_entry
-
-upper_mem_next:
-	addl		%es:-4(%di), %edi
-	jmp		upper_mem_entry
-
-upper_mem_done:
-	sub		$0x100000, %edx
-	shr		$10, %edx
-	mov		%edx, %fs:0x8
-
-real_to_prot:
-	/* Load the GDT before going into protected mode */
-lgdt:
-	data32 lgdt	%gs:GS_GDT_DESC
-
-	/* get us to protected mode now */
-	movl		$1, %eax
-	movl		%eax, %cr0
-
-	/* the LJMP sets CS for us and gets us to 32-bit */
-ljmp:
-	data32 ljmp	*%gs:GS_PROT_JUMP
-
-prot_mode:
-.code32
-
-	/* initialize all other segments */
-	movl		$0x10, %eax
-	movl		%eax, %ss
-	movl		%eax, %ds
-	movl		%eax, %es
-	movl		%eax, %fs
-	movl		%eax, %gs
-
-	/* Read the kernel and modules into RAM */
-	read_fw_blob_dma(FW_CFG_KERNEL)
-
-	/* Jump off to the kernel */
-	read_fw		FW_CFG_KERNEL_ENTRY
-	mov		%eax, %ecx
-
-	/* EBX contains a pointer to the bootinfo struct */
-	read_fw		FW_CFG_INITRD_ADDR
-	movl		%eax, %ebx
-
-	/* EAX has to contain the magic */
-	movl		$MULTIBOOT_MAGIC, %eax
-ljmp2:
-	jmp		*%ecx
-
-/* Variables */
-.align 4, 0
-prot_jump:	.long prot_mode
-		.short 8
-
-.align 4, 0
-gdt:
-	/* 0x00 */
-.byte	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-	/* 0x08: code segment (base=0, limit=0xfffff, type=32bit code exec/read, DPL=0, 4k) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00
-
-	/* 0x10: data segment (base=0, limit=0xfffff, type=32bit data read/write, DPL=0, 4k) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00
-
-	/* 0x18: code segment (base=0, limit=0x0ffff, type=16bit code exec/read/conf, DPL=0, 1b) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00
-
-	/* 0x20: data segment (base=0, limit=0x0ffff, type=16bit data read/write, DPL=0, 1b) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00
-
-gdt_desc:
-.short	(5 * 8) - 1
-.long	gdt
-
-BOOT_ROM_END
diff --git a/pc-bios/optionrom/multiboot_dma.S b/pc-bios/optionrom/multiboot_dma.S
index d809af3e23f..181a4b03a3f 100644
--- a/pc-bios/optionrom/multiboot_dma.S
+++ b/pc-bios/optionrom/multiboot_dma.S
@@ -1,2 +1,232 @@
-#define USE_FW_CFG_DMA 1
-#include "multiboot.S"
+/*
+ * Multiboot Option ROM
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright Novell Inc, 2009
+ *   Authors: Alexander Graf <agraf@suse.de>
+ */
+
+#include "optionrom.h"
+
+#define BOOT_ROM_PRODUCT "multiboot loader"
+
+#define MULTIBOOT_MAGIC		0x2badb002
+
+#define GS_PROT_JUMP		0
+#define GS_GDT_DESC		6
+
+
+BOOT_ROM_START
+
+run_multiboot:
+
+	cli
+	cld
+
+	mov		%cs, %eax
+	shl		$0x4, %eax
+
+	/* set up a long jump descriptor that is PC relative */
+
+	/* move stack memory to %gs */
+	mov		%ss, %ecx
+	shl		$0x4, %ecx
+	mov		%esp, %ebx
+	add		%ebx, %ecx
+	sub		$0x20, %ecx
+	sub		$0x30, %esp
+	shr		$0x4, %ecx
+	mov		%cx, %gs
+
+	/* now push the indirect jump descriptor there */
+	mov		(prot_jump), %ebx
+	add		%eax, %ebx
+	movl		%ebx, %gs:GS_PROT_JUMP
+	mov		$8, %bx
+	movw		%bx, %gs:GS_PROT_JUMP + 4
+
+	/* fix the gdt descriptor to be PC relative */
+	movw		(gdt_desc), %bx
+	movw		%bx, %gs:GS_GDT_DESC
+	movl		(gdt_desc+2), %ebx
+	add		%eax, %ebx
+	movl		%ebx, %gs:GS_GDT_DESC + 2
+
+	xor		%eax, %eax
+	mov		%eax, %es
+
+	/* Read the bootinfo struct into RAM */
+	read_fw_blob_dma(FW_CFG_INITRD)
+
+	/* FS = bootinfo_struct */
+	read_fw		FW_CFG_INITRD_ADDR
+	shr		$4, %eax
+	mov		%ax, %fs
+
+	/* Account for the EBDA in the multiboot structure's e801
+	 * map.
+	 */
+	int		$0x12
+	cwtl
+	movl		%eax, %fs:4
+
+	/* ES = mmap_addr */
+	mov 		%fs:48, %eax
+	shr		$4, %eax
+	mov		%ax, %es
+
+	/* Initialize multiboot mmap structs using int 0x15(e820) */
+	xor		%ebx, %ebx
+	/* Start storing mmap data at %es:0 */
+	xor		%edi, %edi
+
+mmap_loop:
+	/* The multiboot entry size has offset -4, so leave some space */
+	add		$4, %di
+	/* entry size (mmap struct) & max buffer size (int15) */
+	movl		$20, %ecx
+	/* e820 */
+	movl		$0x0000e820, %eax
+	/* 'SMAP' magic */
+	movl		$0x534d4150, %edx
+	int		$0x15
+
+mmap_check_entry:
+	/* Error or last entry already done? */
+	jb		mmap_done
+
+mmap_store_entry:
+	/* store entry size */
+	/* old as(1) doesn't like this insn so emit the bytes instead:
+	movl		%ecx, %es:-4(%edi)
+	*/
+	.dc.b		0x26,0x67,0x66,0x89,0x4f,0xfc
+
+	/* %edi += entry_size, store as mbs_mmap_length */
+	add		%ecx, %edi
+	movw		%di, %fs:0x2c
+
+	/* Continuation value 0 means last entry */
+	test		%ebx, %ebx
+	jnz		mmap_loop
+
+mmap_done:
+	/* Calculate upper_mem field: The amount of memory between 1 MB and
+	   the first upper memory hole. Get it from the mmap. */
+	xor		%di, %di
+	mov		$0x100000, %edx
+upper_mem_entry:
+	cmp		%fs:0x2c, %di
+	je		upper_mem_done
+	add		$4, %di
+
+	/* Skip if type != 1 */
+	cmpl		$1, %es:16(%di)
+	jne		upper_mem_next
+
+	/* Skip if > 4 GB */
+	movl		%es:4(%di), %eax
+	test		%eax, %eax
+	jnz		upper_mem_next
+
+	/* Check for contiguous extension (base <= %edx < base + length) */
+	movl		%es:(%di), %eax
+	cmp		%eax, %edx
+	jb		upper_mem_next
+	addl		%es:8(%di), %eax
+	cmp		%eax, %edx
+	jae		upper_mem_next
+
+	/* If so, update %edx, and restart the search (mmap isn't ordered) */
+	mov		%eax, %edx
+	xor		%di, %di
+	jmp		upper_mem_entry
+
+upper_mem_next:
+	addl		%es:-4(%di), %edi
+	jmp		upper_mem_entry
+
+upper_mem_done:
+	sub		$0x100000, %edx
+	shr		$10, %edx
+	mov		%edx, %fs:0x8
+
+real_to_prot:
+	/* Load the GDT before going into protected mode */
+lgdt:
+	data32 lgdt	%gs:GS_GDT_DESC
+
+	/* get us to protected mode now */
+	movl		$1, %eax
+	movl		%eax, %cr0
+
+	/* the LJMP sets CS for us and gets us to 32-bit */
+ljmp:
+	data32 ljmp	*%gs:GS_PROT_JUMP
+
+prot_mode:
+.code32
+
+	/* initialize all other segments */
+	movl		$0x10, %eax
+	movl		%eax, %ss
+	movl		%eax, %ds
+	movl		%eax, %es
+	movl		%eax, %fs
+	movl		%eax, %gs
+
+	/* Read the kernel and modules into RAM */
+	read_fw_blob_dma(FW_CFG_KERNEL)
+
+	/* Jump off to the kernel */
+	read_fw		FW_CFG_KERNEL_ENTRY
+	mov		%eax, %ecx
+
+	/* EBX contains a pointer to the bootinfo struct */
+	read_fw		FW_CFG_INITRD_ADDR
+	movl		%eax, %ebx
+
+	/* EAX has to contain the magic */
+	movl		$MULTIBOOT_MAGIC, %eax
+ljmp2:
+	jmp		*%ecx
+
+/* Variables */
+.align 4, 0
+prot_jump:	.long prot_mode
+		.short 8
+
+.align 4, 0
+gdt:
+	/* 0x00 */
+.byte	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+	/* 0x08: code segment (base=0, limit=0xfffff, type=32bit code exec/read, DPL=0, 4k) */
+.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00
+
+	/* 0x10: data segment (base=0, limit=0xfffff, type=32bit data read/write, DPL=0, 4k) */
+.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00
+
+	/* 0x18: code segment (base=0, limit=0x0ffff, type=16bit code exec/read/conf, DPL=0, 1b) */
+.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00
+
+	/* 0x20: data segment (base=0, limit=0x0ffff, type=16bit data read/write, DPL=0, 1b) */
+.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00
+
+gdt_desc:
+.short	(5 * 8) - 1
+.long	gdt
+
+BOOT_ROM_END
-- 
2.47.1


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

* [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  6:37   ` Zhao Liu
  2025-05-09 16:00   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

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_nodma
  hw/hppa/machine.c:204:    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);
  hw/mips/loongson3_virt.c:289:    fw_cfg = fw_cfg_init_mem_nodma(cfg_addr, cfg_addr + 8, 8);

'linuxboot.bin' isn't used anymore, we'll remove it in the
next commit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/i386/fw_cfg.c     |  5 +----
 hw/i386/x86-common.c |  5 +----
 hw/nvram/fw_cfg.c    | 26 ++++++++------------------
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index 5c0bcd5f8a9..1fe084fd720 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -221,10 +221,7 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
      * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
      * DMA control register is located at FW_CFG_DMA_IO_BASE + 4
      */
-    Object *obj = OBJECT(fw_cfg);
-    uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ?
-        ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
-        FW_CFG_CTL_SIZE;
+    uint8_t io_size = ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t);
     Aml *dev = aml_device("FWCF");
     Aml *crs = aml_resource_template();
 
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index 27254a0e9f1..ee594364415 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -991,10 +991,7 @@ void x86_load_linux(X86MachineState *x86ms,
     }
 
     option_rom[nb_option_roms].bootindex = 0;
-    option_rom[nb_option_roms].name = "linuxboot.bin";
-    if (fw_cfg_dma_enabled(fw_cfg)) {
-        option_rom[nb_option_roms].name = "linuxboot_dma.bin";
-    }
+    option_rom[nb_option_roms].name = "linuxboot_dma.bin";
     nb_option_roms++;
 }
 
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 51b028b5d0a..ef976a4bce2 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);
     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] 108+ messages in thread

* [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  6:53   ` Zhao Liu
  2025-05-09 16:04   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Thomas Huth

All PC machines now use the linuxboot_dma.bin binary,
we can remove the non-DMA version (linuxboot.bin).

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc.c                  |   3 +-
 pc-bios/meson.build           |   1 -
 pc-bios/optionrom/Makefile    |   2 +-
 pc-bios/optionrom/linuxboot.S | 195 ----------------------------------
 4 files changed, 2 insertions(+), 199 deletions(-)
 delete mode 100644 pc-bios/optionrom/linuxboot.S

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 524d2fd98e8..4e6fe68e2e0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -654,8 +654,7 @@ void xen_load_linux(PCMachineState *pcms)
 
     x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled);
     for (i = 0; i < nb_option_roms; i++) {
-        assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
-               !strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
+        assert(!strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
                !strcmp(option_rom[i].name, "pvh.bin") ||
                !strcmp(option_rom[i].name, "multiboot_dma.bin"));
         rom_add_option(option_rom[i].name, option_rom[i].bootindex);
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index f2d4dc416a4..39a7fea332e 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -63,7 +63,6 @@ blobs = [
   'efi-vmxnet3.rom',
   'qemu-nsis.bmp',
   'multiboot_dma.bin',
-  'linuxboot.bin',
   'linuxboot_dma.bin',
   'kvmvapic.bin',
   'pvh.bin',
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 1183ef88922..e694c7aac00 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -2,7 +2,7 @@ include config.mak
 SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom
 VPATH = $(SRC_DIR)
 
-all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
+all: multiboot_dma.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
 # Dummy command so that make thinks it has done something
 	@true
 
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
deleted file mode 100644
index ba821ab922d..00000000000
--- a/pc-bios/optionrom/linuxboot.S
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Linux Boot Option ROM
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright Novell Inc, 2009
- *   Authors: Alexander Graf <agraf@suse.de>
- *
- * Based on code in hw/pc.c.
- */
-
-#include "optionrom.h"
-
-#define BOOT_ROM_PRODUCT "Linux loader"
-
-BOOT_ROM_START
-
-run_linuxboot:
-
-	cli
-	cld
-
-	jmp		copy_kernel
-boot_kernel:
-
-	read_fw		FW_CFG_SETUP_ADDR
-
-	mov		%eax, %ebx
-	shr		$4, %ebx
-
-	/* All segments contain real_addr */
-	mov		%bx, %ds
-	mov		%bx, %es
-	mov		%bx, %fs
-	mov		%bx, %gs
-	mov		%bx, %ss
-
-	/* CX = CS we want to jump to */
-	add		$0x20, %bx
-	mov		%bx, %cx
-
-	/* SP = cmdline_addr-real_addr-16 */
-	read_fw		FW_CFG_CMDLINE_ADDR
-	mov		%eax, %ebx
-	read_fw		FW_CFG_SETUP_ADDR
-	sub		%eax, %ebx
-	sub		$16, %ebx
-	mov		%ebx, %esp
-
-	/* Build indirect lret descriptor */
-	pushw		%cx		/* CS */
-	xor		%ax, %ax
-	pushw		%ax		/* IP = 0 */
-
-	/* Clear registers */
-	xor		%eax, %eax
-	xor		%ebx, %ebx
-	xor		%ecx, %ecx
-	xor		%edx, %edx
-	xor		%edi, %edi
-	xor		%ebp, %ebp
-
-	/* Jump to Linux */
-	lret
-
-
-copy_kernel:
-	/* Read info block in low memory (0x10000 or 0x90000) */
-	read_fw		FW_CFG_SETUP_ADDR
-	shr		$4, %eax
-	mov		%eax, %es
-	xor		%edi, %edi
-	read_fw_blob_addr32_edi(FW_CFG_SETUP)
-
-	cmpw            $0x203, %es:0x206      // if protocol >= 0x203
-	jae             1f                     // have initrd_max
-	movl            $0x37ffffff, %es:0x22c // else assume 0x37ffffff
-1:
-
-	/* Check if using kernel-specified initrd address */
-	read_fw		FW_CFG_INITRD_ADDR
-	mov		%eax, %edi             // (load_kernel wants it in %edi)
-	read_fw		FW_CFG_INITRD_SIZE     // find end of initrd
-	add		%edi, %eax
-	xor		%es:0x22c, %eax        // if it matches es:0x22c
-	and		$-4096, %eax           // (apart from padding for page)
-	jz		load_kernel            // then initrd is not at top
-					       // of memory
-
-	/* pc.c placed the initrd at end of memory.  Compute a better
-	 * initrd address based on e801 data.
-	 */
-	mov		$0xe801, %ax
-	xor		%cx, %cx
-	xor		%dx, %dx
-	int		$0x15
-
-	/* Output could be in AX/BX or CX/DX */
-	or		%cx, %cx
-	jnz		1f
-	or		%dx, %dx
-	jnz		1f
-	mov		%ax, %cx
-	mov		%bx, %dx
-1:
-
-	or		%dx, %dx
-	jnz		2f
-	addw		$1024, %cx            /* add 1 MB */
-	movzwl		%cx, %edi
-	shll		$10, %edi             /* convert to bytes */
-	jmp		3f
-
-2:
-	addw		$16777216 >> 16, %dx  /* add 16 MB */
-	movzwl		%dx, %edi
-	shll		$16, %edi             /* convert to bytes */
-
-3:
-	read_fw         FW_CFG_INITRD_SIZE
-	subl            %eax, %edi
-	andl            $-4096, %edi          /* EDI = start of initrd */
-	movl		%edi, %es:0x218       /* put it in the header */
-
-load_kernel:
-	/* We need to load the kernel into memory we can't access in 16 bit
-	   mode, so let's get into 32 bit mode, write the kernel and jump
-	   back again. */
-
-	/* Reserve space on the stack for our GDT descriptor. */
-	mov             %esp, %ebp
-	sub             $16, %esp
-
-	/* Now create the GDT descriptor */
-	movw		$((3 * 8) - 1), -16(%bp)
-	mov		%cs, %eax
-	movzwl		%ax, %eax
-	shl		$4, %eax
-	addl		$gdt, %eax
-	movl		%eax, -14(%bp)
-
-	/* And load the GDT */
-	data32 lgdt	-16(%bp)
-	mov		%ebp, %esp
-
-	/* Get us to protected mode now */
-	mov		$1, %eax
-	mov		%eax, %cr0
-
-	/* So we can set ES to a 32-bit segment */
-	mov		$0x10, %eax
-	mov		%eax, %es
-
-	/* We're now running in 16-bit CS, but 32-bit ES! */
-
-	/* Load kernel and initrd */
-	read_fw_blob_addr32_edi(FW_CFG_INITRD)
-	read_fw_blob_addr32(FW_CFG_KERNEL)
-	read_fw_blob_addr32(FW_CFG_CMDLINE)
-
-	/* And now jump into Linux! */
-	mov		$0, %eax
-	mov		%eax, %cr0
-
-	/* ES = CS */
-	mov		%cs, %ax
-	mov		%ax, %es
-
-	jmp		boot_kernel
-
-/* Variables */
-
-.align 4, 0
-gdt:
-	/* 0x00 */
-.byte	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-	/* 0x08: code segment (base=0, limit=0xfffff, type=32bit code exec/read, DPL=0, 4k) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00
-
-	/* 0x10: data segment (base=0, limit=0xfffff, type=32bit data read/write, DPL=0, 4k) */
-.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00
-
-BOOT_ROM_END
-- 
2.47.1


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

* [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  6:54   ` Zhao Liu
  2025-05-12  8:19   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.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 4e6fe68e2e0..65a11ea8f99 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] 108+ messages in thread

* [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  6:49   ` Xiaoyao Li
  2025-05-08 13:35 ` [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

The CPUX86State::enable_cpuid_0xb boolean was only disabled
for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
removed. Being now always %true, we can remove it and simplify
cpu_x86_cpuid().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/cpu.h | 3 ---
 target/i386/cpu.c | 6 ------
 2 files changed, 9 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 0db70a70439..06817a31cf9 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2241,9 +2241,6 @@ struct ArchCPU {
      */
     bool legacy_multi_node;
 
-    /* Compatibility bits for old machine types: */
-    bool enable_cpuid_0xb;
-
     /* Enable auto level-increase for all CPUID leaves */
     bool full_cpuid_auto_level;
 
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 49179f35812..6fe37f71b1e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         break;
     case 0xB:
         /* Extended Topology Enumeration Leaf */
-        if (!cpu->enable_cpuid_0xb) {
-                *eax = *ebx = *ecx = *edx = 0;
-                break;
-        }
-
         *ecx = count & 0xff;
         *edx = cpu->apic_id;
 
@@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
     DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
     DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
     DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
-    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
     DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
     DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_features_only, true),
     DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false),
-- 
2.47.1


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

* [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:30   ` Zhao Liu
  2025-05-12 15:24   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

The CPUX86State::fill_mtrr_mask boolean was only disabled
for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
removed. Being now always %true, we can remove it and simplify
kvm_get_msrs().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/cpu.h     |  3 ---
 target/i386/cpu.c     |  1 -
 target/i386/kvm/kvm.c | 10 +++-------
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 06817a31cf9..7585407da54 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2253,9 +2253,6 @@ struct ArchCPU {
     /* Enable auto level-increase for Intel Processor Trace leave */
     bool intel_pt_auto_level;
 
-    /* if true fill the top bits of the MTRR_PHYSMASKn variable range */
-    bool fill_mtrr_mask;
-
     /* if true override the phys_bits value with a value read from the host */
     bool host_phys_bits;
 
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6fe37f71b1e..fb505d13122 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -8810,7 +8810,6 @@ static const Property x86_cpu_properties[] = {
     DEFINE_PROP_UINT32("guest-phys-bits", X86CPU, guest_phys_bits, -1),
     DEFINE_PROP_BOOL("host-phys-bits", X86CPU, host_phys_bits, false),
     DEFINE_PROP_UINT8("host-phys-bits-limit", X86CPU, host_phys_bits_limit, 0),
-    DEFINE_PROP_BOOL("fill-mtrr-mask", X86CPU, fill_mtrr_mask, true),
     DEFINE_PROP_UINT32("level-func7", X86CPU, env.cpuid_level_func7,
                        UINT32_MAX),
     DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, UINT32_MAX),
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index c9a3c02e3e3..87edce99e85 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -4635,13 +4635,9 @@ static int kvm_get_msrs(X86CPU *cpu)
      * we're migrating to.
      */
 
-    if (cpu->fill_mtrr_mask) {
-        QEMU_BUILD_BUG_ON(TARGET_PHYS_ADDR_SPACE_BITS > 52);
-        assert(cpu->phys_bits <= TARGET_PHYS_ADDR_SPACE_BITS);
-        mtrr_top_bits = MAKE_64BIT_MASK(cpu->phys_bits, 52 - cpu->phys_bits);
-    } else {
-        mtrr_top_bits = 0;
-    }
+    QEMU_BUILD_BUG_ON(TARGET_PHYS_ADDR_SPACE_BITS > 52);
+    assert(cpu->phys_bits <= TARGET_PHYS_ADDR_SPACE_BITS);
+    mtrr_top_bits = MAKE_64BIT_MASK(cpu->phys_bits, 52 - cpu->phys_bits);
 
     for (i = 0; i < ret; i++) {
         uint32_t index = msrs[i].index;
-- 
2.47.1


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

* [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:30   ` Zhao Liu
  2025-05-13  8:34   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.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] 108+ messages in thread

* [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:31   ` Zhao Liu
  2025-05-13  8:36   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.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] 108+ messages in thread

* [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:33   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.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] 108+ messages in thread

* [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:33   ` Zhao Liu
  2025-05-13  8:53   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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.  Remove the qtest
in test-x86-cpuid-compat.c file.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 hw/i386/pc_piix.c                   |  9 ---------
 hw/i386/pc_q35.c                    | 10 ----------
 tests/qtest/test-x86-cpuid-compat.c | 11 -----------
 3 files changed, 30 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);
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
@@ -345,17 +345,6 @@ int main(int argc, char **argv)
 
     /* Check compatibility of old machine-types that didn't
      * auto-increase level/xlevel/xlevel2: */
-    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);
-    }
     if (qtest_has_machine("pc-i440fx-2.9")) {
         add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/off",
                        "Conroe", NULL, "pc-i440fx-2.9",
-- 
2.47.1


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

* [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:35   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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 65a11ea8f99..c7cdbe93753 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] 108+ messages in thread

* [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:37   ` Zhao Liu
  2025-05-13 11:02   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

The CPUX86State::full_cpuid_auto_level boolean was only
disabled for the pc-q35-2.7 and pc-i440fx-2.7 machines,
which got removed. Being now always %true, we can remove
it and simplify x86_cpu_expand_features().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/cpu.h |   3 --
 target/i386/cpu.c | 106 ++++++++++++++++++++++------------------------
 2 files changed, 51 insertions(+), 58 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 7585407da54..b5cbd91c156 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2241,9 +2241,6 @@ struct ArchCPU {
      */
     bool legacy_multi_node;
 
-    /* Enable auto level-increase for all CPUID leaves */
-    bool full_cpuid_auto_level;
-
     /* Only advertise CPUID leaves defined by the vendor */
     bool vendor_cpuid_only;
 
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index fb505d13122..6b9a1f2251a 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7843,68 +7843,65 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
 
     /* CPUID[EAX=7,ECX=0].EBX always increased level automatically: */
     x86_cpu_adjust_feat_level(cpu, FEAT_7_0_EBX);
-    if (cpu->full_cpuid_auto_level) {
-        x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
-        x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
-        x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
+    x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
+    x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
+    x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
 
-        /* Intel Processor Trace requires CPUID[0x14] */
-        if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) {
-            if (cpu->intel_pt_auto_level) {
-                x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
-            } else if (cpu->env.cpuid_min_level < 0x14) {
-                mark_unavailable_features(cpu, FEAT_7_0_EBX,
-                    CPUID_7_0_EBX_INTEL_PT,
-                    "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"");
-            }
+    /* Intel Processor Trace requires CPUID[0x14] */
+    if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) {
+        if (cpu->intel_pt_auto_level) {
+            x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
+        } else if (cpu->env.cpuid_min_level < 0x14) {
+            mark_unavailable_features(cpu, FEAT_7_0_EBX, CPUID_7_0_EBX_INTEL_PT,
+                "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"");
         }
+    }
 
-        /*
-         * Intel CPU topology with multi-dies support requires CPUID[0x1F].
-         * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect
-         * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless
-         * cpu->vendor_cpuid_only has been unset for compatibility with older
-         * machine types.
-         */
-        if (x86_has_extended_topo(env->avail_cpu_topo) &&
-            (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
-        }
+    /*
+     * Intel CPU topology with multi-dies support requires CPUID[0x1F].
+     * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect
+     * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless
+     * cpu->vendor_cpuid_only has been unset for compatibility with older
+     * machine types.
+     */
+    if (x86_has_extended_topo(env->avail_cpu_topo) &&
+        (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
+    }
 
-        /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */
-        if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24);
-        }
+    /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */
+    if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24);
+    }
 
-        /* SVM requires CPUID[0x8000000A] */
-        if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
-        }
+    /* SVM requires CPUID[0x8000000A] */
+    if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
+    }
 
-        /* SEV requires CPUID[0x8000001F] */
-        if (sev_enabled()) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F);
-        }
+    /* SEV requires CPUID[0x8000001F] */
+    if (sev_enabled()) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F);
+    }
 
-        if (env->features[FEAT_8000_0021_EAX]) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021);
-        }
+    if (env->features[FEAT_8000_0021_EAX]) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021);
+    }
 
-        /* SGX requires CPUID[0x12] for EPC enumeration */
-        if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
-            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
-        }
+    /* SGX requires CPUID[0x12] for EPC enumeration */
+    if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
+        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
     }
 
     /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
@@ -8820,7 +8817,6 @@ static const Property x86_cpu_properties[] = {
     DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0),
     DEFINE_PROP_UINT8("avx10-version", X86CPU, env.avx10_version, 0),
     DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
-    DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
     DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
     DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
     DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_features_only, true),
-- 
2.47.1


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

* [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:11   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

The CPUX86State::enable_l3_cache boolean was only disabled
for the pc-q35-2.7 and pc-i440fx-2.7 machines, which got
removed.  Being now always %true, we can remove it and simplify
cpu_x86_cpuid() and encode_cache_cpuid80000006().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/cpu.h |  6 ------
 target/i386/cpu.c | 39 +++++++++++++--------------------------
 2 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index b5cbd91c156..62239b0a562 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2219,12 +2219,6 @@ struct ArchCPU {
      */
     bool enable_lmce;
 
-    /* Compatibility bits for old machine types.
-     * If true present virtual l3 cache for VM, the vcpus in the same virtual
-     * socket share an virtual l3 cache.
-     */
-    bool enable_l3_cache;
-
     /* Compatibility bits for old machine types.
      * If true present L1 cache as per-thread, not per-core.
      */
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6b9a1f2251a..4be174ea9c7 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -468,17 +468,13 @@ static void encode_cache_cpuid80000006(CPUCacheInfo *l2,
            (AMD_ENC_ASSOC(l2->associativity) << 12) |
            (l2->lines_per_tag << 8) | (l2->line_size);
 
-    if (l3) {
-        assert(l3->size % (512 * 1024) == 0);
-        assert(l3->associativity > 0);
-        assert(l3->lines_per_tag > 0);
-        assert(l3->line_size > 0);
-        *edx = ((l3->size / (512 * 1024)) << 18) |
-               (AMD_ENC_ASSOC(l3->associativity) << 12) |
-               (l3->lines_per_tag << 8) | (l3->line_size);
-    } else {
-        *edx = 0;
-    }
+    assert(l3->size % (512 * 1024) == 0);
+    assert(l3->associativity > 0);
+    assert(l3->lines_per_tag > 0);
+    assert(l3->line_size > 0);
+    *edx = ((l3->size / (512 * 1024)) << 18) |
+           (AMD_ENC_ASSOC(l3->associativity) << 12) |
+           (l3->lines_per_tag << 8) | (l3->line_size);
 }
 
 /* Encode cache info for CPUID[8000001D] */
@@ -6849,11 +6845,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         }
         *eax = 1; /* Number of CPUID[EAX=2] calls required */
         *ebx = 0;
-        if (!cpu->enable_l3_cache) {
-            *ecx = 0;
-        } else {
-            *ecx = cpuid2_cache_descriptor(env->cache_info_cpuid2.l3_cache);
-        }
+        *ecx = cpuid2_cache_descriptor(env->cache_info_cpuid2.l3_cache);
         *edx = (cpuid2_cache_descriptor(env->cache_info_cpuid2.l1d_cache) << 16) |
                (cpuid2_cache_descriptor(env->cache_info_cpuid2.l1i_cache) <<  8) |
                (cpuid2_cache_descriptor(env->cache_info_cpuid2.l2_cache));
@@ -6907,13 +6899,10 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
                                     eax, ebx, ecx, edx);
                 break;
             case 3: /* L3 cache info */
-                if (cpu->enable_l3_cache) {
-                    encode_cache_cpuid4(env->cache_info_cpuid4.l3_cache,
-                                        topo_info,
-                                        eax, ebx, ecx, edx);
-                    break;
-                }
-                /* fall through */
+                encode_cache_cpuid4(env->cache_info_cpuid4.l3_cache,
+                                    topo_info,
+                                    eax, ebx, ecx, edx);
+                break;
             default: /* end of info */
                 *eax = *ebx = *ecx = *edx = 0;
                 break;
@@ -7284,8 +7273,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
                (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) |
                (L2_ITLB_4K_ENTRIES);
         encode_cache_cpuid80000006(env->cache_info_amd.l2_cache,
-                                   cpu->enable_l3_cache ?
-                                   env->cache_info_amd.l3_cache : NULL,
+                                   env->cache_info_amd.l3_cache,
                                    ecx, edx);
         break;
     case 0x80000007:
@@ -8821,7 +8809,6 @@ static const Property x86_cpu_properties[] = {
     DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
     DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_features_only, true),
     DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false),
-    DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true),
     DEFINE_PROP_BOOL("kvm-pv-enforce-cpuid", X86CPU, kvm_pv_enforce_cpuid,
                      false),
     DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
-- 
2.47.1


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

* [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (19 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:38   ` Zhao Liu
  2025-05-13  9:02   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

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>
Reviewed-by: Thomas Huth <thuth@redhat.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] 108+ messages in thread

* [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (20 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:38   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  27 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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] 108+ messages in thread

* [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (21 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:41   ` Zhao Liu
  2025-05-13  9:16   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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] 108+ messages in thread

* [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (22 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09 10:32   ` Zhao Liu
  2025-05-13 10:28   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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] 108+ messages in thread

* [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (23 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:43   ` Zhao Liu
  2025-05-13 10:30   ` Igor Mammedov
  2025-05-08 13:35 ` [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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] 108+ messages in thread

* [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (24 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09  9:13   ` Mark Cave-Ayland
  2025-05-09  9:46   ` Zhao Liu
  2025-05-08 13:35 ` [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
  2025-05-13 11:23 ` [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Igor Mammedov
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

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] 108+ messages in thread

* [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (25 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
@ 2025-05-08 13:35 ` Philippe Mathieu-Daudé
  2025-05-09 10:19   ` Zhao Liu
  2025-05-13 10:48   ` Igor Mammedov
  2025-05-13 11:23 ` [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Igor Mammedov
  27 siblings, 2 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-08 13:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Philippe Mathieu-Daudé,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, 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] 108+ messages in thread

* Re: [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
  2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
@ 2025-05-09  2:49   ` Zhao Liu
  2025-05-09 15:33   ` Igor Mammedov
  2025-05-15  8:04   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  2:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:26PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:26 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with
>  '_nodma' suffix
> X-Mailer: git-send-email 2.47.1
> 
> Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma()
> to distinct with the DMA version (currently named
> fw_cfg_init_mem_wide).
> 
> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/hw/nvram/fw_cfg.h | 3 ++-
>  hw/hppa/machine.c         | 2 +-
>  hw/nvram/fw_cfg.c         | 7 +++----
>  3 files changed, 6 insertions(+), 6 deletions(-)

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


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

* Re: [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
  2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
@ 2025-05-09  2:49   ` Zhao Liu
  2025-05-09 15:35   ` Igor Mammedov
  2025-05-15  8:05   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  2:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:27PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:27 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using
>  fw_cfg_init_mem_nodma()
> 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_nodma().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/mips/loongson3_virt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


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

* Re: [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
@ 2025-05-09  2:50   ` Zhao Liu
  2025-05-09 15:38   ` Igor Mammedov
  2025-05-15  8:08   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  2:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:28PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:28 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 05/27] 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 | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)

Fine for me,

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


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

* Re: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
  2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
@ 2025-05-09  2:52   ` Zhao Liu
  2025-05-09  6:51   ` Zhao Liu
  2025-05-15  8:17   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  2:52 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:29PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:29 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() ->
>  fw_cfg_init_mem_dma()
> X-Mailer: git-send-email 2.47.1
> 
> "wide" in fw_cfg_init_mem_wide() means "DMA support".
> Rename for clarity.
> 
> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/hw/nvram/fw_cfg.h | 6 +++---
>  hw/arm/virt.c             | 2 +-
>  hw/nvram/fw_cfg.c         | 6 +++---
>  hw/riscv/virt.c           | 4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)

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


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

* Re: [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-08 13:35 ` [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
@ 2025-05-09  3:23   ` Zhao Liu
  2025-05-09 15:41   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  3:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:30PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:30 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 07/27] 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.
> 
> 'multiboot.bin' isn't used anymore, we'll remove it in the
> next commit.
> 
> 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(-)

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


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

* Re: [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin
  2025-05-08 13:35 ` [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin Philippe Mathieu-Daudé
@ 2025-05-09  6:11   ` Zhao Liu
  0 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  6:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Thomas Huth

On Thu, May 08, 2025 at 03:35:31PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:31 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin
> X-Mailer: git-send-email 2.47.1
> 
> All PC machines now use the multiboot_dma.bin binary,
> we can remove the non-DMA version (multiboot.bin).
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  pc-bios/optionrom/optionrom.h     |   4 -
>  hw/i386/pc.c                      |   1 -
>  pc-bios/meson.build               |   1 -
>  pc-bios/multiboot.bin             | Bin 1024 -> 0 bytes
>  pc-bios/optionrom/Makefile        |   2 +-
>  pc-bios/optionrom/multiboot.S     | 232 -----------------------------
>  pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++++++++++++++++++++-
>  7 files changed, 233 insertions(+), 241 deletions(-)
>  delete mode 100644 pc-bios/multiboot.bin
>  delete mode 100644 pc-bios/optionrom/multiboot.S
> 
> diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
> index 7bcdf0eeb24..2e6e2493f83 100644
> --- a/pc-bios/optionrom/optionrom.h
> +++ b/pc-bios/optionrom/optionrom.h
> @@ -117,16 +117,12 @@
>   *
>   * Clobbers: %eax, %edx, %es, %ecx, %edi and adresses %esp-20 to %esp
>   */
> -#ifdef USE_FW_CFG_DMA
>  #define read_fw_blob_dma(var)                           \
>          read_fw         var ## _SIZE;                   \
>          mov             %eax, %ecx;                     \
>          read_fw         var ## _ADDR;                   \
>          mov             %eax, %edi ;                    \
>          read_fw_dma     var ## _DATA, %ecx, %edi
> -#else
> -#define read_fw_blob_dma(var) read_fw_blob(var)
> -#endif

It seems read_fw_blob() could be dropped as well and this is not a big
deal. So,

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


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

* Re: [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  2025-05-08 13:35 ` [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
@ 2025-05-09  6:37   ` Zhao Liu
  2025-05-09 16:00   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  6:37 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:32PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:32 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 09/27] 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_nodma
>   hw/hppa/machine.c:204:    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);
>   hw/mips/loongson3_virt.c:289:    fw_cfg = fw_cfg_init_mem_nodma(cfg_addr, cfg_addr + 8, 8);
> 
> 'linuxboot.bin' isn't used anymore, we'll remove it in the
> next commit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>  hw/i386/fw_cfg.c     |  5 +----
>  hw/i386/x86-common.c |  5 +----
>  hw/nvram/fw_cfg.c    | 26 ++++++++------------------
>  3 files changed, 10 insertions(+), 26 deletions(-)
> 
> diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
> index 5c0bcd5f8a9..1fe084fd720 100644
> --- a/hw/i386/fw_cfg.c
> +++ b/hw/i386/fw_cfg.c
> @@ -221,10 +221,7 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
>       * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
>       * DMA control register is located at FW_CFG_DMA_IO_BASE + 4
>       */
> -    Object *obj = OBJECT(fw_cfg);
> -    uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ?
> -        ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
> -        FW_CFG_CTL_SIZE;
> +    uint8_t io_size = ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t);
>      Aml *dev = aml_device("FWCF");
>      Aml *crs = aml_resource_template();
>  
> diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
> index 27254a0e9f1..ee594364415 100644
> --- a/hw/i386/x86-common.c
> +++ b/hw/i386/x86-common.c
> @@ -991,10 +991,7 @@ void x86_load_linux(X86MachineState *x86ms,
>      }
>  
>      option_rom[nb_option_roms].bootindex = 0;
> -    option_rom[nb_option_roms].name = "linuxboot.bin";
> -    if (fw_cfg_dma_enabled(fw_cfg)) {
> -        option_rom[nb_option_roms].name = "linuxboot_dma.bin";
> -    }
> +    option_rom[nb_option_roms].name = "linuxboot_dma.bin";
>      nb_option_roms++;
>  }
>  
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 51b028b5d0a..ef976a4bce2 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);

Maybe a rebase nit? In v3, it is:

assert(dma_iobase && dma_as);

Others are fine for me.


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

* Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field
  2025-05-08 13:35 ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Philippe Mathieu-Daudé
@ 2025-05-09  6:49   ` Xiaoyao Li
  2025-05-09  7:32     ` Zhao Liu
  0 siblings, 1 reply; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-09  6:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> The CPUX86State::enable_cpuid_0xb boolean was only disabled
> for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> removed. Being now always %true, we can remove it and simplify
> cpu_x86_cpuid().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/i386/cpu.h | 3 ---
>   target/i386/cpu.c | 6 ------
>   2 files changed, 9 deletions(-)
> 
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 0db70a70439..06817a31cf9 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2241,9 +2241,6 @@ struct ArchCPU {
>        */
>       bool legacy_multi_node;
>   
> -    /* Compatibility bits for old machine types: */
> -    bool enable_cpuid_0xb;
> -
>       /* Enable auto level-increase for all CPUID leaves */
>       bool full_cpuid_auto_level;
>   
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 49179f35812..6fe37f71b1e 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
>           break;
>       case 0xB:
>           /* Extended Topology Enumeration Leaf */
> -        if (!cpu->enable_cpuid_0xb) {
> -                *eax = *ebx = *ecx = *edx = 0;
> -                break;
> -        }
> -
>           *ecx = count & 0xff;
>           *edx = cpu->apic_id;
>   
> @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
>       DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
>       DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
>       DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
> -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),

It's deprecating the "cpuid-0xb" property.

I think we need go with the standard process to deprecate it.

>       DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
>       DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_features_only, true),
>       DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false),


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

* Re: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
  2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
  2025-05-09  2:52   ` Zhao Liu
@ 2025-05-09  6:51   ` Zhao Liu
  2025-05-09 15:39     ` Igor Mammedov
  2025-05-15  8:17   ` Xiaoyao Li
  2 siblings, 1 reply; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  6:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:29PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:29 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() ->
>  fw_cfg_init_mem_dma()
> X-Mailer: git-send-email 2.47.1
> 
> "wide" in fw_cfg_init_mem_wide() means "DMA support".
> Rename for clarity.
> 
> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/hw/nvram/fw_cfg.h | 6 +++---
>  hw/arm/virt.c             | 2 +-
>  hw/nvram/fw_cfg.c         | 6 +++---
>  hw/riscv/virt.c           | 4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> index d5161a79436..c4c49886754 100644
> --- a/include/hw/nvram/fw_cfg.h
> +++ b/include/hw/nvram/fw_cfg.h
> @@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
>                                  AddressSpace *dma_as);
>  FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
>                                    unsigned data_width);
> -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
> -                                 hwaddr data_addr, uint32_t data_width,
> -                                 hwaddr dma_addr, AddressSpace *dma_as);
> +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
> +                                hwaddr data_addr, uint32_t data_width,
> +                                hwaddr dma_addr, AddressSpace *dma_as);

There's one more use in latest master:

git grep fw_cfg_init_mem_wide
hw/loongarch/fw_cfg.c:    fw_cfg = fw_cfg_init_mem_wide(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, 8,


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

* Re: [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin
  2025-05-08 13:35 ` [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin Philippe Mathieu-Daudé
@ 2025-05-09  6:53   ` Zhao Liu
  2025-05-09 16:04   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  6:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Thomas Huth

On Thu, May 08, 2025 at 03:35:33PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:33 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin
> X-Mailer: git-send-email 2.47.1
> 
> All PC machines now use the linuxboot_dma.bin binary,
> we can remove the non-DMA version (linuxboot.bin).
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/i386/pc.c                  |   3 +-
>  pc-bios/meson.build           |   1 -
>  pc-bios/optionrom/Makefile    |   2 +-
>  pc-bios/optionrom/linuxboot.S | 195 ----------------------------------
>  4 files changed, 2 insertions(+), 199 deletions(-)
>  delete mode 100644 pc-bios/optionrom/linuxboot.S

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


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

* Re: [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array
  2025-05-08 13:35 ` [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-09  6:54   ` Zhao Liu
  2025-05-12  8:19   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  6:54 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:34PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:34 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 11/27] 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.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] 108+ messages in thread

* Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field
  2025-05-09  6:49   ` Xiaoyao Li
@ 2025-05-09  7:32     ` Zhao Liu
  2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
  2025-05-12 15:00       ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Igor Mammedov
  0 siblings, 2 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  7:32 UTC (permalink / raw)
  To: Xiaoyao Li, Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote:
> Date: Fri, 9 May 2025 14:49:27 +0800
> From: Xiaoyao Li <xiaoyao.li@intel.com>
> Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove
>  CPUX86State::enable_cpuid_0xb field
> 
> On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> > The CPUX86State::enable_cpuid_0xb boolean was only disabled
> > for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> > removed. Being now always %true, we can remove it and simplify
> > cpu_x86_cpuid().
> > 
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> >   target/i386/cpu.h | 3 ---
> >   target/i386/cpu.c | 6 ------
> >   2 files changed, 9 deletions(-)
> > 
> > diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> > index 0db70a70439..06817a31cf9 100644
> > --- a/target/i386/cpu.h
> > +++ b/target/i386/cpu.h
> > @@ -2241,9 +2241,6 @@ struct ArchCPU {
> >        */
> >       bool legacy_multi_node;
> > -    /* Compatibility bits for old machine types: */
> > -    bool enable_cpuid_0xb;
> > -
> >       /* Enable auto level-increase for all CPUID leaves */
> >       bool full_cpuid_auto_level;
> > diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> > index 49179f35812..6fe37f71b1e 100644
> > --- a/target/i386/cpu.c
> > +++ b/target/i386/cpu.c
> > @@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> >           break;
> >       case 0xB:
> >           /* Extended Topology Enumeration Leaf */
> > -        if (!cpu->enable_cpuid_0xb) {
> > -                *eax = *ebx = *ecx = *edx = 0;
> > -                break;
> > -        }
> > -
> >           *ecx = count & 0xff;
> >           *edx = cpu->apic_id;
> > @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
> >       DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
> >       DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
> >       DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
> > -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
> 
> It's deprecating the "cpuid-0xb" property.
> 
> I think we need go with the standard process to deprecate it.

Thanks! I got your point.

Though this property is introduced for compatibility, as its comment
said "Compatibility bits for old machine types", it is also useful for 
somer users.

Fo example, in the early development stages of TDX, when there was no
full support for CPU topology, Intel had disable this property for
testing and found this bug:

https://lore.kernel.org/qemu-devel/20250227062523.124601-3-zhao1.liu@intel.com/

So, I think there may be other similar use cases as well.

And, if someone wants to emulate ancient x86 CPUs (though I can't
currently confirm from which generation of CPUs 0xb support started), he
may want to consider disable this property as well.

The main problem here is that the "property" mechanism doesn't
distinguish between internal use/public use, and although it was originally
intended for internal QEMU use, it also leaks to the user, creating some
external use cases.

@Philippe, thank you for cleaning up this case! I think we can keep this
property, and if you don't mind, I can modify its comment later to
indicate that it's used to adjust the topology support for the CPU.

Thanks,
Zhao


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

* Re: [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field
  2025-05-08 13:35 ` [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field Philippe Mathieu-Daudé
@ 2025-05-09  9:11   ` Zhao Liu
  2025-05-13 11:14     ` Igor Mammedov
  0 siblings, 1 reply; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:43PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:43 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 20/27] target/i386/cpu: Remove
>  CPUX86State::enable_l3_cache field
> X-Mailer: git-send-email 2.47.1
> 
> The CPUX86State::enable_l3_cache boolean was only disabled
> for the pc-q35-2.7 and pc-i440fx-2.7 machines, which got
> removed.  Being now always %true, we can remove it and simplify
> cpu_x86_cpuid() and encode_cache_cpuid80000006().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/cpu.h |  6 ------
>  target/i386/cpu.c | 39 +++++++++++++--------------------------
>  2 files changed, 13 insertions(+), 32 deletions(-)
> 
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index b5cbd91c156..62239b0a562 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2219,12 +2219,6 @@ struct ArchCPU {
>       */
>      bool enable_lmce;
>  
> -    /* Compatibility bits for old machine types.
> -     * If true present virtual l3 cache for VM, the vcpus in the same virtual
> -     * socket share an virtual l3 cache.
> -     */
> -    bool enable_l3_cache;
> -
>      /* Compatibility bits for old machine types.
>       * If true present L1 cache as per-thread, not per-core.
>       */

I realize this is another special case.

There is no support for hybrid x86 CPUs in QEMU, but it's also true that
there are some actual modern x86 Client CPUs without l3 cache, such as
Intel MTL's low power E core (and it has vmx support, i.e., support KVM).

So I think we can keep this property as well, to have some more
configuration options for users' emulation.



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

* Re: [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property
  2025-05-08 13:35 ` [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
@ 2025-05-09  9:13   ` Mark Cave-Ayland
  2025-05-09  9:46   ` Zhao Liu
  1 sibling, 0 replies; 108+ messages in thread
From: Mark Cave-Ayland @ 2025-05-09  9:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 08/05/2025 14:35, Philippe Mathieu-Daudé wrote:

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

LGTM.

Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>


ATB,

Mark.


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

* Re: [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field
  2025-05-08 13:35 ` [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field Philippe Mathieu-Daudé
@ 2025-05-09  9:30   ` Zhao Liu
  2025-05-12 15:24   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:36PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:36 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 13/27] target/i386/cpu: Remove
>  CPUX86State::fill_mtrr_mask field
> X-Mailer: git-send-email 2.47.1
> 
> The CPUX86State::fill_mtrr_mask boolean was only disabled
> for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> removed. Being now always %true, we can remove it and simplify
> kvm_get_msrs().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/cpu.h     |  3 ---
>  target/i386/cpu.c     |  1 -
>  target/i386/kvm/kvm.c | 10 +++-------
>  3 files changed, 3 insertions(+), 11 deletions(-)

No case found for external user use, so,

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


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

* Re: [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field
  2025-05-08 13:35 ` [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
@ 2025-05-09  9:30   ` Zhao Liu
  2025-05-13  8:34   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:37PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:37 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 14/27] hw/intc/apic: Remove
>  APICCommonState::legacy_instance_id field
> X-Mailer: git-send-email 2.47.1
> 
> 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  include/hw/i386/apic_internal.h | 1 -
>  hw/intc/apic_common.c           | 5 -----
>  2 files changed, 6 deletions(-)

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


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

* Re: [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array
  2025-05-08 13:35 ` [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
@ 2025-05-09  9:31   ` Zhao Liu
  2025-05-13  8:36   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:38PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:38 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array
> X-Mailer: git-send-email 2.47.1
> 
> 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  include/hw/boards.h | 3 ---
>  hw/core/machine.c   | 8 --------
>  2 files changed, 11 deletions(-)

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


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

* Re: [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field
  2025-05-08 13:35 ` [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
@ 2025-05-09  9:33   ` Zhao Liu
  0 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:39PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:39 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove
>  VirtIOMMIOProxy::format_transport_address field
> X-Mailer: git-send-email 2.47.1
> 
> 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  include/hw/virtio/virtio-mmio.h |  1 -
>  hw/virtio/virtio-mmio.c         | 15 ---------------
>  2 files changed, 16 deletions(-)

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


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

* Re: [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-08 13:35 ` [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
@ 2025-05-09  9:33   ` Zhao Liu
  2025-05-13  8:53   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:40PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:40 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and
>  pc-i440fx-2.7 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.  Remove the qtest
> in test-x86-cpuid-compat.c file.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/i386/pc_piix.c                   |  9 ---------
>  hw/i386/pc_q35.c                    | 10 ----------
>  tests/qtest/test-x86-cpuid-compat.c | 11 -----------
>  3 files changed, 30 deletions(-)

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


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

* Re: [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array
  2025-05-08 13:35 ` [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-09  9:35   ` Zhao Liu
  0 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:35 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:41PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:41 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* Re: [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field
  2025-05-08 13:35 ` [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Philippe Mathieu-Daudé
@ 2025-05-09  9:37   ` Zhao Liu
  2025-05-13 11:02   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:37 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:42PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:42 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 19/27] target/i386/cpu: Remove
>  CPUX86State::full_cpuid_auto_level field
> X-Mailer: git-send-email 2.47.1
> 
> The CPUX86State::full_cpuid_auto_level boolean was only
> disabled for the pc-q35-2.7 and pc-i440fx-2.7 machines,
> which got removed. Being now always %true, we can remove
> it and simplify x86_cpu_expand_features().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/cpu.h |   3 --
>  target/i386/cpu.c | 106 ++++++++++++++++++++++------------------------
>  2 files changed, 51 insertions(+), 58 deletions(-)

This property is a fix, so,

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


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

* Re: [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field
  2025-05-08 13:35 ` [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
@ 2025-05-09  9:38   ` Zhao Liu
  2025-05-13  9:02   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu, May 08, 2025 at 03:35:44PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:44 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field
> X-Mailer: git-send-email 2.47.1
> 
> 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/audio/pcspk.c | 10 ----------
>  1 file changed, 10 deletions(-)

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


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

* Re: [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array
  2025-05-08 13:35 ` [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
@ 2025-05-09  9:38   ` Zhao Liu
  0 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:45PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:45 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* Re: [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
  2025-05-08 13:35 ` [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
@ 2025-05-09  9:41   ` Zhao Liu
  2025-05-13  9:16   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:46PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:46 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 23/27] hw/i386/intel_iommu: Remove
>  IntelIOMMUState::buggy_eim field
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

This property has a good name :-)

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


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

* Re: [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
  2025-05-08 13:35 ` [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
@ 2025-05-09  9:43   ` Zhao Liu
  2025-05-13 10:30   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:48PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:48 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 25/27] hw/virtio/virtio-pci: Remove
>  VirtIOPCIProxy::ignore_backend_features field
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* Re: [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property
  2025-05-08 13:35 ` [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
  2025-05-09  9:13   ` Mark Cave-Ayland
@ 2025-05-09  9:46   ` Zhao Liu
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09  9:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu, May 08, 2025 at 03:35:49PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:49 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the
>  'emergency-write' property
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)
  2025-05-09  7:32     ` Zhao Liu
@ 2025-05-09 10:04       ` Thomas Huth
  2025-05-12  2:45         ` Zhao Liu
                           ` (2 more replies)
  2025-05-12 15:00       ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Igor Mammedov
  1 sibling, 3 replies; 108+ messages in thread
From: Thomas Huth @ 2025-05-09 10:04 UTC (permalink / raw)
  To: Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Markus Armbruster, Paolo Bonzini, Daniel P. Berrange
  Cc: qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Peter Maydell,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 09/05/2025 09.32, Zhao Liu wrote:
> On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote:
>> Date: Fri, 9 May 2025 14:49:27 +0800
>> From: Xiaoyao Li <xiaoyao.li@intel.com>
>> Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove
>>   CPUX86State::enable_cpuid_0xb field
>>
>> On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
>>> The CPUX86State::enable_cpuid_0xb boolean was only disabled
>>> for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
>>> removed. Being now always %true, we can remove it and simplify
>>> cpu_x86_cpuid().
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>>    target/i386/cpu.h | 3 ---
>>>    target/i386/cpu.c | 6 ------
>>>    2 files changed, 9 deletions(-)
>>>
>>> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
>>> index 0db70a70439..06817a31cf9 100644
>>> --- a/target/i386/cpu.h
>>> +++ b/target/i386/cpu.h
>>> @@ -2241,9 +2241,6 @@ struct ArchCPU {
>>>         */
>>>        bool legacy_multi_node;
>>> -    /* Compatibility bits for old machine types: */
>>> -    bool enable_cpuid_0xb;
>>> -
>>>        /* Enable auto level-increase for all CPUID leaves */
>>>        bool full_cpuid_auto_level;
>>> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
>>> index 49179f35812..6fe37f71b1e 100644
>>> --- a/target/i386/cpu.c
>>> +++ b/target/i386/cpu.c
>>> @@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
>>>            break;
>>>        case 0xB:
>>>            /* Extended Topology Enumeration Leaf */
>>> -        if (!cpu->enable_cpuid_0xb) {
>>> -                *eax = *ebx = *ecx = *edx = 0;
>>> -                break;
>>> -        }
>>> -
>>>            *ecx = count & 0xff;
>>>            *edx = cpu->apic_id;
>>> @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
>>>        DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
>>>        DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
>>>        DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
>>> -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
>>
>> It's deprecating the "cpuid-0xb" property.
>>
>> I think we need go with the standard process to deprecate it.
> 
> Thanks! I got your point.
> 
> Though this property is introduced for compatibility, as its comment
> said "Compatibility bits for old machine types", it is also useful for
> somer users.

Thanks for your clarifications, Zhao! But I think this shows again the 
problem that we have hit a couple of times in the past already: Properties 
are currently used for both, config knobs for the users and internal 
switches for configuration of the machine. We lack a proper way to say "this 
property is usable for the user" and "this property is meant for internal 
configuration only".

I wonder whether we could maybe come up with a naming scheme to better 
distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix 
for experimental properties? We could e.g. say that all properties starting 
with a "q-" are meant for QEMU-internal configuration only or something 
similar (and maybe even hide those from the default help output when running 
"-device xyz,help" ?)? Anybody any opinions or better ideas on this?

  Thomas


> Fo example, in the early development stages of TDX, when there was no
> full support for CPU topology, Intel had disable this property for
> testing and found this bug:
> 
> https://lore.kernel.org/qemu-devel/20250227062523.124601-3-zhao1.liu@intel.com/
> 
> So, I think there may be other similar use cases as well.
> 
> And, if someone wants to emulate ancient x86 CPUs (though I can't
> currently confirm from which generation of CPUs 0xb support started), he
> may want to consider disable this property as well.
> 
> The main problem here is that the "property" mechanism doesn't
> distinguish between internal use/public use, and although it was originally
> intended for internal QEMU use, it also leaks to the user, creating some
> external use cases.
> 
> @Philippe, thank you for cleaning up this case! I think we can keep this
> property, and if you don't mind, I can modify its comment later to
> indicate that it's used to adjust the topology support for the CPU.
> 
> Thanks,
> Zhao
> 
> 


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

* Re: [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
  2025-05-08 13:35 ` [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
@ 2025-05-09 10:19   ` Zhao Liu
  2025-05-13 10:48   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09 10:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:50PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:50 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 27/27] hw/virtio/virtio-pci: Remove
>  VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* Re: [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field
  2025-05-08 13:35 ` [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
@ 2025-05-09 10:32   ` Zhao Liu
  2025-05-13 10:28   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-09 10:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu, May 08, 2025 at 03:35:47PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu,  8 May 2025 15:35:47 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version
>  field
> X-Mailer: git-send-email 2.47.1
> 
> 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(-)

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


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

* Re: [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field
  2025-05-08 13:35 ` [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
@ 2025-05-09 15:18   ` Igor Mammedov
  0 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:25 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> 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>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.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/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,
                                           ^^^^^
that still leaves legacy CPU hotplug hardware around, which we should remove
at the same time as legacy AML.

i.e.:
  drop _INI in hw/acpi/cpu.c
  and at the same time replace legacy_acpi_cpu_hotplug_init() at call sites with
  cpu_hotplug_hw_init()
  after that you can safely remove legacy_cpu_hotplug and no longer needed hw/acpi/cpu_hotplug.c && co


>              .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,


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

* Re: [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-05-08 13:35 ` [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
@ 2025-05-09 15:23   ` Igor Mammedov
  2025-06-02  6:13     ` Thomas Huth
  0 siblings, 1 reply; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:24 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> 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.

if these machine types are the last users of compat arrays,
it's better to remove array at the same time, aka squash
those patches later in series into this one.
That leaves no illusion that compats could be used in the later patches.
 
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.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);


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

* Re: [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
  2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
@ 2025-05-09 15:33   ` Igor Mammedov
  2025-05-15  8:04   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:26 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma()
> to distinct with the DMA version (currently named
> fw_cfg_init_mem_wide).
> 
> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  include/hw/nvram/fw_cfg.h | 3 ++-
>  hw/hppa/machine.c         | 2 +-
>  hw/nvram/fw_cfg.c         | 7 +++----
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> index d41b9328fd1..d5161a79436 100644
> --- a/include/hw/nvram/fw_cfg.h
> +++ b/include/hw/nvram/fw_cfg.h
> @@ -307,7 +307,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s,
>  
>  FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
>                                  AddressSpace *dma_as);
> -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
> +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
> +                                  unsigned data_width);
>  FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
>                                   hwaddr data_addr, uint32_t data_width,
>                                   hwaddr dma_addr, AddressSpace *dma_as);
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index dacedc5409c..0d768cb90b0 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -201,7 +201,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus,
>      int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env);
>      int len;
>  
> -    fw_cfg = fw_cfg_init_mem(addr, addr + 4);
> +    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);
>      fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus);
>      fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS);
>      fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 54cfa07d3f5..10f8f8db86f 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -1087,11 +1087,10 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
>      return s;
>  }
>  
> -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)
> +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
> +                                  unsigned data_width)
>  {
> -    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_wide(ctl_addr, data_addr, data_width, 0, NULL);
>  }
>  
>  


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

* Re: [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
  2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
@ 2025-05-09 15:35   ` Igor Mammedov
  2025-05-15  8:05   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:35 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:27 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> fw_cfg_init_mem_wide() is prefered to initialize fw_cfg
> with DMA support. Without DMA, use fw_cfg_init_mem_nodma().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  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..654a2f0999f 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);

just a question, given it's a rather modern machine is there a reason
why it is not using DMA here?

> +    fw_cfg = fw_cfg_init_mem_nodma(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);


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

* Re: [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
  2025-05-09  2:50   ` Zhao Liu
@ 2025-05-09 15:38   ` Igor Mammedov
  2025-05-15  8:08   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:28 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/nvram/fw_cfg.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 10f8f8db86f..4067324fb09 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,10 +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_addr && dma_as);
> +    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr,
> +                                    dma_addr, dma_as);
> +}
> +
>  FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
>                                    unsigned data_width)
>  {
> -    return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL);
> +    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, 0, NULL);
>  }
>  
>  


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

* Re: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
  2025-05-09  6:51   ` Zhao Liu
@ 2025-05-09 15:39     ` Igor Mammedov
  0 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:39 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Philippe Mathieu-Daudé, qemu-devel, Richard Henderson, kvm,
	Sergio Lopez, Gerd Hoffmann, Peter Maydell, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, 9 May 2025 14:51:07 +0800
Zhao Liu <zhao1.liu@intel.com> wrote:

> On Thu, May 08, 2025 at 03:35:29PM +0200, Philippe Mathieu-Daudé wrote:
> > Date: Thu,  8 May 2025 15:35:29 +0200
> > From: Philippe Mathieu-Daudé <philmd@linaro.org>
> > Subject: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() ->
> >  fw_cfg_init_mem_dma()
> > X-Mailer: git-send-email 2.47.1
> > 
> > "wide" in fw_cfg_init_mem_wide() means "DMA support".
> > Rename for clarity.
> > 
> > Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> >  include/hw/nvram/fw_cfg.h | 6 +++---
> >  hw/arm/virt.c             | 2 +-
> >  hw/nvram/fw_cfg.c         | 6 +++---
> >  hw/riscv/virt.c           | 4 ++--
> >  4 files changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> > index d5161a79436..c4c49886754 100644
> > --- a/include/hw/nvram/fw_cfg.h
> > +++ b/include/hw/nvram/fw_cfg.h
> > @@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
> >                                  AddressSpace *dma_as);
> >  FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
> >                                    unsigned data_width);
> > -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
> > -                                 hwaddr data_addr, uint32_t data_width,
> > -                                 hwaddr dma_addr, AddressSpace *dma_as);
> > +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
> > +                                hwaddr data_addr, uint32_t data_width,
> > +                                hwaddr dma_addr, AddressSpace *dma_as);  
> 
> There's one more use in latest master:
> 
> git grep fw_cfg_init_mem_wide
> hw/loongarch/fw_cfg.c:    fw_cfg = fw_cfg_init_mem_wide(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, 8,

with that fixed:
  Reviewed-by: Igor Mammedov <imammedo@redhat.com>


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

* Re: [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-08 13:35 ` [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
  2025-05-09  3:23   ` Zhao Liu
@ 2025-05-09 15:41   ` Igor Mammedov
  2025-05-09 15:44     ` Igor Mammedov
  1 sibling, 1 reply; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:30 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> 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.
> 
> 'multiboot.bin' isn't used anymore, we'll remove it in the
> next commit.
> 
> 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";

shouldn't we remove "multiboot.bin" as well?

> -    }
> +    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",


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

* Re: [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field
  2025-05-09 15:41   ` Igor Mammedov
@ 2025-05-09 15:44     ` Igor Mammedov
  0 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 15:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, 9 May 2025 17:41:25 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> On Thu,  8 May 2025 15:35:30 +0200
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 
> > 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.
> > 
> > 'multiboot.bin' isn't used anymore, we'll remove it in the
> > next commit.
> > 
> > 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";  
> 
> shouldn't we remove "multiboot.bin" as well?

never mind, I see it's being removed by the next patch

Reviewed-by: Igor Mammedov <imammedo@redhat.com>


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

* Re: [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled
  2025-05-08 13:35 ` [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
  2025-05-09  6:37   ` Zhao Liu
@ 2025-05-09 16:00   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 16:00 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:32 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> 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_nodma
>   hw/hppa/machine.c:204:    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);
>   hw/mips/loongson3_virt.c:289:    fw_cfg = fw_cfg_init_mem_nodma(cfg_addr, cfg_addr + 8, 8);
> 
> 'linuxboot.bin' isn't used anymore, we'll remove it in the
> next commit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>  hw/i386/fw_cfg.c     |  5 +----
>  hw/i386/x86-common.c |  5 +----
>  hw/nvram/fw_cfg.c    | 26 ++++++++------------------
>  3 files changed, 10 insertions(+), 26 deletions(-)
> 
> diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
> index 5c0bcd5f8a9..1fe084fd720 100644
> --- a/hw/i386/fw_cfg.c
> +++ b/hw/i386/fw_cfg.c
> @@ -221,10 +221,7 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
>       * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
>       * DMA control register is located at FW_CFG_DMA_IO_BASE + 4
>       */
> -    Object *obj = OBJECT(fw_cfg);
> -    uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ?
> -        ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
> -        FW_CFG_CTL_SIZE;
> +    uint8_t io_size = ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t);
>      Aml *dev = aml_device("FWCF");
>      Aml *crs = aml_resource_template();
>  
> diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
> index 27254a0e9f1..ee594364415 100644
> --- a/hw/i386/x86-common.c
> +++ b/hw/i386/x86-common.c
> @@ -991,10 +991,7 @@ void x86_load_linux(X86MachineState *x86ms,
>      }
>  
>      option_rom[nb_option_roms].bootindex = 0;
> -    option_rom[nb_option_roms].name = "linuxboot.bin";
> -    if (fw_cfg_dma_enabled(fw_cfg)) {
> -        option_rom[nb_option_roms].name = "linuxboot_dma.bin";
> -    }
> +    option_rom[nb_option_roms].name = "linuxboot_dma.bin";
>      nb_option_roms++;
>  }
>  
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 51b028b5d0a..ef976a4bce2 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);
>      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),

in 7/27 you still have, fw_cfg_dma_enabled(fw_cfg) which works around
now missing property (in IO case) in obscure way.
that is also used in bios_linker_loader_can_write_pointer().

It would be better to get rid of fw_cfg_dma_enabled() as well
or keep property as RO and replace fw_cfg_dma_enabled() with property
accessor if both calls can happen on nondma path                      


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


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

* Re: [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin
  2025-05-08 13:35 ` [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin Philippe Mathieu-Daudé
  2025-05-09  6:53   ` Zhao Liu
@ 2025-05-09 16:04   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-09 16:04 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Thomas Huth

On Thu,  8 May 2025 15:35:33 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> All PC machines now use the linuxboot_dma.bin binary,
> we can remove the non-DMA version (linuxboot.bin).
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/i386/pc.c                  |   3 +-


linuxboot.bin is referenced in a few more files:

hw/i386/x86-common.c:    option_rom[nb_option_roms].name = "linuxboot.bin";
hw/nvram/fw_cfg.c:    { "genroms/linuxboot.bin", 60 },

are you sure we should keep it there?

>  pc-bios/meson.build           |   1 -
>  pc-bios/optionrom/Makefile    |   2 +-
>  pc-bios/optionrom/linuxboot.S | 195 ----------------------------------
>  4 files changed, 2 insertions(+), 199 deletions(-)
>  delete mode 100644 pc-bios/optionrom/linuxboot.S
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 524d2fd98e8..4e6fe68e2e0 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -654,8 +654,7 @@ void xen_load_linux(PCMachineState *pcms)
>  
>      x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled);
>      for (i = 0; i < nb_option_roms; i++) {
> -        assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
> -               !strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
> +        assert(!strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
>                 !strcmp(option_rom[i].name, "pvh.bin") ||
>                 !strcmp(option_rom[i].name, "multiboot_dma.bin"));
>          rom_add_option(option_rom[i].name, option_rom[i].bootindex);
> diff --git a/pc-bios/meson.build b/pc-bios/meson.build
> index f2d4dc416a4..39a7fea332e 100644
> --- a/pc-bios/meson.build
> +++ b/pc-bios/meson.build
> @@ -63,7 +63,6 @@ blobs = [
>    'efi-vmxnet3.rom',
>    'qemu-nsis.bmp',
>    'multiboot_dma.bin',
> -  'linuxboot.bin',
>    'linuxboot_dma.bin',
>    'kvmvapic.bin',
>    'pvh.bin',
> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> index 1183ef88922..e694c7aac00 100644
> --- a/pc-bios/optionrom/Makefile
> +++ b/pc-bios/optionrom/Makefile
> @@ -2,7 +2,7 @@ include config.mak
>  SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom
>  VPATH = $(SRC_DIR)
>  
> -all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
> +all: multiboot_dma.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
>  # Dummy command so that make thinks it has done something
>  	@true
>  
> diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
> deleted file mode 100644
> index ba821ab922d..00000000000
> --- a/pc-bios/optionrom/linuxboot.S
> +++ /dev/null
> @@ -1,195 +0,0 @@
> -/*
> - * Linux Boot Option ROM
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, see <http://www.gnu.org/licenses/>.
> - *
> - * Copyright Novell Inc, 2009
> - *   Authors: Alexander Graf <agraf@suse.de>
> - *
> - * Based on code in hw/pc.c.
> - */
> -
> -#include "optionrom.h"
> -
> -#define BOOT_ROM_PRODUCT "Linux loader"
> -
> -BOOT_ROM_START
> -
> -run_linuxboot:
> -
> -	cli
> -	cld
> -
> -	jmp		copy_kernel
> -boot_kernel:
> -
> -	read_fw		FW_CFG_SETUP_ADDR
> -
> -	mov		%eax, %ebx
> -	shr		$4, %ebx
> -
> -	/* All segments contain real_addr */
> -	mov		%bx, %ds
> -	mov		%bx, %es
> -	mov		%bx, %fs
> -	mov		%bx, %gs
> -	mov		%bx, %ss
> -
> -	/* CX = CS we want to jump to */
> -	add		$0x20, %bx
> -	mov		%bx, %cx
> -
> -	/* SP = cmdline_addr-real_addr-16 */
> -	read_fw		FW_CFG_CMDLINE_ADDR
> -	mov		%eax, %ebx
> -	read_fw		FW_CFG_SETUP_ADDR
> -	sub		%eax, %ebx
> -	sub		$16, %ebx
> -	mov		%ebx, %esp
> -
> -	/* Build indirect lret descriptor */
> -	pushw		%cx		/* CS */
> -	xor		%ax, %ax
> -	pushw		%ax		/* IP = 0 */
> -
> -	/* Clear registers */
> -	xor		%eax, %eax
> -	xor		%ebx, %ebx
> -	xor		%ecx, %ecx
> -	xor		%edx, %edx
> -	xor		%edi, %edi
> -	xor		%ebp, %ebp
> -
> -	/* Jump to Linux */
> -	lret
> -
> -
> -copy_kernel:
> -	/* Read info block in low memory (0x10000 or 0x90000) */
> -	read_fw		FW_CFG_SETUP_ADDR
> -	shr		$4, %eax
> -	mov		%eax, %es
> -	xor		%edi, %edi
> -	read_fw_blob_addr32_edi(FW_CFG_SETUP)
> -
> -	cmpw            $0x203, %es:0x206      // if protocol >= 0x203
> -	jae             1f                     // have initrd_max
> -	movl            $0x37ffffff, %es:0x22c // else assume 0x37ffffff
> -1:
> -
> -	/* Check if using kernel-specified initrd address */
> -	read_fw		FW_CFG_INITRD_ADDR
> -	mov		%eax, %edi             // (load_kernel wants it in %edi)
> -	read_fw		FW_CFG_INITRD_SIZE     // find end of initrd
> -	add		%edi, %eax
> -	xor		%es:0x22c, %eax        // if it matches es:0x22c
> -	and		$-4096, %eax           // (apart from padding for page)
> -	jz		load_kernel            // then initrd is not at top
> -					       // of memory
> -
> -	/* pc.c placed the initrd at end of memory.  Compute a better
> -	 * initrd address based on e801 data.
> -	 */
> -	mov		$0xe801, %ax
> -	xor		%cx, %cx
> -	xor		%dx, %dx
> -	int		$0x15
> -
> -	/* Output could be in AX/BX or CX/DX */
> -	or		%cx, %cx
> -	jnz		1f
> -	or		%dx, %dx
> -	jnz		1f
> -	mov		%ax, %cx
> -	mov		%bx, %dx
> -1:
> -
> -	or		%dx, %dx
> -	jnz		2f
> -	addw		$1024, %cx            /* add 1 MB */
> -	movzwl		%cx, %edi
> -	shll		$10, %edi             /* convert to bytes */
> -	jmp		3f
> -
> -2:
> -	addw		$16777216 >> 16, %dx  /* add 16 MB */
> -	movzwl		%dx, %edi
> -	shll		$16, %edi             /* convert to bytes */
> -
> -3:
> -	read_fw         FW_CFG_INITRD_SIZE
> -	subl            %eax, %edi
> -	andl            $-4096, %edi          /* EDI = start of initrd */
> -	movl		%edi, %es:0x218       /* put it in the header */
> -
> -load_kernel:
> -	/* We need to load the kernel into memory we can't access in 16 bit
> -	   mode, so let's get into 32 bit mode, write the kernel and jump
> -	   back again. */
> -
> -	/* Reserve space on the stack for our GDT descriptor. */
> -	mov             %esp, %ebp
> -	sub             $16, %esp
> -
> -	/* Now create the GDT descriptor */
> -	movw		$((3 * 8) - 1), -16(%bp)
> -	mov		%cs, %eax
> -	movzwl		%ax, %eax
> -	shl		$4, %eax
> -	addl		$gdt, %eax
> -	movl		%eax, -14(%bp)
> -
> -	/* And load the GDT */
> -	data32 lgdt	-16(%bp)
> -	mov		%ebp, %esp
> -
> -	/* Get us to protected mode now */
> -	mov		$1, %eax
> -	mov		%eax, %cr0
> -
> -	/* So we can set ES to a 32-bit segment */
> -	mov		$0x10, %eax
> -	mov		%eax, %es
> -
> -	/* We're now running in 16-bit CS, but 32-bit ES! */
> -
> -	/* Load kernel and initrd */
> -	read_fw_blob_addr32_edi(FW_CFG_INITRD)
> -	read_fw_blob_addr32(FW_CFG_KERNEL)
> -	read_fw_blob_addr32(FW_CFG_CMDLINE)
> -
> -	/* And now jump into Linux! */
> -	mov		$0, %eax
> -	mov		%eax, %cr0
> -
> -	/* ES = CS */
> -	mov		%cs, %ax
> -	mov		%ax, %es
> -
> -	jmp		boot_kernel
> -
> -/* Variables */
> -
> -.align 4, 0
> -gdt:
> -	/* 0x00 */
> -.byte	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
> -
> -	/* 0x08: code segment (base=0, limit=0xfffff, type=32bit code exec/read, DPL=0, 4k) */
> -.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00
> -
> -	/* 0x10: data segment (base=0, limit=0xfffff, type=32bit data read/write, DPL=0, 4k) */
> -.byte	0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00
> -
> -BOOT_ROM_END


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

* Re: How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)
  2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
@ 2025-05-12  2:45         ` Zhao Liu
  2025-05-12  6:34         ` How to mark internal properties Markus Armbruster
  2025-05-12  8:46         ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Peter Maydell
  2 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-05-12  2:45 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Xiaoyao Li, Philippe Mathieu-Daudé, Markus Armbruster,
	Paolo Bonzini, Daniel P. Berrange, qemu-devel, Richard Henderson,
	kvm, Gerd Hoffmann, Peter Maydell, Laurent Vivier, Jiaxun Yang,
	Yi Liu, Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, May 09, 2025 at 12:04:19PM +0200, Thomas Huth wrote:
> Date: Fri, 9 May 2025 12:04:19 +0200
> From: Thomas Huth <thuth@redhat.com>
> Subject: How to mark internal properties (was: Re: [PATCH v4 12/27]
>  target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)
> 
> On 09/05/2025 09.32, Zhao Liu wrote:
> > On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote:
> > > Date: Fri, 9 May 2025 14:49:27 +0800
> > > From: Xiaoyao Li <xiaoyao.li@intel.com>
> > > Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove
> > >   CPUX86State::enable_cpuid_0xb field
> > > 
> > > On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> > > > The CPUX86State::enable_cpuid_0xb boolean was only disabled
> > > > for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> > > > removed. Being now always %true, we can remove it and simplify
> > > > cpu_x86_cpuid().
> > > > 
> > > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > > > ---
> > > >    target/i386/cpu.h | 3 ---
> > > >    target/i386/cpu.c | 6 ------
> > > >    2 files changed, 9 deletions(-)
> > > > 
> > > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> > > > index 0db70a70439..06817a31cf9 100644
> > > > --- a/target/i386/cpu.h
> > > > +++ b/target/i386/cpu.h
> > > > @@ -2241,9 +2241,6 @@ struct ArchCPU {
> > > >         */
> > > >        bool legacy_multi_node;
> > > > -    /* Compatibility bits for old machine types: */
> > > > -    bool enable_cpuid_0xb;
> > > > -
> > > >        /* Enable auto level-increase for all CPUID leaves */
> > > >        bool full_cpuid_auto_level;
> > > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> > > > index 49179f35812..6fe37f71b1e 100644
> > > > --- a/target/i386/cpu.c
> > > > +++ b/target/i386/cpu.c
> > > > @@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> > > >            break;
> > > >        case 0xB:
> > > >            /* Extended Topology Enumeration Leaf */
> > > > -        if (!cpu->enable_cpuid_0xb) {
> > > > -                *eax = *ebx = *ecx = *edx = 0;
> > > > -                break;
> > > > -        }
> > > > -
> > > >            *ecx = count & 0xff;
> > > >            *edx = cpu->apic_id;
> > > > @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
> > > >        DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
> > > >        DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
> > > >        DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
> > > > -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
> > > 
> > > It's deprecating the "cpuid-0xb" property.
> > > 
> > > I think we need go with the standard process to deprecate it.
> > 
> > Thanks! I got your point.
> > 
> > Though this property is introduced for compatibility, as its comment
> > said "Compatibility bits for old machine types", it is also useful for
> > somer users.
> 
> Thanks for your clarifications, Zhao! But I think this shows again the
> problem that we have hit a couple of times in the past already: Properties
> are currently used for both, config knobs for the users and internal
> switches for configuration of the machine. We lack a proper way to say "this
> property is usable for the user" and "this property is meant for internal
> configuration only".

Hi Thomas, thank you.

AFAIK, there are two ways to configure whether an object/device is
allowed to be created by user or not:

* TYPE_USER_CREATABLE
* DeviceClass: user_creatable

So, it looks like it would be tricky to change the infrastructure around
object_property_add because it's not easy to be compatible with both of the
above user creation ways.

> I wonder whether we could maybe come up with a naming scheme to better
> distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
> for experimental properties? We could e.g. say that all properties starting
> with a "q-" are meant for QEMU-internal configuration only or something
> similar (and maybe even hide those from the default help output when running
> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?

Therefore, I think the “q-” prefix might be a good way, simple and effective.

Let's see if any other maintainers have a better idea.

Regards,
Zhao


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

* Re: How to mark internal properties
  2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
  2025-05-12  2:45         ` Zhao Liu
@ 2025-05-12  6:34         ` Markus Armbruster
  2025-05-12  8:46         ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Peter Maydell
  2 siblings, 0 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-12  6:34 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Markus Armbruster, Paolo Bonzini, Daniel P. Berrange, qemu-devel,
	Richard Henderson, kvm, Gerd Hoffmann, Peter Maydell,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

Thomas Huth <thuth@redhat.com> writes:

> On 09/05/2025 09.32, Zhao Liu wrote:
>> On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote:
>>> Date: Fri, 9 May 2025 14:49:27 +0800
>>> From: Xiaoyao Li <xiaoyao.li@intel.com>
>>> Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove
>>>   CPUX86State::enable_cpuid_0xb field
>>>
>>> On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
>>>> The CPUX86State::enable_cpuid_0xb boolean was only disabled
>>>> for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
>>>> removed. Being now always %true, we can remove it and simplify
>>>> cpu_x86_cpuid().
>>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> target/i386/cpu.h | 3 ---
>>>> target/i386/cpu.c | 6 ------
>>>> 2 files changed, 9 deletions(-)
>>>>
>>>> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
>>>> index 0db70a70439..06817a31cf9 100644
>>>> --- a/target/i386/cpu.h
>>>> +++ b/target/i386/cpu.h
>>>> @@ -2241,9 +2241,6 @@ struct ArchCPU {
>>>>       */
>>>>      bool legacy_multi_node;
>>>> -    /* Compatibility bits for old machine types: */
>>>> -    bool enable_cpuid_0xb;
>>>> -
>>>>      /* Enable auto level-increase for all CPUID leaves */
>>>>      bool full_cpuid_auto_level;
>>>> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
>>>> index 49179f35812..6fe37f71b1e 100644
>>>> --- a/target/i386/cpu.c
>>>> +++ b/target/i386/cpu.c
>>>> @@ -6982,11 +6982,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
>>>>          break;
>>>>      case 0xB:
>>>>            /* Extended Topology Enumeration Leaf */
>>>> -        if (!cpu->enable_cpuid_0xb) {
>>>> -            *eax = *ebx = *ecx = *edx = 0;
>>>> -            break;
>>>> -        }
>>>> -
>>>>          *ecx = count & 0xff;
>>>>          *edx = cpu->apic_id;
>>>> @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
>>>>      DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
>>>>      DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
>>>>      DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
>>>> -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
>>>
>>> It's deprecating the "cpuid-0xb" property.
>>>
>>> I think we need go with the standard process to deprecate it.
>> 
>> Thanks! I got your point.
>> 
>> Though this property is introduced for compatibility, as its comment
>> said "Compatibility bits for old machine types", it is also useful for
>> somer users.
>
> Thanks for your clarifications, Zhao! But I think this shows again the 
> problem that we have hit a couple of times in the past already: Properties 
> are currently used for both, config knobs for the users and internal 
> switches for configuration of the machine. We lack a proper way to say "this 
> property is usable for the user" and "this property is meant for internal 
> configuration only".

Correct.

Exposing properties meant for internal use at the external interface
inevitably leads to (uncertainty about) external use.

> I wonder whether we could maybe come up with a naming scheme to better 
> distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix 
> for experimental properties? We could e.g. say that all properties starting 
> with a "q-" are meant for QEMU-internal configuration only or something 
> similar (and maybe even hide those from the default help output when running 
> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?

This papers over our inability / unwillingness to isolate the external
interface from internal detail.

The proper solution is to make the internal properties inaccessible at
the external interface.  This requires declaring properties' intent.
Which strikes me as a very good idea.

A naming convention is a simple, stupid way to do that.  There are
drawbacks, as experience with the "x-" prefix has shown:

* Flipping a flag bit involves changing the name.  Tolerable when all
  uses are internal, compatibility break when not.  Not a problem when
  the bit governs external access, of course.

* Name capture: consider InputBarrier properties x-origin, y-origin.
  Oops.

* If we have multiple flag bits, their prefixes can accumulate.  This
  gets ugly and confusing real quick.  Not an issue when at most one of
  the flags can be set, as is the case for "unstable" and "internal
  use".

* QAPI reserves "q_" for the generator's use.  Since "q-" would get
  mapped to "q_" in C, we risk name clashes.

For what it's worth, QAPI abandoned the "x-" naming convention (commit
a3c45b3e629 (qapi: New special feature flag "unstable"), commit message
appended for your convenience).  Developers are free to use "x-" to help
guide human users, but the feature flag is the sole source of thruth.



[...]



commit a3c45b3e62962f99338716b1347cfb0d427cea44
Author: Markus Armbruster <armbru@redhat.com>
Date:   Thu Oct 28 12:25:12 2021 +0200

    qapi: New special feature flag "unstable"
    
    By convention, names starting with "x-" are experimental.  The parts
    of external interfaces so named may be withdrawn or changed
    incompatibly in future releases.
    
    The naming convention makes unstable interfaces easy to recognize.
    Promoting something from experimental to stable involves a name
    change.  Client code needs to be updated.  Occasionally bothersome.
    
    Worse, the convention is not universally observed:
    
    * QOM type "input-barrier" has properties "x-origin", "y-origin".
      Looks accidental, but it's ABI since 4.2.
    
    * QOM types "memory-backend-file", "memory-backend-memfd",
      "memory-backend-ram", and "memory-backend-epc" have a property
      "x-use-canonical-path-for-ramblock-id" that is documented to be
      stable despite its name.
    
    We could document these exceptions, but documentation helps only
    humans.  We want to recognize "unstable" in code, like "deprecated".
    
    So support recognizing it the same way: introduce new special feature
    flag "unstable".  It will be treated specially by the QAPI generator,
    like the existing feature flag "deprecated", and unlike regular
    feature flags.
    
    This commit updates documentation and prepares tests.  The next commit
    updates the QAPI schema.  The remaining patches update the QAPI
    generator and wire up -compat policy checking.
    
    Management applications can then use query-qmp-schema and -compat to
    manage or guard against use of unstable interfaces the same way as for
    deprecated interfaces.
    
    docs/devel/qapi-code-gen.txt no longer mandates the naming convention.
    Using it anyway might help writers of programs that aren't
    full-fledged management applications.  Not using it can save us
    bothersome renames.  We'll see how that shakes out.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: John Snow <jsnow@redhat.com>
    Message-Id: <20211028102520.747396-2-armbru@redhat.com>


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

* Re: [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array
  2025-05-08 13:35 ` [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
  2025-05-09  6:54   ` Zhao Liu
@ 2025-05-12  8:19   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-12  8:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:34 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

see my comment in 1/27

> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.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 4e6fe68e2e0..65a11ea8f99 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


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

* Re: How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)
  2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
  2025-05-12  2:45         ` Zhao Liu
  2025-05-12  6:34         ` How to mark internal properties Markus Armbruster
@ 2025-05-12  8:46         ` Peter Maydell
  2025-05-12  9:06           ` Daniel P. Berrangé
  2 siblings, 1 reply; 108+ messages in thread
From: Peter Maydell @ 2025-05-12  8:46 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Markus Armbruster, Paolo Bonzini, Daniel P. Berrange, qemu-devel,
	Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:
> Thanks for your clarifications, Zhao! But I think this shows again the
> problem that we have hit a couple of times in the past already: Properties
> are currently used for both, config knobs for the users and internal
> switches for configuration of the machine. We lack a proper way to say "this
> property is usable for the user" and "this property is meant for internal
> configuration only".
>
> I wonder whether we could maybe come up with a naming scheme to better
> distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
> for experimental properties? We could e.g. say that all properties starting
> with a "q-" are meant for QEMU-internal configuration only or something
> similar (and maybe even hide those from the default help output when running
> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?

I think a q-prefix is potentially a bit clunky unless we also have
infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
and have it auto-add the prefix, and to have the C APIs for
setting properties search for both "foo" and "q-foo" so you
don't have to write qdev_prop_set_bit(dev, "q-foo", ...).

thanks
-- PMM

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

* Re: How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)
  2025-05-12  8:46         ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Peter Maydell
@ 2025-05-12  9:06           ` Daniel P. Berrangé
  2025-05-12 10:54             ` How to mark internal properties Markus Armbruster
  0 siblings, 1 reply; 108+ messages in thread
From: Daniel P. Berrangé @ 2025-05-12  9:06 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Thomas Huth, Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Markus Armbruster, Paolo Bonzini, qemu-devel, Richard Henderson,
	kvm, Gerd Hoffmann, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Igor Mammedov, Fabiano Rosas,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:
> On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:
> > Thanks for your clarifications, Zhao! But I think this shows again the
> > problem that we have hit a couple of times in the past already: Properties
> > are currently used for both, config knobs for the users and internal
> > switches for configuration of the machine. We lack a proper way to say "this
> > property is usable for the user" and "this property is meant for internal
> > configuration only".
> >
> > I wonder whether we could maybe come up with a naming scheme to better
> > distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
> > for experimental properties? We could e.g. say that all properties starting
> > with a "q-" are meant for QEMU-internal configuration only or something
> > similar (and maybe even hide those from the default help output when running
> > "-device xyz,help" ?)? Anybody any opinions or better ideas on this?
> 
> I think a q-prefix is potentially a bit clunky unless we also have
> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
> and have it auto-add the prefix, and to have the C APIs for
> setting properties search for both "foo" and "q-foo" so you
> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).

I think it is also not obvious enough that a 'q-' prefix means private.

Perhaps borrow from the C world and declare that a leading underscore
indicates a private property. People are more likely to understand and
remember that, than 'q-'.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


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

* Re: How to mark internal properties
  2025-05-12  9:06           ` Daniel P. Berrangé
@ 2025-05-12 10:54             ` Markus Armbruster
  2025-05-12 13:33               ` Xiaoyao Li
                                 ` (2 more replies)
  0 siblings, 3 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-12 10:54 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Zhao Liu, Xiaoyao Li,
	Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel,
	Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:
>> On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:
>> > Thanks for your clarifications, Zhao! But I think this shows again the
>> > problem that we have hit a couple of times in the past already: Properties
>> > are currently used for both, config knobs for the users and internal
>> > switches for configuration of the machine. We lack a proper way to say "this
>> > property is usable for the user" and "this property is meant for internal
>> > configuration only".
>> >
>> > I wonder whether we could maybe come up with a naming scheme to better
>> > distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
>> > for experimental properties? We could e.g. say that all properties starting
>> > with a "q-" are meant for QEMU-internal configuration only or something
>> > similar (and maybe even hide those from the default help output when running
>> > "-device xyz,help" ?)? Anybody any opinions or better ideas on this?
>> 
>> I think a q-prefix is potentially a bit clunky unless we also have
>> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
>> and have it auto-add the prefix, and to have the C APIs for
>> setting properties search for both "foo" and "q-foo" so you
>> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).

If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
intent in the name useful?

> I think it is also not obvious enough that a 'q-' prefix means private.

Concur.

> Perhaps borrow from the C world and declare that a leading underscore
> indicates a private property. People are more likely to understand and
> remember that, than 'q-'.

This is fine for device properties now.  It's not fine for properties of
user-creatable objects, because these are defined in QAPI, and QAPI
prohibits names starting with a single underscore.  I append relevant
parts of docs/devel/qapi-code-gen.rst for your convenience.

Why does QAPI prohibit leading underscores?  Chiefly because such names
are reserved identifiers in C.  Instead of complicating the mapping from
QAPI name to C identifier, we restrict QAPI names and call it a day.

The mapping between device property name and C identifiers is entirely
manual.  When a property is backed by a member of the device state
struct, naming the member exactly like the property makes sense.  Having
to mentally strip / insert a leading underscore would hardly be
terrible, just a bit of friction.  I'd prefer not to.




Naming rules and reserved names
-------------------------------

All names must begin with a letter, and contain only ASCII letters,
digits, hyphen, and underscore.  There are two exceptions: enum values
may start with a digit, and names that are downstream extensions (see
section `Downstream extensions`_) start with underscore.

Names beginning with ``q_`` are reserved for the generator, which uses
them for munging QMP names that resemble C keywords or other
problematic strings.  For example, a member named ``default`` in qapi
becomes ``q_default`` in the generated C code.

[...]

Downstream extensions
---------------------

QAPI schema names that are externally visible, say in the Client JSON
Protocol, need to be managed with care.  Names starting with a
downstream prefix of the form __RFQDN_ are reserved for the downstream
who controls the valid, reverse fully qualified domain name RFQDN.
RFQDN may only contain ASCII letters, digits, hyphen and period.

Example: Red Hat, Inc. controls redhat.com, and may therefore add a
downstream command ``__com.redhat_drive-mirror``.


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

* Re: How to mark internal properties
  2025-05-12 10:54             ` How to mark internal properties Markus Armbruster
@ 2025-05-12 13:33               ` Xiaoyao Li
  2025-05-12 14:41                 ` BALATON Zoltan
  2025-05-12 14:48               ` Mark Cave-Ayland
  2025-05-12 15:22               ` Igor Mammedov
  2 siblings, 1 reply; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-12 13:33 UTC (permalink / raw)
  To: Markus Armbruster, Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Zhao Liu, Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, kvm, Gerd Hoffmann,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/12/2025 6:54 PM, Markus Armbruster wrote:
> Daniel P. Berrangé<berrange@redhat.com> writes:
> 
>> On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:
>>> On Fri, 9 May 2025 at 11:04, Thomas Huth<thuth@redhat.com> wrote:
>>>> Thanks for your clarifications, Zhao! But I think this shows again the
>>>> problem that we have hit a couple of times in the past already: Properties
>>>> are currently used for both, config knobs for the users and internal
>>>> switches for configuration of the machine. We lack a proper way to say "this
>>>> property is usable for the user" and "this property is meant for internal
>>>> configuration only".
>>>>
>>>> I wonder whether we could maybe come up with a naming scheme to better
>>>> distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
>>>> for experimental properties? We could e.g. say that all properties starting
>>>> with a "q-" are meant for QEMU-internal configuration only or something
>>>> similar (and maybe even hide those from the default help output when running
>>>> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?
>>> I think a q-prefix is potentially a bit clunky unless we also have
>>> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
>>> and have it auto-add the prefix, and to have the C APIs for
>>> setting properties search for both "foo" and "q-foo" so you
>>> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).

> If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
> intent in the name useful?

+1 for DEFINE_INTERNAL_PROP_FOO(). I have the same thought.

We need something in code to restrict the *internal* property really 
internal, i.e., not user settable. What the name of the property is 
doesn't matter.

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

* Re: How to mark internal properties
  2025-05-12 13:33               ` Xiaoyao Li
@ 2025-05-12 14:41                 ` BALATON Zoltan
  2025-05-13  8:16                   ` Thomas Huth
  0 siblings, 1 reply; 108+ messages in thread
From: BALATON Zoltan @ 2025-05-12 14:41 UTC (permalink / raw)
  To: Xiaoyao Li
  Cc: Markus Armbruster, Daniel P. Berrangé, Peter Maydell,
	Thomas Huth, Zhao Liu, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

[-- Attachment #1: Type: text/plain, Size: 3685 bytes --]

On Mon, 12 May 2025, Xiaoyao Li wrote:
> On 5/12/2025 6:54 PM, Markus Armbruster wrote:
>> Daniel P. Berrangé<berrange@redhat.com> writes:
>>> On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:
>>>> On Fri, 9 May 2025 at 11:04, Thomas Huth<thuth@redhat.com> wrote:
>>>>> Thanks for your clarifications, Zhao! But I think this shows again the
>>>>> problem that we have hit a couple of times in the past already: 
>>>>> Properties
>>>>> are currently used for both, config knobs for the users and internal
>>>>> switches for configuration of the machine. We lack a proper way to say 
>>>>> "this
>>>>> property is usable for the user" and "this property is meant for 
>>>>> internal
>>>>> configuration only".
>>>>> 
>>>>> I wonder whether we could maybe come up with a naming scheme to better
>>>>> distinguish the two sets, e.g. by using a prefix similar to the "x-" 
>>>>> prefix
>>>>> for experimental properties? We could e.g. say that all properties 
>>>>> starting
>>>>> with a "q-" are meant for QEMU-internal configuration only or something
>>>>> similar (and maybe even hide those from the default help output when 
>>>>> running
>>>>> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?
>>>> I think a q-prefix is potentially a bit clunky unless we also have
>>>> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
>>>> and have it auto-add the prefix, and to have the C APIs for
>>>> setting properties search for both "foo" and "q-foo" so you
>>>> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).
>
>> If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
>> intent in the name useful?
>
> +1 for DEFINE_INTERNAL_PROP_FOO(). I have the same thought.
>
> We need something in code to restrict the *internal* property really 
> internal, i.e., not user settable. What the name of the property is doesn't 
> matter.

What's an internal property? Properties are there to make some field of an 
object introspectable and settable from command line and QEMU monitor or 
other external interfaces. If that's not needed for something why is it 
defined as a property in the first place and not just e.g. C accessor 
functions as part of the device's interface instead? I think this may be 
overusing QOM for things that may not need it and adding complexity where 
not needed. It reminds me of patches that wanted to export via-ide IRQs or 
ISA IRQs just to be able to connect them to other parts _of the same chip_ 
becuase this chip is modeled as multiple QOM objects for reusing code from 
those. But in reality the chip does not have such pins and these are 
internal connections so I think it would be better to model these as 
functions and not QOM constructs that the user can change. In general, if 
the device or object has an external connection or a knob that the user 
may need to change or connect to another device (like building a board 
from parts you can wire pins together) then those need properties or 
qemu_irqs but other "internal properties" may need some other way to 
access and often simple accessor functions are enough for this as these 
internal properties are only accessed form the code. That way we would not 
need even more complexity to hide these from the user, instead of that 
just don't expose them but use something else where a property is not 
needed. A property is just like an accessor function with additional 
complexity to expose it to other interfaces so it's externally settable 
and introspectable but we don't need those for internal properties so we 
can drop that complexity and get back to the accessor function at the 
bottom of it.

Regards,
BALATON Zoltan

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

* Re: How to mark internal properties
  2025-05-12 10:54             ` How to mark internal properties Markus Armbruster
  2025-05-12 13:33               ` Xiaoyao Li
@ 2025-05-12 14:48               ` Mark Cave-Ayland
  2025-05-13  8:18                 ` Markus Armbruster
  2025-05-12 15:22               ` Igor Mammedov
  2 siblings, 1 reply; 108+ messages in thread
From: Mark Cave-Ayland @ 2025-05-12 14:48 UTC (permalink / raw)
  To: Markus Armbruster, Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Zhao Liu, Xiaoyao Li,
	Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel,
	Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On 12/05/2025 11:54, Markus Armbruster wrote:

> Daniel P. Berrangé <berrange@redhat.com> writes:
> 
>> On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:
>>> On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:
>>>> Thanks for your clarifications, Zhao! But I think this shows again the
>>>> problem that we have hit a couple of times in the past already: Properties
>>>> are currently used for both, config knobs for the users and internal
>>>> switches for configuration of the machine. We lack a proper way to say "this
>>>> property is usable for the user" and "this property is meant for internal
>>>> configuration only".
>>>>
>>>> I wonder whether we could maybe come up with a naming scheme to better
>>>> distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
>>>> for experimental properties? We could e.g. say that all properties starting
>>>> with a "q-" are meant for QEMU-internal configuration only or something
>>>> similar (and maybe even hide those from the default help output when running
>>>> "-device xyz,help" ?)? Anybody any opinions or better ideas on this?
>>>
>>> I think a q-prefix is potentially a bit clunky unless we also have
>>> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
>>> and have it auto-add the prefix, and to have the C APIs for
>>> setting properties search for both "foo" and "q-foo" so you
>>> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).
> 
> If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
> intent in the name useful?
> 
>> I think it is also not obvious enough that a 'q-' prefix means private.
> 
> Concur.
> 
>> Perhaps borrow from the C world and declare that a leading underscore
>> indicates a private property. People are more likely to understand and
>> remember that, than 'q-'.
> 
> This is fine for device properties now.  It's not fine for properties of
> user-creatable objects, because these are defined in QAPI, and QAPI
> prohibits names starting with a single underscore.  I append relevant
> parts of docs/devel/qapi-code-gen.rst for your convenience.

On a related note this also brings us back to the discussion as to the 
relationship between qdev and QOM: at one point I was under the 
impression that qdev properties were simply QOM properties that were 
exposed externally, i.e on the commmand line for use with -device.

Can you provide an update on what the current thinking is in this area, 
in particular re: scoping of qdev vs QOM properties?


ATB,

Mark.


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

* Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field
  2025-05-09  7:32     ` Zhao Liu
  2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
@ 2025-05-12 15:00       ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-12 15:00 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Xiaoyao Li, Philippe Mathieu-Daudé, qemu-devel,
	Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang, Helge Deller,
	Palmer Dabbelt, Ani Sinha, Fabiano Rosas, Paolo Bonzini,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, 9 May 2025 15:32:30 +0800
Zhao Liu <zhao1.liu@intel.com> wrote:

> On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote:
> > Date: Fri, 9 May 2025 14:49:27 +0800
> > From: Xiaoyao Li <xiaoyao.li@intel.com>
> > Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove
> >  CPUX86State::enable_cpuid_0xb field
> > 
> > On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:  
> > > The CPUX86State::enable_cpuid_0xb boolean was only disabled
> > > for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> > > removed. Being now always %true, we can remove it and simplify
> > > cpu_x86_cpuid().
> > > 
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
...
> > > @@ -8828,7 +8823,6 @@ static const Property x86_cpu_properties[] = {
> > >       DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
> > >       DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
> > >       DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
> > > -    DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),  
...

> @Philippe, thank you for cleaning up this case! I think we can keep this
> property, and if you don't mind, I can modify its comment later to
> indicate that it's used to adjust the topology support for the CPU.

+1, we should not delete this without due process (aka deprecation).
So perhaps deprecate now and remove in couple of releases 


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

* Re: How to mark internal properties
  2025-05-12 10:54             ` How to mark internal properties Markus Armbruster
  2025-05-12 13:33               ` Xiaoyao Li
  2025-05-12 14:48               ` Mark Cave-Ayland
@ 2025-05-12 15:22               ` Igor Mammedov
  2025-05-13  8:08                 ` Markus Armbruster
  2 siblings, 1 reply; 108+ messages in thread
From: Igor Mammedov @ 2025-05-12 15:22 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Daniel P. Berrangé, Peter Maydell, Thomas Huth, Zhao Liu,
	Xiaoyao Li, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Mon, 12 May 2025 12:54:26 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Daniel P. Berrangé <berrange@redhat.com> writes:
> 
> > On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:  
> >> On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:  
> >> > Thanks for your clarifications, Zhao! But I think this shows again the
> >> > problem that we have hit a couple of times in the past already: Properties
> >> > are currently used for both, config knobs for the users and internal
> >> > switches for configuration of the machine. We lack a proper way to say "this
> >> > property is usable for the user" and "this property is meant for internal
> >> > configuration only".
> >> >
> >> > I wonder whether we could maybe come up with a naming scheme to better
> >> > distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
> >> > for experimental properties? We could e.g. say that all properties starting
> >> > with a "q-" are meant for QEMU-internal configuration only or something
> >> > similar (and maybe even hide those from the default help output when running
> >> > "-device xyz,help" ?)? Anybody any opinions or better ideas on this?  
> >> 
> >> I think a q-prefix is potentially a bit clunky unless we also have
> >> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
> >> and have it auto-add the prefix, and to have the C APIs for
> >> setting properties search for both "foo" and "q-foo" so you
> >> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).  
> 
> If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
> intent in the name useful?

While we are inventing a new API, I'd say that _INTERNAL_ is not the only thing
on my wish-list wrt properties.
It would be also nice to know when a property is set by internal or external user
or if it still has default value.

Basically we are looking at different flags for properties and INERNAL being
one of them.

Maybe instead of specialized macro, we should have a more generic
   DEFINE_PROP_WITH_FLAGS_FOO(...,flags)
So we won't have to rewrite it again when we think of another flag to turn on/off.


From previous uses of x- flag, some of such properties are created as
temporary | developer-only and occasionally as a crutch (still no intended for end user).
But then sometimes such properties get promoted to ABI with fat warnings
not to touch them. Having stable|unstable flag could help here without
need to rename property (and prevent breaking users who (ab)used it if we care).


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

* Re: [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field
  2025-05-08 13:35 ` [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field Philippe Mathieu-Daudé
  2025-05-09  9:30   ` Zhao Liu
@ 2025-05-12 15:24   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-12 15:24 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:36 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> The CPUX86State::fill_mtrr_mask boolean was only disabled
> for the pc-q35-2.6 and pc-i440fx-2.6 machines, which got
> removed. Being now always %true, we can remove it and simplify
> kvm_get_msrs().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/cpu.h     |  3 ---
>  target/i386/cpu.c     |  1 -
>  target/i386/kvm/kvm.c | 10 +++-------
>  3 files changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 06817a31cf9..7585407da54 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2253,9 +2253,6 @@ struct ArchCPU {
>      /* Enable auto level-increase for Intel Processor Trace leave */
>      bool intel_pt_auto_level;
>  
> -    /* if true fill the top bits of the MTRR_PHYSMASKn variable range */
> -    bool fill_mtrr_mask;
> -
>      /* if true override the phys_bits value with a value read from the host */
>      bool host_phys_bits;
>  
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 6fe37f71b1e..fb505d13122 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -8810,7 +8810,6 @@ static const Property x86_cpu_properties[] = {
>      DEFINE_PROP_UINT32("guest-phys-bits", X86CPU, guest_phys_bits, -1),
>      DEFINE_PROP_BOOL("host-phys-bits", X86CPU, host_phys_bits, false),
>      DEFINE_PROP_UINT8("host-phys-bits-limit", X86CPU, host_phys_bits_limit, 0),
> -    DEFINE_PROP_BOOL("fill-mtrr-mask", X86CPU, fill_mtrr_mask, true),

same as previous patch, deprecate 1st then remove

>      DEFINE_PROP_UINT32("level-func7", X86CPU, env.cpuid_level_func7,
>                         UINT32_MAX),
>      DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, UINT32_MAX),
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index c9a3c02e3e3..87edce99e85 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -4635,13 +4635,9 @@ static int kvm_get_msrs(X86CPU *cpu)
>       * we're migrating to.
>       */
>  
> -    if (cpu->fill_mtrr_mask) {
> -        QEMU_BUILD_BUG_ON(TARGET_PHYS_ADDR_SPACE_BITS > 52);
> -        assert(cpu->phys_bits <= TARGET_PHYS_ADDR_SPACE_BITS);
> -        mtrr_top_bits = MAKE_64BIT_MASK(cpu->phys_bits, 52 - cpu->phys_bits);
> -    } else {
> -        mtrr_top_bits = 0;
> -    }
> +    QEMU_BUILD_BUG_ON(TARGET_PHYS_ADDR_SPACE_BITS > 52);
> +    assert(cpu->phys_bits <= TARGET_PHYS_ADDR_SPACE_BITS);
> +    mtrr_top_bits = MAKE_64BIT_MASK(cpu->phys_bits, 52 - cpu->phys_bits);
>  
>      for (i = 0; i < ret; i++) {
>          uint32_t index = msrs[i].index;


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

* Re: How to mark internal properties
  2025-05-12 15:22               ` Igor Mammedov
@ 2025-05-13  8:08                 ` Markus Armbruster
  0 siblings, 0 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-13  8:08 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Daniel P. Berrangé, Peter Maydell, Thomas Huth, Zhao Liu,
	Xiaoyao Li, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Igor Mammedov <imammedo@redhat.com> writes:

> On Mon, 12 May 2025 12:54:26 +0200
> Markus Armbruster <armbru@redhat.com> wrote:
>
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>> 
>> > On Mon, May 12, 2025 at 09:46:30AM +0100, Peter Maydell wrote:  
>> >> On Fri, 9 May 2025 at 11:04, Thomas Huth <thuth@redhat.com> wrote:  
>> >> > Thanks for your clarifications, Zhao! But I think this shows again the
>> >> > problem that we have hit a couple of times in the past already: Properties
>> >> > are currently used for both, config knobs for the users and internal
>> >> > switches for configuration of the machine. We lack a proper way to say "this
>> >> > property is usable for the user" and "this property is meant for internal
>> >> > configuration only".
>> >> >
>> >> > I wonder whether we could maybe come up with a naming scheme to better
>> >> > distinguish the two sets, e.g. by using a prefix similar to the "x-" prefix
>> >> > for experimental properties? We could e.g. say that all properties starting
>> >> > with a "q-" are meant for QEMU-internal configuration only or something
>> >> > similar (and maybe even hide those from the default help output when running
>> >> > "-device xyz,help" ?)? Anybody any opinions or better ideas on this?  
>> >> 
>> >> I think a q-prefix is potentially a bit clunky unless we also have
>> >> infrastructure to say eg DEFINE_INTERNAL_PROP_BOOL("foo", ...)
>> >> and have it auto-add the prefix, and to have the C APIs for
>> >> setting properties search for both "foo" and "q-foo" so you
>> >> don't have to write qdev_prop_set_bit(dev, "q-foo", ...).  
>> 
>> If we make intent explicit with DEFINE_INTERNAL_PROP_FOO(), is repeating
>> intent in the name useful?
>
> While we are inventing a new API, I'd say that _INTERNAL_ is not the only thing
> on my wish-list wrt properties.
> It would be also nice to know when a property is set by internal or external user
> or if it still has default value.

We commonly assume "value is default implies user didn't touch it",
which is of course wrong unless it's a value the user cannot set.

> Basically we are looking at different flags for properties and INERNAL being
> one of them.
>
> Maybe instead of specialized macro, we should have a more generic
>    DEFINE_PROP_WITH_FLAGS_FOO(...,flags)
> So we won't have to rewrite it again when we think of another flag to turn on/off.
>
>
> From previous uses of x- flag, some of such properties are created as
> temporary | developer-only and occasionally as a crutch (still no intended for end user).
> But then sometimes such properties get promoted to ABI with fat warnings
> not to touch them. Having stable|unstable flag could help here without
> need to rename property (and prevent breaking users who (ab)used it if we care).

I think QAPI's explicit 'unstable' and 'deprecated' flags have been a
success.  Their meaning is clear, and they come with documentation
(because adding them without won't compile).

Pushing QOM closer to QAPI when we can makes sense to me.


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

* Re: How to mark internal properties
  2025-05-12 14:41                 ` BALATON Zoltan
@ 2025-05-13  8:16                   ` Thomas Huth
  0 siblings, 0 replies; 108+ messages in thread
From: Thomas Huth @ 2025-05-13  8:16 UTC (permalink / raw)
  To: BALATON Zoltan, Xiaoyao Li
  Cc: Markus Armbruster, Daniel P. Berrangé, Peter Maydell,
	Zhao Liu, Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel,
	Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On 12/05/2025 16.41, BALATON Zoltan wrote:
> On Mon, 12 May 2025, Xiaoyao Li wrote:
...
>> We need something in code to restrict the *internal* property really 
>> internal, i.e., not user settable. What the name of the property is 
>> doesn't matter.
> 
> What's an internal property? Properties are there to make some field of an 
> object introspectable and settable from command line and QEMU monitor or 
> other external interfaces. If that's not needed for something why is it 
> defined as a property in the first place and not just e.g. C accessor 
> functions as part of the device's interface instead? I think this may be 
> overusing QOM for things that may not need it and adding complexity where 
> not needed.

Maybe some things could easily be simplified indeed, but for some others, 
it's currently the way it's deeply rooted in the logic of QEMU. Have a look 
at the hw_compat arrays in hw/core/machine.c ... it all goes via properties, 
so there is certainly no easy and quick solution for this.

  Thomas


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

* Re: How to mark internal properties
  2025-05-12 14:48               ` Mark Cave-Ayland
@ 2025-05-13  8:18                 ` Markus Armbruster
  2025-05-13  9:26                   ` BALATON Zoltan
  0 siblings, 1 reply; 108+ messages in thread
From: Markus Armbruster @ 2025-05-13  8:18 UTC (permalink / raw)
  To: Mark Cave-Ayland
  Cc: Daniel P. Berrangé, Peter Maydell, Thomas Huth, Zhao Liu,
	Xiaoyao Li, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:

> On a related note this also brings us back to the discussion as to the relationship between qdev and QOM: at one point I was under the impression that qdev properties were simply QOM properties that were exposed externally, i.e on the commmand line for use with -device.
>
> Can you provide an update on what the current thinking is in this area, in particular re: scoping of qdev vs QOM properties?

qdev is a leaky layer above QOM.

qdev properties are also QOM properties.

All device properties are exposed externally.

We use device properties for:

* Letting users configure pluggable devices, with -device or device_add

* Letting code configure onboard devices

  For onboard devices that are also pluggable, everything exposed to
  code is also exposed externally.  This might be a mistake in places.

* Letting the machine versioning machinery adjust device configuration

  Some properties are meant to be used just for this.  They're exposed
  externally regardless, which is a mistake.


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

* Re: [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field
  2025-05-08 13:35 ` [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
  2025-05-09  9:30   ` Zhao Liu
@ 2025-05-13  8:34   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13  8:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:37 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

I think just removing this property is pretty save,
it's highly unlikely to be used by any external user
as it's purpose was to keep migration working for 2.6.
With the later gone there is not need for the property at all.
  

> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.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,


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

* Re: [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array
  2025-05-08 13:35 ` [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
  2025-05-09  9:31   ` Zhao Liu
@ 2025-05-13  8:36   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13  8:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:38 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> 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.

see my comment in 1/27

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


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

* Re: [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines
  2025-05-08 13:35 ` [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
  2025-05-09  9:33   ` Zhao Liu
@ 2025-05-13  8:53   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13  8:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:40 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> 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.  Remove the qtest
> in test-x86-cpuid-compat.c file.

same comment as 1/27,

I'd squash pc|hw_compat_2_7 removal in here

other than that loos good to me, with above
  Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/i386/pc_piix.c                   |  9 ---------
>  hw/i386/pc_q35.c                    | 10 ----------
>  tests/qtest/test-x86-cpuid-compat.c | 11 -----------
>  3 files changed, 30 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);
> 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
> @@ -345,17 +345,6 @@ int main(int argc, char **argv)
>  
>      /* Check compatibility of old machine-types that didn't
>       * auto-increase level/xlevel/xlevel2: */
> -    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);
> -    }
>      if (qtest_has_machine("pc-i440fx-2.9")) {
>          add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/off",
>                         "Conroe", NULL, "pc-i440fx-2.9",


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

* Re: [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field
  2025-05-08 13:35 ` [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
  2025-05-09  9:38   ` Zhao Liu
@ 2025-05-13  9:02   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13  9:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland,
	Thomas Huth

On Thu,  8 May 2025 15:35:44 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> 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[].

same as 14/27, it should be safe to remove without deprecation

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

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


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

* Re: [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
  2025-05-08 13:35 ` [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
  2025-05-09  9:41   ` Zhao Liu
@ 2025-05-13  9:16   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13  9:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu,  8 May 2025 15:35:46 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

Reviewed-by: Igor Mammedov <imammedo@redhat.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)");


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

* Re: How to mark internal properties
  2025-05-13  8:18                 ` Markus Armbruster
@ 2025-05-13  9:26                   ` BALATON Zoltan
  2025-05-13  9:32                     ` Daniel P. Berrangé
                                       ` (2 more replies)
  0 siblings, 3 replies; 108+ messages in thread
From: BALATON Zoltan @ 2025-05-13  9:26 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Mark Cave-Ayland, Daniel P. Berrangé, Peter Maydell,
	Thomas Huth, Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, kvm, Gerd Hoffmann,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On Tue, 13 May 2025, Markus Armbruster wrote:
> Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:
>> On a related note this also brings us back to the discussion as to the 
>> relationship between qdev and QOM: at one point I was under the 
>> impression that qdev properties were simply QOM properties that were 
>> exposed externally, i.e on the commmand line for use with -device.
>>
>> Can you provide an update on what the current thinking is in this area, 
>> in particular re: scoping of qdev vs QOM properties?
>
> qdev is a leaky layer above QOM.
>
> qdev properties are also QOM properties.
>
> All device properties are exposed externally.

That was clear but the question was if QOM properties (that are not qdev 
properties) exist and if so are they also exposed? If not exposed it may 
be used for internal properties (where simpler solutions aren't 
convenient) but maybe qdev also adds easier definition of properties 
that's why they used instead of QOM properties?

> We use device properties for:
>
> * Letting users configure pluggable devices, with -device or device_add
>
> * Letting code configure onboard devices
>
>  For onboard devices that are also pluggable, everything exposed to
>  code is also exposed externally.  This might be a mistake in places.

If a device is pluggable, theoretically a user could create a machine from 
them declaratively, e.g. starting from a "none" machine or like plugging 
cards in a motherboard so their properties should be exposed as long as 
those properties correspond to the device pins they model or configurable 
options. Only properties that are implementation details should not be 
exposed because setting them can break the device. There are a few places 
where we have such properties. But you say "in places" so I think you 
meant the same.

> * Letting the machine versioning machinery adjust device configuration
>
>  Some properties are meant to be used just for this.  They're exposed
>  externally regardless, which is a mistake.

Question is if we want to allow users to tweak these compatibility 
options, like selectively enable/disable when migrating between QEMU 
versions or for testing. It might have some uses and maybe that's the 
reason why people would like these to go through deprecation instead of 
just dropping them. Marking some properties not exposed would get the same 
resistance then so may not solve the issue.

Regards,
BALATON Zoltan

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

* Re: How to mark internal properties
  2025-05-13  9:26                   ` BALATON Zoltan
@ 2025-05-13  9:32                     ` Daniel P. Berrangé
  2025-05-13 10:38                       ` Markus Armbruster
  2025-05-13 11:01                     ` Markus Armbruster
  2025-05-26  8:58                     ` Markus Armbruster
  2 siblings, 1 reply; 108+ messages in thread
From: Daniel P. Berrangé @ 2025-05-13  9:32 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Markus Armbruster, Mark Cave-Ayland, Peter Maydell, Thomas Huth,
	Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Tue, May 13, 2025 at 11:26:31AM +0200, BALATON Zoltan wrote:
> On Tue, 13 May 2025, Markus Armbruster wrote:
> > Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:
> > > On a related note this also brings us back to the discussion as to
> > > the relationship between qdev and QOM: at one point I was under the
> > > impression that qdev properties were simply QOM properties that were
> > > exposed externally, i.e on the commmand line for use with -device.
> > > 
> > > Can you provide an update on what the current thinking is in this
> > > area, in particular re: scoping of qdev vs QOM properties?
> > 
> > qdev is a leaky layer above QOM.
> > 
> > qdev properties are also QOM properties.
> > 
> > All device properties are exposed externally.
> 
> That was clear but the question was if QOM properties (that are not qdev
> properties) exist and if so are they also exposed? If not exposed it may be
> used for internal properties (where simpler solutions aren't convenient) but
> maybe qdev also adds easier definition of properties that's why they used
> instead of QOM properties?

NB, not everything we expose is a QDev. We directly expose QOM
via "-object" if they implement the 'UserCreatable' interface.
If we want internal properties, that should likely be wired in
to the QOM level directly.

Conceptually you could even say that everything QEMU creates should
live under -object, and no other args ought to need to exist. We have
decades of evolved code making that impractical though.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


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

* Re: [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field
  2025-05-08 13:35 ` [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
  2025-05-09 10:32   ` Zhao Liu
@ 2025-05-13 10:28   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 10:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu,  8 May 2025 15:35:47 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

that crutch might be in-use by external users, and even if they use
0x20, removing property will break CLI.

I'd deprecate it first and then remove.

>  >   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.
looking at the code removed, default is 0x20 which doesn't match above
statement. Have something changed between then and now (missing ref to
0x20 becoming default)?

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


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

* Re: [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
  2025-05-08 13:35 ` [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
  2025-05-09  9:43   ` Zhao Liu
@ 2025-05-13 10:30   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 10:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu,  8 May 2025 15:35:48 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

Reviewed-by: Igor Mammedov <imammedo@redhat.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,


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

* Re: How to mark internal properties
  2025-05-13  9:32                     ` Daniel P. Berrangé
@ 2025-05-13 10:38                       ` Markus Armbruster
  0 siblings, 0 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-13 10:38 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: BALATON Zoltan, Mark Cave-Ayland, Peter Maydell, Thomas Huth,
	Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé, Paolo Bonzini,
	qemu-devel, Richard Henderson, kvm, Gerd Hoffmann, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, May 13, 2025 at 11:26:31AM +0200, BALATON Zoltan wrote:
>> On Tue, 13 May 2025, Markus Armbruster wrote:
>> > Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:
>> > > On a related note this also brings us back to the discussion as to
>> > > the relationship between qdev and QOM: at one point I was under the
>> > > impression that qdev properties were simply QOM properties that were
>> > > exposed externally, i.e on the commmand line for use with -device.
>> > > 
>> > > Can you provide an update on what the current thinking is in this
>> > > area, in particular re: scoping of qdev vs QOM properties?
>> > 
>> > qdev is a leaky layer above QOM.
>> > 
>> > qdev properties are also QOM properties.
>> > 
>> > All device properties are exposed externally.
>> 
>> That was clear but the question was if QOM properties (that are not qdev
>> properties) exist and if so are they also exposed? If not exposed it may be
>> used for internal properties (where simpler solutions aren't convenient) but
>> maybe qdev also adds easier definition of properties that's why they used
>> instead of QOM properties?
>
> NB, not everything we expose is a QDev. We directly expose QOM
> via "-object" if they implement the 'UserCreatable' interface.
> If we want internal properties, that should likely be wired in
> to the QOM level directly.

Yes.

As is, all properties of QOM types implementing UserCreatable are part
of the -object / object_add stable external interface.  We lack means to
add properties just for internal use.

Properties of all QOM types (UserCreatable or not) are exposed
externally via qom-get & friends.  This isn't a stable interface except
when it is, but that's a separate problem.

> Conceptually you could even say that everything QEMU creates should
> live under -object, and no other args ought to need to exist. We have
> decades of evolved code making that impractical though.

I doubt we would've invented qdev had QOM existed already.


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

* Re: [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
  2025-05-08 13:35 ` [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
  2025-05-09 10:19   ` Zhao Liu
@ 2025-05-13 10:48   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 10:48 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Thu,  8 May 2025 15:35:50 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

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

there is also 

/* page per vq flag to be used by split drivers within guests */                 
#define VIRTIO_PCI_FLAG_PAGE_PER_VQ \                                            
    (1 << VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT) 

left behind


nevertheless, I'm not sure if we should remove this at all,
it seems that there are external users
https://bugzilla.redhat.com/show_bug.cgi?id=1925363

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


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

* Re: How to mark internal properties
  2025-05-13  9:26                   ` BALATON Zoltan
  2025-05-13  9:32                     ` Daniel P. Berrangé
@ 2025-05-13 11:01                     ` Markus Armbruster
  2025-05-26  8:58                     ` Markus Armbruster
  2 siblings, 0 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-13 11:01 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Mark Cave-Ayland, Daniel P. Berrangé, Peter Maydell,
	Thomas Huth, Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, kvm, Gerd Hoffmann,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

BALATON Zoltan <balaton@eik.bme.hu> writes:

> On Tue, 13 May 2025, Markus Armbruster wrote:
>> Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:
>>> On a related note this also brings us back to the discussion as to the relationship between qdev and QOM: at one point I was under the impression that qdev properties were simply QOM properties that were exposed externally, i.e on the commmand line for use with -device.
>>>
>>> Can you provide an update on what the current thinking is in this area, in particular re: scoping of qdev vs QOM properties?
>>
>> qdev is a leaky layer above QOM.
>>
>> qdev properties are also QOM properties.
>>
>> All device properties are exposed externally.
>
> That was clear but the question was if QOM properties (that are not qdev properties) exist and if so are they also exposed? If not exposed it may be used for internal properties (where simpler solutions aren't convenient) but maybe qdev also adds easier definition of properties that's why they used instead of QOM properties?
>
>> We use device properties for:
>>
>> * Letting users configure pluggable devices, with -device or device_add
>>
>> * Letting code configure onboard devices
>>
>>  For onboard devices that are also pluggable, everything exposed to
>>  code is also exposed externally.  This might be a mistake in places.
>
> If a device is pluggable, theoretically a user could create a machine from them declaratively, e.g. starting from a "none" machine or like plugging cards in a motherboard so their properties should be exposed as long as those properties correspond to the device pins they model or configurable options. Only properties that are implementation details should not be exposed because setting them can break the device. There are a few places where we have such properties. But you say "in places" so I think you meant the same.

Building machines declaratively has been the dream for many years.

I chose to write "might be in places", because I can't point to examples
offhand to support a stronger claim :)

External interfaces should be intentional, i.e. carefully curated to
serve actual use cases.  They should also be stable and documented.

The QOM parts of our external interfaces are largely accidental,
unstable, and undocumented.  We have some internal need, we create
something to serve it, and expose it externally simply because we lack
the means not to.

>> * Letting the machine versioning machinery adjust device configuration
>>
>>  Some properties are meant to be used just for this.  They're exposed
>>  externally regardless, which is a mistake.
>
> Question is if we want to allow users to tweak these compatibility options, like selectively enable/disable when migrating between QEMU versions or for testing. It might have some uses and maybe that's the reason why people would like these to go through deprecation instead of just dropping them. Marking some properties not exposed would get the same resistance then so may not solve the issue.

If you need to mess with properties to make migration work, that's a
bug.  That's versioning machinery's job.

External interfaces just for testing can be okay.  We should not promise
stability there.  We should still be intentional, and we should still
document.

Attempts to get rid of external interfaces always draw resistance, even
when they're accidental.


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

* Re: [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field
  2025-05-08 13:35 ` [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Philippe Mathieu-Daudé
  2025-05-09  9:37   ` Zhao Liu
@ 2025-05-13 11:02   ` Igor Mammedov
  1 sibling, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 11:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Thu,  8 May 2025 15:35:42 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> The CPUX86State::full_cpuid_auto_level boolean was only
> disabled for the pc-q35-2.7 and pc-i440fx-2.7 machines,
> which got removed. Being now always %true, we can remove
> it and simplify x86_cpu_expand_features().

I've found field being mentioned only by some external rust library,
that's likely shouldn't concern QEMU qemu though.

I'm not confident enough to ack it but I won't object either
 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/cpu.h |   3 --
>  target/i386/cpu.c | 106 ++++++++++++++++++++++------------------------
>  2 files changed, 51 insertions(+), 58 deletions(-)
> 
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 7585407da54..b5cbd91c156 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2241,9 +2241,6 @@ struct ArchCPU {
>       */
>      bool legacy_multi_node;
>  
> -    /* Enable auto level-increase for all CPUID leaves */
> -    bool full_cpuid_auto_level;
> -
>      /* Only advertise CPUID leaves defined by the vendor */
>      bool vendor_cpuid_only;
>  
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index fb505d13122..6b9a1f2251a 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -7843,68 +7843,65 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
>  
>      /* CPUID[EAX=7,ECX=0].EBX always increased level automatically: */
>      x86_cpu_adjust_feat_level(cpu, FEAT_7_0_EBX);
> -    if (cpu->full_cpuid_auto_level) {
> -        x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
> -        x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_1_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_1_ECX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_6_EAX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_7_0_ECX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EAX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_7_1_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_7_2_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0001_ECX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0007_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_8000_0008_EBX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_SVM);
> +    x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE);
>  
> -        /* Intel Processor Trace requires CPUID[0x14] */
> -        if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) {
> -            if (cpu->intel_pt_auto_level) {
> -                x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
> -            } else if (cpu->env.cpuid_min_level < 0x14) {
> -                mark_unavailable_features(cpu, FEAT_7_0_EBX,
> -                    CPUID_7_0_EBX_INTEL_PT,
> -                    "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"");
> -            }
> +    /* Intel Processor Trace requires CPUID[0x14] */
> +    if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT)) {
> +        if (cpu->intel_pt_auto_level) {
> +            x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14);
> +        } else if (cpu->env.cpuid_min_level < 0x14) {
> +            mark_unavailable_features(cpu, FEAT_7_0_EBX, CPUID_7_0_EBX_INTEL_PT,
> +                "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"");
>          }
> +    }
>  
> -        /*
> -         * Intel CPU topology with multi-dies support requires CPUID[0x1F].
> -         * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect
> -         * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless
> -         * cpu->vendor_cpuid_only has been unset for compatibility with older
> -         * machine types.
> -         */
> -        if (x86_has_extended_topo(env->avail_cpu_topo) &&
> -            (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
> -        }
> +    /*
> +     * Intel CPU topology with multi-dies support requires CPUID[0x1F].
> +     * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect
> +     * extended toplogy by leaf 0xB. Only adjust it for Intel CPU, unless
> +     * cpu->vendor_cpuid_only has been unset for compatibility with older
> +     * machine types.
> +     */
> +    if (x86_has_extended_topo(env->avail_cpu_topo) &&
> +        (IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
> +    }
>  
> -        /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */
> -        if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24);
> -        }
> +    /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */
> +    if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24);
> +    }
>  
> -        /* SVM requires CPUID[0x8000000A] */
> -        if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
> -        }
> +    /* SVM requires CPUID[0x8000000A] */
> +    if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
> +    }
>  
> -        /* SEV requires CPUID[0x8000001F] */
> -        if (sev_enabled()) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F);
> -        }
> +    /* SEV requires CPUID[0x8000001F] */
> +    if (sev_enabled()) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F);
> +    }
>  
> -        if (env->features[FEAT_8000_0021_EAX]) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021);
> -        }
> +    if (env->features[FEAT_8000_0021_EAX]) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x80000021);
> +    }
>  
> -        /* SGX requires CPUID[0x12] for EPC enumeration */
> -        if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
> -            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
> -        }
> +    /* SGX requires CPUID[0x12] for EPC enumeration */
> +    if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
> +        x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
>      }
>  
>      /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
> @@ -8820,7 +8817,6 @@ static const Property x86_cpu_properties[] = {
>      DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0),
>      DEFINE_PROP_UINT8("avx10-version", X86CPU, env.avx10_version, 0),
>      DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
> -    DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
>      DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
>      DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true),
>      DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_features_only, true),


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

* Re: [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field
  2025-05-09  9:11   ` Zhao Liu
@ 2025-05-13 11:14     ` Igor Mammedov
  0 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 11:14 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Philippe Mathieu-Daudé, qemu-devel, Richard Henderson, kvm,
	Sergio Lopez, Gerd Hoffmann, Peter Maydell, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Michael S. Tsirkin, Eduardo Habkost,
	Marcel Apfelbaum, Alistair Francis, Daniel Henrique Barboza,
	Marcelo Tosatti, qemu-riscv, Weiwei Li, Amit Shah, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang

On Fri, 9 May 2025 17:11:13 +0800
Zhao Liu <zhao1.liu@intel.com> wrote:

> On Thu, May 08, 2025 at 03:35:43PM +0200, Philippe Mathieu-Daudé wrote:
> > Date: Thu,  8 May 2025 15:35:43 +0200
> > From: Philippe Mathieu-Daudé <philmd@linaro.org>
> > Subject: [PATCH v4 20/27] target/i386/cpu: Remove
> >  CPUX86State::enable_l3_cache field
> > X-Mailer: git-send-email 2.47.1
> > 
> > The CPUX86State::enable_l3_cache boolean was only disabled
> > for the pc-q35-2.7 and pc-i440fx-2.7 machines, which got
> > removed.  Being now always %true, we can remove it and simplify
> > cpu_x86_cpuid() and encode_cache_cpuid80000006().
> > 
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> >  target/i386/cpu.h |  6 ------
> >  target/i386/cpu.c | 39 +++++++++++++--------------------------
> >  2 files changed, 13 insertions(+), 32 deletions(-)
> > 
> > diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> > index b5cbd91c156..62239b0a562 100644
> > --- a/target/i386/cpu.h
> > +++ b/target/i386/cpu.h
> > @@ -2219,12 +2219,6 @@ struct ArchCPU {
> >       */
> >      bool enable_lmce;
> >  
> > -    /* Compatibility bits for old machine types.
> > -     * If true present virtual l3 cache for VM, the vcpus in the same virtual
> > -     * socket share an virtual l3 cache.
> > -     */
> > -    bool enable_l3_cache;
> > -
> >      /* Compatibility bits for old machine types.
> >       * If true present L1 cache as per-thread, not per-core.
> >       */  
> 
> I realize this is another special case.
> 
> There is no support for hybrid x86 CPUs in QEMU, but it's also true that
> there are some actual modern x86 Client CPUs without l3 cache, such as
> Intel MTL's low power E core (and it has vmx support, i.e., support KVM).
> 
> So I think we can keep this property as well, to have some more
> configuration options for users' emulation.

it also seems that libvirt uses it.


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

* Re: [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
  2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
                   ` (26 preceding siblings ...)
  2025-05-08 13:35 ` [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
@ 2025-05-13 11:23 ` Igor Mammedov
  2025-05-30 11:35   ` Michael S. Tsirkin
  27 siblings, 1 reply; 108+ messages in thread
From: Igor Mammedov @ 2025-05-13 11:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, devel

On Thu,  8 May 2025 15:35:23 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> Since v3:
> - Addressed Thomas and Zhao review comments
> - Rename fw_cfg_init_mem_[no]dma() helpers
> - Remove unused CPU properties
> - Remove {multi,linux}boot.bin
> - Added R-b tags
> 
> 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.

CCing libvirt folks

series removes some properties that has been used as compat
knobs with 2.6/2.7 machine types that are being removed.

However libvirt might still use them,
please check if being removed properties are safe to remove
as is | should be deprecated 1st | should be left alone
from an immediate user perspective.

> 
> Based-on: <20250506143905.4961-1-philmd@linaro.org>
> 
[...]


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

* Re: [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix
  2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
  2025-05-09 15:33   ` Igor Mammedov
@ 2025-05-15  8:04   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-15  8:04 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> Rename fw_cfg_init_mem() as fw_cfg_init_mem_nodma()
> to distinct with the DMA version (currently named
> fw_cfg_init_mem_wide).
> 
> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/nvram/fw_cfg.h | 3 ++-
>   hw/hppa/machine.c         | 2 +-
>   hw/nvram/fw_cfg.c         | 7 +++----
>   3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> index d41b9328fd1..d5161a79436 100644
> --- a/include/hw/nvram/fw_cfg.h
> +++ b/include/hw/nvram/fw_cfg.h
> @@ -307,7 +307,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s,
>   
>   FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
>                                   AddressSpace *dma_as);
> -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
> +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
> +                                  unsigned data_width);
>   FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
>                                    hwaddr data_addr, uint32_t data_width,
>                                    hwaddr dma_addr, AddressSpace *dma_as);
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index dacedc5409c..0d768cb90b0 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -201,7 +201,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus,
>       int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env);
>       int len;
>   
> -    fw_cfg = fw_cfg_init_mem(addr, addr + 4);
> +    fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1);

It does additional job to replace 
fw_cfg_data_mem_ops.valid.max_access_size with a hardcode 1.

It needs clarification at least in commit message that doing it is safe 
that fw_cfg_data_mem_ops.valid.max_access_size is not changed by other code.

It's even better to put this in a seperate patch.

For the pure rename part:

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

>       fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus);
>       fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS);
>       fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 54cfa07d3f5..10f8f8db86f 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -1087,11 +1087,10 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
>       return s;
>   }
>   
> -FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)
> +FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
> +                                  unsigned data_width)
>   {
> -    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_wide(ctl_addr, data_addr, data_width, 0, NULL);
>   }
>   
>   


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

* Re: [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma()
  2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
  2025-05-09  2:49   ` Zhao Liu
  2025-05-09 15:35   ` Igor Mammedov
@ 2025-05-15  8:05   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-15  8:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> fw_cfg_init_mem_wide() is prefered to initialize fw_cfg
> with DMA support. Without DMA, use fw_cfg_init_mem_nodma().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

> ---
>   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..654a2f0999f 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_nodma(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);


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

* Re: [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out
  2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
  2025-05-09  2:50   ` Zhao Liu
  2025-05-09 15:38   ` Igor Mammedov
@ 2025-05-15  8:08   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-15  8:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> 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>

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

> ---
>   hw/nvram/fw_cfg.c | 17 +++++++++++++----
>   1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 10f8f8db86f..4067324fb09 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,10 +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_addr && dma_as);
> +    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr,
> +                                    dma_addr, dma_as);
> +}
> +
>   FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
>                                     unsigned data_width)
>   {
> -    return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL);
> +    return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, 0, NULL);
>   }
>   
>   


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

* Re: [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma()
  2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
  2025-05-09  2:52   ` Zhao Liu
  2025-05-09  6:51   ` Zhao Liu
@ 2025-05-15  8:17   ` Xiaoyao Li
  2 siblings, 0 replies; 108+ messages in thread
From: Xiaoyao Li @ 2025-05-15  8:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Igor Mammedov,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

On 5/8/2025 9:35 PM, Philippe Mathieu-Daudé wrote:
> "wide" in fw_cfg_init_mem_wide() means "DMA support".
> Rename for clarity.

PS: at the time when fw_cfg_init_mem_wide() was first introcuded,
'wide' was exactly for data_width. see commit 6c87e3d5967a.

> Suggested-by: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

with the usage in hw/loongarch/fw_cfg.c fixed,

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

> ---
>   include/hw/nvram/fw_cfg.h | 6 +++---
>   hw/arm/virt.c             | 2 +-
>   hw/nvram/fw_cfg.c         | 6 +++---
>   hw/riscv/virt.c           | 4 ++--
>   4 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> index d5161a79436..c4c49886754 100644
> --- a/include/hw/nvram/fw_cfg.h
> +++ b/include/hw/nvram/fw_cfg.h
> @@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
>                                   AddressSpace *dma_as);
>   FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr,
>                                     unsigned data_width);
> -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
> -                                 hwaddr data_addr, uint32_t data_width,
> -                                 hwaddr dma_addr, AddressSpace *dma_as);
> +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
> +                                hwaddr data_addr, uint32_t data_width,
> +                                hwaddr dma_addr, AddressSpace *dma_as);
>   
>   FWCfgState *fw_cfg_find(void);
>   bool fw_cfg_dma_enabled(void *opaque);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9a6cd085a37..7583f0a85d9 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1361,7 +1361,7 @@ static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as)
>       FWCfgState *fw_cfg;
>       char *nodename;
>   
> -    fw_cfg = fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as);
> +    fw_cfg = fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, as);
>       fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus);
>   
>       nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base);
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 4067324fb09..51b028b5d0a 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -1087,9 +1087,9 @@ static FWCfgState *fw_cfg_init_mem_internal(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)
> +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr,
> +                                hwaddr data_addr, uint32_t data_width,
> +                                hwaddr dma_addr, AddressSpace *dma_as)
>   {
>       assert(dma_addr && dma_as);
>       return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_addr,
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index be1bf0f6468..3ddea18c93e 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -1266,8 +1266,8 @@ static FWCfgState *create_fw_cfg(const MachineState *ms)
>       hwaddr base = virt_memmap[VIRT_FW_CFG].base;
>       FWCfgState *fw_cfg;
>   
> -    fw_cfg = fw_cfg_init_mem_wide(base + 8, base, 8, base + 16,
> -                                  &address_space_memory);
> +    fw_cfg = fw_cfg_init_mem_dma(base + 8, base, 8, base + 16,
> +                                 &address_space_memory);
>       fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus);
>   
>       return fw_cfg;


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

* Re: How to mark internal properties
  2025-05-13  9:26                   ` BALATON Zoltan
  2025-05-13  9:32                     ` Daniel P. Berrangé
  2025-05-13 11:01                     ` Markus Armbruster
@ 2025-05-26  8:58                     ` Markus Armbruster
  2 siblings, 0 replies; 108+ messages in thread
From: Markus Armbruster @ 2025-05-26  8:58 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Mark Cave-Ayland, Daniel P. Berrangé, Peter Maydell,
	Thomas Huth, Zhao Liu, Xiaoyao Li, Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, kvm, Gerd Hoffmann,
	Laurent Vivier, Jiaxun Yang, Yi Liu, Michael S. Tsirkin,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Igor Mammedov, Fabiano Rosas, Liu Zhiwei,
	Clément Mathieu--Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang

BALATON Zoltan <balaton@eik.bme.hu> writes:

> On Tue, 13 May 2025, Markus Armbruster wrote:
>> Mark Cave-Ayland <mark.caveayland@nutanix.com> writes:
>>> On a related note this also brings us back to the discussion as to the relationship between qdev and QOM: at one point I was under the impression that qdev properties were simply QOM properties that were exposed externally, i.e on the commmand line for use with -device.
>>>
>>> Can you provide an update on what the current thinking is in this area, in particular re: scoping of qdev vs QOM properties?
>>
>> qdev is a leaky layer above QOM.
>>
>> qdev properties are also QOM properties.
>>
>> All device properties are exposed externally.
>
> That was clear but the question was if QOM properties (that are not qdev properties) exist and if so are they also exposed? If not exposed it may be used for internal properties (where simpler solutions aren't convenient) but maybe qdev also adds easier definition of properties that's why they used instead of QOM properties?

I'm afraid we haven't answered your question clearly, yet.  The answer
is yes, QOM properties that are not qdev properties do exist.  The first
one that comes along: ich9_pm_add_properties() adds a bunch to device
ICH9-LPC.  They are exposted externally.  To see them, try

    $ qemu-system-x86_64 -device ICH9-LPC,help

[...]


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

* Re: [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
  2025-05-13 11:23 ` [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Igor Mammedov
@ 2025-05-30 11:35   ` Michael S. Tsirkin
  2025-05-30 12:08     ` Peter Krempa
  0 siblings, 1 reply; 108+ messages in thread
From: Michael S. Tsirkin @ 2025-05-30 11:35 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Philippe Mathieu-Daudé, qemu-devel, Richard Henderson, kvm,
	Sergio Lopez, Gerd Hoffmann, Peter Maydell, Laurent Vivier,
	Jiaxun Yang, Yi Liu, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, devel

On Tue, May 13, 2025 at 01:23:38PM +0200, Igor Mammedov wrote:
> On Thu,  8 May 2025 15:35:23 +0200
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 
> > Since v3:
> > - Addressed Thomas and Zhao review comments
> > - Rename fw_cfg_init_mem_[no]dma() helpers
> > - Remove unused CPU properties
> > - Remove {multi,linux}boot.bin
> > - Added R-b tags
> > 
> > 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.
> 
> CCing libvirt folks
> 
> series removes some properties that has been used as compat
> knobs with 2.6/2.7 machine types that are being removed.
> 
> However libvirt might still use them,
> please check if being removed properties are safe to remove
> as is | should be deprecated 1st | should be left alone
> from an immediate user perspective.

Anyone on libvirt side can confirm please?

> > 
> > Based-on: <20250506143905.4961-1-philmd@linaro.org>
> > 
> [...]


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

* Re: [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
  2025-05-30 11:35   ` Michael S. Tsirkin
@ 2025-05-30 12:08     ` Peter Krempa
  2025-06-17  6:54       ` Zhao Liu
  0 siblings, 1 reply; 108+ messages in thread
From: Peter Krempa @ 2025-05-30 12:08 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Igor Mammedov, Philippe Mathieu-Daudé, qemu-devel,
	Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Zhao Liu, Yanan Wang, Helge Deller, Palmer Dabbelt,
	Ani Sinha, Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Clément Mathieu --Drif, qemu-arm, Marc-André Lureau,
	Huacai Chen, Jason Wang, devel

On Fri, May 30, 2025 at 07:35:38 -0400, Michael S. Tsirkin via Devel wrote:
> On Tue, May 13, 2025 at 01:23:38PM +0200, Igor Mammedov wrote:
> > On Thu,  8 May 2025 15:35:23 +0200
> > Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> > 
> > > Since v3:
> > > - Addressed Thomas and Zhao review comments
> > > - Rename fw_cfg_init_mem_[no]dma() helpers
> > > - Remove unused CPU properties
> > > - Remove {multi,linux}boot.bin
> > > - Added R-b tags
> > > 
> > > 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.
> > 
> > CCing libvirt folks
> > 
> > series removes some properties that has been used as compat
> > knobs with 2.6/2.7 machine types that are being removed.
> > 
> > However libvirt might still use them,
> > please check if being removed properties are safe to remove
> > as is | should be deprecated 1st | should be left alone
> > from an immediate user perspective.
> 
> Anyone on libvirt side can confirm please?

Sorry, it was a bit of a chore to go through the patches.

IIUC the following list is to be reviewed:

 DEFINE_PROP_BOOL("x-buggy-eim", IntelIOMMUState, buggy_eim, false)
 DEFINE_PROP_BOOL("x-ignore-backend-features", VirtIOPCIProxy,
 DEFINE_PROP_BOOL("migrate", PCSpkState, migrate,  true),
 DEFINE_PROP_UINT8("version", IOAPICCommonState, version, IOAPIC_VER_DEF)
 DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features
 DEFINE_PROP_BOOL("format_transport_address", VirtIOMMIOProxy,
 DEFINE_PROP_BOOL("legacy-instance-id", APICCommonState, legacy_instance_id,

None of the above are exposed by libvirt to the user nor used by libvirt
internally.

 DEFINE_PROP_BIT("page-per-vq", VirtIOPCIProxy, flags

This property is exposed to users for all virtio devices as
'page_per_vq' property:a

https://www.libvirt.org/formatdomain.html#virtio-related-options

It is an optional property and not formatted to qemu unless explicitly
requested by the user. Removing it thus should be fine without the need
to change anything in libvirt

The rest are CPU properties

 DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
 DEFINE_PROP_BOOL("fill-mtrr-mask", X86CPU, fill_mtrr_mask, true),
 DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),

which appear in our cpu test data but I'm not 100% sure how they are
used. Jirka, can you please comment?

Finally there's

 DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true),

which is exposed to the users via cache mode setting of cpu:

https://www.libvirt.org/formatdomain.html#cpu-model-and-topology

look for 'cache'.

Thus from libvirt's side 'page-per-vq' and 'l3-cache' will likely require
deprecation period. The rest except for CPU is fine to remove without
anything at least from our PoV.

Jirka will hopefully clarify the Cpu property side.


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

* Re: [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-05-09 15:23   ` Igor Mammedov
@ 2025-06-02  6:13     ` Thomas Huth
  2025-06-02  8:53       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 108+ messages in thread
From: Thomas Huth @ 2025-06-02  6:13 UTC (permalink / raw)
  To: Igor Mammedov, Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On 09/05/2025 17.23, Igor Mammedov wrote:
> On Thu,  8 May 2025 15:35:24 +0200
> Philippe Mathieu-Daudé <philmd@linaro.org> 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.
> 
> if these machine types are the last users of compat arrays,
> it's better to remove array at the same time, aka squash
> those patches later in series into this one.
> That leaves no illusion that compats could be used in the later patches.

IMHO the generic hw_compat array should be treated separately since this is 
independent from x86. So in case someone ever needs to backport these 
patches to an older branch, they can decide more easily whether they want to 
apply the generic hw_compat part or only the x86-specific part of this series.

  Thomas


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

* Re: [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-06-02  6:13     ` Thomas Huth
@ 2025-06-02  8:53       ` Philippe Mathieu-Daudé
  2025-06-02 10:26         ` Igor Mammedov
  0 siblings, 1 reply; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-02  8:53 UTC (permalink / raw)
  To: Thomas Huth, Igor Mammedov
  Cc: qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On 2/6/25 08:13, Thomas Huth wrote:
> On 09/05/2025 17.23, Igor Mammedov wrote:
>> On Thu,  8 May 2025 15:35:24 +0200
>> Philippe Mathieu-Daudé <philmd@linaro.org> 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.
>>
>> if these machine types are the last users of compat arrays,
>> it's better to remove array at the same time, aka squash
>> those patches later in series into this one.
>> That leaves no illusion that compats could be used in the later patches.
> 
> IMHO the generic hw_compat array should be treated separately since this 
> is independent from x86. So in case someone ever needs to backport these 
> patches to an older branch, they can decide more easily whether they 
> want to apply the generic hw_compat part or only the x86-specific part 
> of this series.

Yes, it is clearer this way than squashed.


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

* Re: [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines
  2025-06-02  8:53       ` Philippe Mathieu-Daudé
@ 2025-06-02 10:26         ` Igor Mammedov
  0 siblings, 0 replies; 108+ messages in thread
From: Igor Mammedov @ 2025-06-02 10:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, qemu-devel, Richard Henderson, kvm, Sergio Lopez,
	Gerd Hoffmann, Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Michael S. Tsirkin, Eduardo Habkost, Marcel Apfelbaum,
	Alistair Francis, Daniel Henrique Barboza, Marcelo Tosatti,
	qemu-riscv, Weiwei Li, Amit Shah, Zhao Liu, Yanan Wang,
	Helge Deller, Palmer Dabbelt, Ani Sinha, Fabiano Rosas,
	Paolo Bonzini, Liu Zhiwei, Clément Mathieu--Drif, qemu-arm,
	Marc-André Lureau, Huacai Chen, Jason Wang, Mark Cave-Ayland

On Mon, 2 Jun 2025 10:53:19 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> On 2/6/25 08:13, Thomas Huth wrote:
> > On 09/05/2025 17.23, Igor Mammedov wrote:  
> >> On Thu,  8 May 2025 15:35:24 +0200
> >> Philippe Mathieu-Daudé <philmd@linaro.org> 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.  
> >>
> >> if these machine types are the last users of compat arrays,
> >> it's better to remove array at the same time, aka squash
> >> those patches later in series into this one.
> >> That leaves no illusion that compats could be used in the later patches.  
> > 
> > IMHO the generic hw_compat array should be treated separately since this 
> > is independent from x86. So in case someone ever needs to backport these 
> > patches to an older branch, they can decide more easily whether they 
> > want to apply the generic hw_compat part or only the x86-specific part 
> > of this series.  
> 
> Yes, it is clearer this way than squashed.

ok, let's leave it as is.

> 


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

* Re: [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
  2025-05-30 12:08     ` Peter Krempa
@ 2025-06-17  6:54       ` Zhao Liu
  0 siblings, 0 replies; 108+ messages in thread
From: Zhao Liu @ 2025-06-17  6:54 UTC (permalink / raw)
  To: Peter Krempa
  Cc: Michael S. Tsirkin, Igor Mammedov, Philippe Mathieu-Daud�,
	qemu-devel, Richard Henderson, kvm, Sergio Lopez, Gerd Hoffmann,
	Peter Maydell, Laurent Vivier, Jiaxun Yang, Yi Liu,
	Eduardo Habkost, Marcel Apfelbaum, Alistair Francis,
	Daniel Henrique Barboza, Marcelo Tosatti, qemu-riscv, Weiwei Li,
	Amit Shah, Yanan Wang, Helge Deller, Palmer Dabbelt, Ani Sinha,
	Fabiano Rosas, Paolo Bonzini, Liu Zhiwei,
	Cl�ment Mathieu --Drif, qemu-arm, Marc-Andr� Lureau,
	Huacai Chen, Jason Wang, devel

Hi Peter,

> Finally there's
> 
>  DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true),
> 
> which is exposed to the users via cache mode setting of cpu:
> 
> https://www.libvirt.org/formatdomain.html#cpu-model-and-topology
> 
> look for 'cache'.

I found this link doesn't mention "l3-cache", but it appears in
libvirt's src/qemu/qemu_command.c.

> Thus from libvirt's side 'page-per-vq' and 'l3-cache' will likely require
> deprecation period. The rest except for CPU is fine to remove without
> anything at least from our PoV.

So I understand that the file qemu_command.c contains all the QEMU
commands/properties/options used by libvirt, thereby in the future if
one wants to remove other properties, he can just check that file,
right?

Thanks,
Zhao


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

end of thread, other threads:[~2025-06-17  6:33 UTC | newest]

Thread overview: 108+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 13:35 [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Philippe Mathieu-Daudé
2025-05-08 13:35 ` [PATCH v4 01/27] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Philippe Mathieu-Daudé
2025-05-09 15:23   ` Igor Mammedov
2025-06-02  6:13     ` Thomas Huth
2025-06-02  8:53       ` Philippe Mathieu-Daudé
2025-06-02 10:26         ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 02/27] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Philippe Mathieu-Daudé
2025-05-09 15:18   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 03/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Philippe Mathieu-Daudé
2025-05-09  2:49   ` Zhao Liu
2025-05-09 15:33   ` Igor Mammedov
2025-05-15  8:04   ` Xiaoyao Li
2025-05-08 13:35 ` [PATCH v4 04/27] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Philippe Mathieu-Daudé
2025-05-09  2:49   ` Zhao Liu
2025-05-09 15:35   ` Igor Mammedov
2025-05-15  8:05   ` Xiaoyao Li
2025-05-08 13:35 ` [PATCH v4 05/27] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Philippe Mathieu-Daudé
2025-05-09  2:50   ` Zhao Liu
2025-05-09 15:38   ` Igor Mammedov
2025-05-15  8:08   ` Xiaoyao Li
2025-05-08 13:35 ` [PATCH v4 06/27] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Philippe Mathieu-Daudé
2025-05-09  2:52   ` Zhao Liu
2025-05-09  6:51   ` Zhao Liu
2025-05-09 15:39     ` Igor Mammedov
2025-05-15  8:17   ` Xiaoyao Li
2025-05-08 13:35 ` [PATCH v4 07/27] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Philippe Mathieu-Daudé
2025-05-09  3:23   ` Zhao Liu
2025-05-09 15:41   ` Igor Mammedov
2025-05-09 15:44     ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 08/27] hw/i386/pc: Remove multiboot.bin Philippe Mathieu-Daudé
2025-05-09  6:11   ` Zhao Liu
2025-05-08 13:35 ` [PATCH v4 09/27] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Philippe Mathieu-Daudé
2025-05-09  6:37   ` Zhao Liu
2025-05-09 16:00   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 10/27] hw/i386/pc: Remove linuxboot.bin Philippe Mathieu-Daudé
2025-05-09  6:53   ` Zhao Liu
2025-05-09 16:04   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 11/27] hw/i386/pc: Remove pc_compat_2_6[] array Philippe Mathieu-Daudé
2025-05-09  6:54   ` Zhao Liu
2025-05-12  8:19   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Philippe Mathieu-Daudé
2025-05-09  6:49   ` Xiaoyao Li
2025-05-09  7:32     ` Zhao Liu
2025-05-09 10:04       ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Thomas Huth
2025-05-12  2:45         ` Zhao Liu
2025-05-12  6:34         ` How to mark internal properties Markus Armbruster
2025-05-12  8:46         ` How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) Peter Maydell
2025-05-12  9:06           ` Daniel P. Berrangé
2025-05-12 10:54             ` How to mark internal properties Markus Armbruster
2025-05-12 13:33               ` Xiaoyao Li
2025-05-12 14:41                 ` BALATON Zoltan
2025-05-13  8:16                   ` Thomas Huth
2025-05-12 14:48               ` Mark Cave-Ayland
2025-05-13  8:18                 ` Markus Armbruster
2025-05-13  9:26                   ` BALATON Zoltan
2025-05-13  9:32                     ` Daniel P. Berrangé
2025-05-13 10:38                       ` Markus Armbruster
2025-05-13 11:01                     ` Markus Armbruster
2025-05-26  8:58                     ` Markus Armbruster
2025-05-12 15:22               ` Igor Mammedov
2025-05-13  8:08                 ` Markus Armbruster
2025-05-12 15:00       ` [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 13/27] target/i386/cpu: Remove CPUX86State::fill_mtrr_mask field Philippe Mathieu-Daudé
2025-05-09  9:30   ` Zhao Liu
2025-05-12 15:24   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 14/27] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Philippe Mathieu-Daudé
2025-05-09  9:30   ` Zhao Liu
2025-05-13  8:34   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 15/27] hw/core/machine: Remove hw_compat_2_6[] array Philippe Mathieu-Daudé
2025-05-09  9:31   ` Zhao Liu
2025-05-13  8:36   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 16/27] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Philippe Mathieu-Daudé
2025-05-09  9:33   ` Zhao Liu
2025-05-08 13:35 ` [PATCH v4 17/27] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Philippe Mathieu-Daudé
2025-05-09  9:33   ` Zhao Liu
2025-05-13  8:53   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 18/27] hw/i386/pc: Remove pc_compat_2_7[] array Philippe Mathieu-Daudé
2025-05-09  9:35   ` Zhao Liu
2025-05-08 13:35 ` [PATCH v4 19/27] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Philippe Mathieu-Daudé
2025-05-09  9:37   ` Zhao Liu
2025-05-13 11:02   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 20/27] target/i386/cpu: Remove CPUX86State::enable_l3_cache field Philippe Mathieu-Daudé
2025-05-09  9:11   ` Zhao Liu
2025-05-13 11:14     ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 21/27] hw/audio/pcspk: Remove PCSpkState::migrate field Philippe Mathieu-Daudé
2025-05-09  9:38   ` Zhao Liu
2025-05-13  9:02   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 22/27] hw/core/machine: Remove hw_compat_2_7[] array Philippe Mathieu-Daudé
2025-05-09  9:38   ` Zhao Liu
2025-05-08 13:35 ` [PATCH v4 23/27] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Philippe Mathieu-Daudé
2025-05-09  9:41   ` Zhao Liu
2025-05-13  9:16   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 24/27] hw/intc/ioapic: Remove IOAPICCommonState::version field Philippe Mathieu-Daudé
2025-05-09 10:32   ` Zhao Liu
2025-05-13 10:28   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 25/27] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Philippe Mathieu-Daudé
2025-05-09  9:43   ` Zhao Liu
2025-05-13 10:30   ` Igor Mammedov
2025-05-08 13:35 ` [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Philippe Mathieu-Daudé
2025-05-09  9:13   ` Mark Cave-Ayland
2025-05-09  9:46   ` Zhao Liu
2025-05-08 13:35 ` [PATCH v4 27/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition Philippe Mathieu-Daudé
2025-05-09 10:19   ` Zhao Liu
2025-05-13 10:48   ` Igor Mammedov
2025-05-13 11:23 ` [PATCH v4 00/27] hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines Igor Mammedov
2025-05-30 11:35   ` Michael S. Tsirkin
2025-05-30 12:08     ` Peter Krempa
2025-06-17  6:54       ` Zhao Liu

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