hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines
v3 cover hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines
(series reviewed)
Since v2:
- Removed qtest in test-x86-cpuid-compat.c
Since v1:
- Fixed issues noticed by Thomas
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.4 and 2.5 machines removal, as it is a big enough number of LoC removed. Rest will follow. Highlight is the legacy fw_cfg API removal :)
Philippe Mathieu-Daudé (19):
hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines hw/i386/pc: Remove PCMachineClass::broken_reserved_end field hw/i386/pc: Remove pc_compat_2_4[] array
target/i386/cpu: Remove X86CPU::check_cpuid field hw/core/machine: Remove hw_compat_2_4[] array hw/net/e1000: Remove unused E1000_FLAG_MAC flag hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines hw/i386/x86: Remove X86MachineClass::save_tsc_khz field hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE hw/core/machine: Remove hw_compat_2_5[] array hw/block/fdc-isa: Remove 'fallback' property hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION
definition
hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition hw/net/vmxnet3: Merge DeviceRealize in InstanceInit
include/hw/boards.h | 9 +-- include/hw/i386/pc.h | 7 -- include/hw/i386/x86.h | 5 -- include/hw/loader.h | 2 - include/hw/nvram/fw_cfg.h | 10 --- include/hw/virtio/virtio-pci.h | 8 -- target/i386/cpu.h | 1 - hw/block/fdc-isa.c | 4 +- hw/core/loader.c | 14 ---- hw/core/machine.c | 18 ----- hw/i386/pc.c | 42 ++--------- hw/i386/pc_piix.c | 26 ------- hw/i386/pc_q35.c | 26 ------- hw/i386/x86.c | 1 - hw/net/e1000.c | 72 ++++-------------- hw/net/vmxnet3.c | 44 ++--------- hw/nvram/fw_cfg.c | 109 ++-------------------------- hw/scsi/vmw_pvscsi.c | 67 +++-------------- hw/virtio/virtio-pci.c | 11 +-- system/vl.c | 5 -- target/i386/cpu.c | 3 +- target/i386/machine.c | 5 +- tests/qtest/test-x86-cpuid-compat.c | 14 ---- 23 files changed, 51 insertions(+), 452 deletions(-)
Signature · 1 line
2.47.1
PATCH v3 1/19 hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines
These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.
Remove the qtest in test-x86-cpuid-compat.c file.
--- hw/i386/pc_piix.c | 13 ------------- hw/i386/pc_q35.c | 13 ------------- tests/qtest/test-x86-cpuid-compat.c | 14 -------------- 3 files changed, 40 deletions(-)
hw/i386/pc_piix.c +0 -13
@@ -791,19 +791,6 @@ static void pc_i440fx_machine_2_5_options(MachineClass *m)DEFINE_I440FX_MACHINE (2 ,5 ); -static void pc_i440fx_machine_2_4_options (MachineClass *m) -{ -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_i440fx_machine_2_5_options (m); - m->hw_version ="2.4.0" ; - pcmc->broken_reserved_end = true; -compat_props_add (m->compat_props, hw_compat_2_4, hw_compat_2_4_len); -compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); -} - -DEFINE_I440FX_MACHINE (2 ,4 ); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
hw/i386/pc_q35.c +0 -13
@@ -685,16 +685,3 @@ static void pc_q35_machine_2_5_options(MachineClass *m) }DEFINE_Q35_MACHINE (2 ,5 ); - -static void pc_q35_machine_2_4_options (MachineClass *m) -{ -PCMachineClass *pcmc =PC_MACHINE_CLASS (m); - -pc_q35_machine_2_5_options (m); - m->hw_version ="2.4.0" ; - pcmc->broken_reserved_end = true; -compat_props_add (m->compat_props, hw_compat_2_4, hw_compat_2_4_len); -compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); -} - -DEFINE_Q35_MACHINE (2 ,4 );
tests/qtest/test-x86-cpuid-compat.c +0 -14
@@ -365,20 +365,6 @@ int main(int argc, char **argv) "level", 10); } -/* -* xlevel doesn't have any feature that triggers auto-level -* code on old machine-types. Just check that the compat code -* is working correctly: -*/ -if (qtest_has_machine ("pc-i440fx-2.4" )) { -add_cpuid_test ("x86/cpuid/xlevel-compat/pc-i440fx-2.4/npt-off" , -"SandyBridge" ,NULL ,"pc-i440fx-2.4" , -"xlevel" ,0x80000008 ); -add_cpuid_test ("x86/cpuid/xlevel-compat/pc-i440fx-2.4/npt-on" , -"SandyBridge" ,"svm=on,npt=on" ,"pc-i440fx-2.4" , -"xlevel" ,0x80000008 ); - } -/* Test feature parsing */ add_feature_test("x86/cpuid/features/plus", "486", "+arat",
Signature · 1 line
2.47.1
Re: [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines
Quoted 13 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:47 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.4 and
pc-i440fx-2.4 machines
X-Mailer: git-send-email 2.47.1These 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.cfile.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- hw/i386/pc_piix.c | 13 ------------- hw/i386/pc_q35.c | 13 ------------- tests/qtest/test-x86-cpuid-compat.c | 14 -------------- 3 files changed, 40 deletions(-)
PATCH v3 2/19 hw/i386/pc: Remove PCMachineClass::broken_reserved_end field
In reply to Philippe Mathieu-DaudéThe PCMachineClass::broken_reserved_end field was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it and simplify pc_memory_init().
--- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-)
include/hw/i386/pc.h +0 -1
@@ -107,7 +107,6 @@ struct PCMachineClass {/* RAM / address space compat: */ bool gigabyte_align;bool has_reserved_memory; -bool broken_reserved_end;bool enforce_amd_1tb_hole;bool isa_bios_alias;
hw/i386/pc.c +5 -8
@@ -999,14 +999,13 @@ void pc_memory_init(PCMachineState *pcms,if (machine->device_memory) {uint64_t *val =g_malloc (sizeof (*val)); -uint64_t res_mem_end = machine->device_memory->base; - -if (!pcmc->broken_reserved_end) { - res_mem_end +=memory_region_size (&machine->device_memory->mr); - } +uint64_t res_mem_end;if (pcms->cxl_devices_state.is_enabled) { res_mem_end = cxl_resv_end; + }else { + res_mem_end = machine->device_memory->base + +memory_region_size (&machine->device_memory->mr); } *val =cpu_to_le64 (ROUND_UP (res_mem_end,1 * GiB));fw_cfg_add_file (fw_cfg,"etc/reserved-memory-end" , val,sizeof (*val));
@@ -1044,9 +1043,7 @@ uint64_t pc_pci_hole64_start(void) hole64_start =pc_get_cxl_range_end (pcms); }else if (pcmc->has_reserved_memory && (ms->ram_size < ms->maxram_size)) {pc_get_device_memory_range (pcms, &hole64_start, &size); -if (!pcmc->broken_reserved_end) { - hole64_start += size; - } + hole64_start += size; }else { hole64_start =pc_above_4g_end (pcms); }
Signature · 1 line
2.47.1
Re: [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:48 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 02/19] hw/i386/pc: Remove
PCMachineClass::broken_reserved_endfield
X-Mailer: git-send-email 2.47.1The
PCMachineClass::broken_reserved_endfield was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it and simplifypc_memory_init().
Quoted 7 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-)
PATCH v3 3/19 hw/i386/pc: Remove pc_compat_2_4[] array
In reply to Philippe Mathieu-DaudéThe pc_compat_2_4[] array was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it.
--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 19 ------------------- 2 files changed, 22 deletions(-)
include/hw/i386/pc.h +0 -3
@@ -301,9 +301,6 @@ extern const size_t pc_compat_2_6_len;extern GlobalProperty pc_compat_2_5[];extern const size_t pc_compat_2_5_len; -extern GlobalProperty pc_compat_2_4[]; -extern const size_t pc_compat_2_4_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \
hw/i386/pc.c +0 -19
@@ -262,25 +262,6 @@ const size_t pc_compat_2_6_len = G_N_ELEMENTS(pc_compat_2_6);GlobalProperty pc_compat_2_5[] = {};const size_t pc_compat_2_5_len =G_N_ELEMENTS (pc_compat_2_5); -GlobalProperty pc_compat_2_4[] = { - PC_CPU_MODEL_IDS("2.4.0") - {"Haswell-" TYPE_X86_CPU ,"abm" ,"off" }, - {"Haswell-noTSX-" TYPE_X86_CPU ,"abm" ,"off" }, - {"Broadwell-" TYPE_X86_CPU ,"abm" ,"off" }, - {"Broadwell-noTSX-" TYPE_X86_CPU ,"abm" ,"off" }, - {"host" "-" TYPE_X86_CPU ,"host-cache-info" ,"on" }, - {TYPE_X86_CPU ,"check" ,"off" }, - {"qemu64" "-" TYPE_X86_CPU ,"sse4a" ,"on" }, - {"qemu64" "-" TYPE_X86_CPU ,"abm" ,"on" }, - {"qemu64" "-" TYPE_X86_CPU ,"popcnt" ,"on" }, - {"qemu32" "-" TYPE_X86_CPU ,"popcnt" ,"on" }, - {"Opteron_G2" "-" TYPE_X86_CPU ,"rdtscp" ,"on" }, - {"Opteron_G3" "-" TYPE_X86_CPU ,"rdtscp" ,"on" }, - {"Opteron_G4" "-" TYPE_X86_CPU ,"rdtscp" ,"on" }, - {"Opteron_G5" "-" TYPE_X86_CPU ,"rdtscp" ,"on" , } -}; -const size_t pc_compat_2_4_len =G_N_ELEMENTS (pc_compat_2_4); -/* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
Signature · 1 line
2.47.1
Re: [PATCH v3 03/19] hw/i386/pc: Remove pc_compat_2_4[] array
Quoted 8 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:49 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 03/19] hw/i386/pc: Remove pc_compat_2_4[] array
X-Mailer: git-send-email 2.47.1The pc_compat_2_4[] array was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it.
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 19 ------------------- 2 files changed, 22 deletions(-)
PATCH v3 4/19 target/i386/cpu: Remove X86CPU::check_cpuid field
In reply to Philippe Mathieu-DaudéThe X86CPU::check_cpuid boolean was only set in the pc_compat_2_4[] array, via the 'check=off' property. We removed all machines using that array, lets remove that CPU property and simplify x86_cpu_realizefn().
--- target/i386/cpu.h | 1 - target/i386/cpu.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
target/i386/cpu.h +0 -1
@@ -2168,7 +2168,6 @@ struct ArchCPU {uint8_t hyperv_ver_id_sb;uint32_t hyperv_ver_id_sn; -bool check_cpuid;bool enforce_cpuid;/* * Force features to be enabled even if the host doesn't support them.
target/i386/cpu.c +1 -2
@@ -8169,7 +8169,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) } } -if (x86_cpu_filter_features (cpu, cpu->check_cpuid || cpu->enforce_cpuid)) { +if (x86_cpu_filter_features (cpu, cpu->enforce_cpuid)) {if (cpu->enforce_cpuid) { error_setg(&local_err, accel_uses_host_cpuid() ?
@@ -8808,7 +8808,6 @@ static const Property x86_cpu_properties[] = {DEFINE_PROP_UINT8 ("hv-version-id-sbranch" ,X86CPU , hyperv_ver_id_sb,0 ),DEFINE_PROP_UINT32 ("hv-version-id-snumber" ,X86CPU , hyperv_ver_id_sn,0 ), -DEFINE_PROP_BOOL ("check" ,X86CPU , check_cpuid, true),DEFINE_PROP_BOOL ("enforce" ,X86CPU , enforce_cpuid, false),DEFINE_PROP_BOOL ("x-force-features" ,X86CPU , force_features, false), DEFINE_PROP_BOOL("kvm", X86CPU, expose_kvm, true),
Signature · 1 line
2.47.1
Re: [PATCH v3 04/19] target/i386/cpu: Remove X86CPU::check_cpuid field
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:50 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 04/19] target/i386/cpu: RemoveX86CPU::check_cpuidfield
X-Mailer: git-send-email 2.47.1The
X86CPU::check_cpuidboolean was only set in the pc_compat_2_4[] array, via the 'check=off' property. We removed all machines using that array, lets remove that CPU property and simplifyx86_cpu_realizefn().
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- target/i386/cpu.h | 1 - target/i386/cpu.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
PATCH v3 5/19 hw/core/machine: Remove hw_compat_2_4[] array
In reply to Philippe Mathieu-DaudéThe hw_compat_2_4[] array was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it.
--- include/hw/boards.h | 3 --- hw/core/machine.c | 9 --------- 2 files changed, 12 deletions(-)
include/hw/boards.h +0 -3
@@ -848,7 +848,4 @@ extern const size_t hw_compat_2_6_len;extern GlobalProperty hw_compat_2_5[];extern const size_t hw_compat_2_5_len; -extern GlobalProperty hw_compat_2_4[]; -extern const size_t hw_compat_2_4_len; -#endif
hw/core/machine.c +0 -9
@@ -292,15 +292,6 @@ GlobalProperty hw_compat_2_5[] = { };const size_t hw_compat_2_5_len =G_N_ELEMENTS (hw_compat_2_5); -GlobalProperty hw_compat_2_4[] = { - {"e1000" ,"extra_mac_registers" ,"off" }, - {"virtio-pci" ,"x-disable-pcie" ,"on" }, - {"virtio-pci" ,"migrate-extra" ,"off" }, - {"fw_cfg_mem" ,"dma_enabled" ,"off" }, - {"fw_cfg_io" ,"dma_enabled" ,"off" } -}; -const size_t hw_compat_2_4_len =G_N_ELEMENTS (hw_compat_2_4); -MachineState *current_machine;static char *machine_get_kernel (Object *obj,Error **errp)
Signature · 1 line
2.47.1
Re: [PATCH v3 05/19] hw/core/machine: Remove hw_compat_2_4[] array
Quoted 8 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:51 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 05/19] hw/core/machine: Remove hw_compat_2_4[] array
X-Mailer: git-send-email 2.47.1The hw_compat_2_4[] array was only used by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed. Remove it.
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- include/hw/boards.h | 3 --- hw/core/machine.c | 9 --------- 2 files changed, 12 deletions(-)
PATCH v3 6/19 hw/net/e1000: Remove unused E1000_FLAG_MAC flag
In reply to Philippe Mathieu-DaudéE1000_FLAG_MAC was only used by the hw_compat_2_4[] array, via the 'extra_mac_registers=off' property. We removed all machines using that array, lets remove all the code around E1000_FLAG_MAC, including the MAC_ACCESS_FLAG_NEEDED enum, similarly to commit fa4ec9ffda7 ("e1000: remove old compatibility code").
--- hw/net/e1000.c | 72 ++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 58 deletions(-)
hw/net/e1000.c +14 -58
@@ -127,10 +127,8 @@ struct E1000State_st {QEMUTimer *flush_queue_timer;/* Compatibility flags for migration to/from qemu 1.3.0 and older */ -#define E1000_FLAG_MAC_BIT 2#define E1000_FLAG_TSO_BIT 3#define E1000_FLAG_VET_BIT 4 -#define E1000_FLAG_MAC (1 << E1000_FLAG_MAC_BIT)#define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT)#define E1000_FLAG_VET (1 << E1000_FLAG_VET_BIT)
@@ -1210,54 +1208,24 @@ static const writeops macreg_writeops[] = {enum {NWRITEOPS =ARRAY_SIZE (macreg_writeops) }; -enum {MAC_ACCESS_PARTIAL =1 ,MAC_ACCESS_FLAG_NEEDED =2 }; +enum {MAC_ACCESS_PARTIAL =1 }; -#define markflag (x) ((E1000_FLAG_##x << 2) | MAC_ACCESS_FLAG_NEEDED)/* In the array below the meaning of the bits is: [f|f|f|f|f|f|n|p] * f - flag bits (up to 6 possible flags) * n - flag needed * p - partially implenented */ static const uint8_t mac_reg_access[0x8000 ] = { - [IPAV ] =markflag (MAC ), [WUC ] =markflag (MAC ), - [IP6AT ] =markflag (MAC ), [IP4AT ] =markflag (MAC ), - [FFVT ] =markflag (MAC ), [WUPM ] =markflag (MAC ), - [ECOL ] =markflag (MAC ), [MCC ] =markflag (MAC ), - [DC ] =markflag (MAC ), [TNCRS ] =markflag (MAC ), - [RLEC ] =markflag (MAC ), [XONRXC ] =markflag (MAC ), - [XOFFTXC ] =markflag (MAC ), [RFC ] =markflag (MAC ), - [TSCTFC ] =markflag (MAC ), [MGTPRC ] =markflag (MAC ), - [WUS ] =markflag (MAC ), [AIT ] =markflag (MAC ), - [FFLT ] =markflag (MAC ), [FFMT ] =markflag (MAC ), - [SCC ] =markflag (MAC ), [FCRUC ] =markflag (MAC ), - [LATECOL ] =markflag (MAC ), [COLC ] =markflag (MAC ), - [SEQEC ] =markflag (MAC ), [CEXTERR ] =markflag (MAC ), - [XONTXC ] =markflag (MAC ), [XOFFRXC ] =markflag (MAC ), - [RJC ] =markflag (MAC ), [RNBC ] =markflag (MAC ), - [MGTPDC ] =markflag (MAC ), [MGTPTC ] =markflag (MAC ), - [RUC ] =markflag (MAC ), [ROC ] =markflag (MAC ), - [GORCL ] =markflag (MAC ), [GORCH ] =markflag (MAC ), - [GOTCL ] =markflag (MAC ), [GOTCH ] =markflag (MAC ), - [BPRC ] =markflag (MAC ), [MPRC ] =markflag (MAC ), - [TSCTC ] =markflag (MAC ), [PRC64 ] =markflag (MAC ), - [PRC127 ] =markflag (MAC ), [PRC255 ] =markflag (MAC ), - [PRC511 ] =markflag (MAC ), [PRC1023 ] =markflag (MAC ), - [PRC1522 ] =markflag (MAC ), [PTC64 ] =markflag (MAC ), - [PTC127 ] =markflag (MAC ), [PTC255 ] =markflag (MAC ), - [PTC511 ] =markflag (MAC ), [PTC1023 ] =markflag (MAC ), - [PTC1522 ] =markflag (MAC ), [MPTC ] =markflag (MAC ), - [BPTC ] =markflag (MAC ), - - [TDFH ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFT ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFHS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFTS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFPC ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFH ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFT ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFHS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFTS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFPC ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [PBM ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , + [TDFH ] =MAC_ACCESS_PARTIAL , + [TDFT ] =MAC_ACCESS_PARTIAL , + [TDFHS ] =MAC_ACCESS_PARTIAL , + [TDFTS ] =MAC_ACCESS_PARTIAL , + [TDFPC ] =MAC_ACCESS_PARTIAL , + [RDFH ] =MAC_ACCESS_PARTIAL , + [RDFT ] =MAC_ACCESS_PARTIAL , + [RDFHS ] =MAC_ACCESS_PARTIAL , + [RDFTS ] =MAC_ACCESS_PARTIAL , + [RDFPC ] =MAC_ACCESS_PARTIAL , + [PBM ] =MAC_ACCESS_PARTIAL , }; static void
@@ -1268,8 +1236,7 @@ e1000_mmio_write(void *opaque, hwaddr addr, uint64_t val,unsigned int index = (addr &0x1ffff ) >>2 ;if (index <NWRITEOPS && macreg_writeops[index]) { -if (!(mac_reg_access[index] &MAC_ACCESS_FLAG_NEEDED ) - || (s->compat_flags & (mac_reg_access[index] >>2 ))) { +if (s->compat_flags & (mac_reg_access[index] >>2 )) {if (mac_reg_access[index] &MAC_ACCESS_PARTIAL ) {DBGOUT (GENERAL ,"Writing to register at offset: 0x%08x. " "It is not fully implemented.\n" , index<<2 );
@@ -1295,8 +1262,7 @@ e1000_mmio_read(void *opaque, hwaddr addr, unsigned size)unsigned int index = (addr &0x1ffff ) >>2 ;if (index <NREADOPS && macreg_readops[index]) { -if (!(mac_reg_access[index] &MAC_ACCESS_FLAG_NEEDED ) - || (s->compat_flags & (mac_reg_access[index] >>2 ))) { +if (s->compat_flags & (mac_reg_access[index] >>2 )) {if (mac_reg_access[index] &MAC_ACCESS_PARTIAL ) {DBGOUT (GENERAL ,"Reading register at offset: 0x%08x. " "It is not fully implemented.\n" , index<<2 );
@@ -1419,13 +1385,6 @@ static int e1000_tx_tso_post_load(void *opaque, int version_id)return 0 ; } -static bool e1000_full_mac_needed (void *opaque) -{ -E1000State *s = opaque; - -return chkflag (MAC ); -} -static bool e1000_tso_state_needed (void *opaque) {E1000State *s = opaque;
@@ -1451,7 +1410,6 @@ static const VMStateDescription vmstate_e1000_full_mac_state = { .name = "e1000/full_mac_state", .version_id = 1, .minimum_version_id = 1, - .needed = e1000_full_mac_needed, .fields = (const VMStateField []) {VMSTATE_UINT32_ARRAY (mac_reg, E1000State,0x8000 ),VMSTATE_END_OF_LIST ()
@@ -1679,8 +1637,6 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)static const Property e1000_properties[] = {DEFINE_NIC_PROPERTIES (E1000State, conf), -DEFINE_PROP_BIT ("extra_mac_registers" , E1000State, - compat_flags,E1000_FLAG_MAC_BIT , true),DEFINE_PROP_BIT ("migrate_tso_props" , E1000State, compat_flags,E1000_FLAG_TSO_BIT , true), DEFINE_PROP_BIT("init-vet", E1000State,
Signature · 1 line
2.47.1
Re: [PATCH v3 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag
Quoted 12 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:52 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 06/19] hw/net/e1000: Remove unusedE1000_FLAG_MACflag
X-Mailer: git-send-email 2.47.1
E1000_FLAG_MACwas only used by the hw_compat_2_4[] array, via the 'extra_mac_registers=off' property. We removed all machines using that array, lets remove all the code aroundE1000_FLAG_MAC, including theMAC_ACCESS_FLAG_NEEDEDenum, similarly to commitfa4ec9ffda7("e1000: remove old compatibility code").
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/net/e1000.c | 72 ++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 58 deletions(-)
Re: [PATCH v3 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag
In reply to Philippe Mathieu-DaudéQuoted 106 lines · Philippe Mathieu-Daudé
E1000_FLAG_MACwas only used by the hw_compat_2_4[] array, via the 'extra_mac_registers=off' property. We removed all machines using that array, lets remove all the code aroundE1000_FLAG_MAC, including theMAC_ACCESS_FLAG_NEEDEDenum, similarly to commitfa4ec9ffda7("e1000: remove old compatibility code").Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/net/e1000.c | 72 ++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 58 deletions(-)hw/net/e1000.c +13
-46@@ -127,10 +127,8 @@ struct E1000State_st {QEMUTimer *flush_queue_timer;/* Compatibility flags for migration to/from qemu 1.3.0 and older */ -#define E1000_FLAG_MAC_BIT 2#define E1000_FLAG_TSO_BIT 3#define E1000_FLAG_VET_BIT 4 -#define E1000_FLAG_MAC (1 << E1000_FLAG_MAC_BIT)#define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT)#define E1000_FLAG_VET (1 << E1000_FLAG_VET_BIT)@@ -1210,54 +1208,24 @@ static const writeops macreg_writeops[] = {enum {NWRITEOPS =ARRAY_SIZE (macreg_writeops) }; -enum {MAC_ACCESS_PARTIAL =1 ,MAC_ACCESS_FLAG_NEEDED =2 }; +enum {MAC_ACCESS_PARTIAL =1 }; -#define markflag (x) ((E1000_FLAG_##x << 2) | MAC_ACCESS_FLAG_NEEDED)/* In the array below the meaning of the bits is: [f|f|f|f|f|f|n|p] * f - flag bits (up to 6 possible flags) * n - flag needed * p - partially implenented */ static const uint8_t mac_reg_access[0x8000 ] = { - [IPAV ] =markflag (MAC ), [WUC ] =markflag (MAC ), - [IP6AT ] =markflag (MAC ), [IP4AT ] =markflag (MAC ), - [FFVT ] =markflag (MAC ), [WUPM ] =markflag (MAC ), - [ECOL ] =markflag (MAC ), [MCC ] =markflag (MAC ), - [DC ] =markflag (MAC ), [TNCRS ] =markflag (MAC ), - [RLEC ] =markflag (MAC ), [XONRXC ] =markflag (MAC ), - [XOFFTXC ] =markflag (MAC ), [RFC ] =markflag (MAC ), - [TSCTFC ] =markflag (MAC ), [MGTPRC ] =markflag (MAC ), - [WUS ] =markflag (MAC ), [AIT ] =markflag (MAC ), - [FFLT ] =markflag (MAC ), [FFMT ] =markflag (MAC ), - [SCC ] =markflag (MAC ), [FCRUC ] =markflag (MAC ), - [LATECOL ] =markflag (MAC ), [COLC ] =markflag (MAC ), - [SEQEC ] =markflag (MAC ), [CEXTERR ] =markflag (MAC ), - [XONTXC ] =markflag (MAC ), [XOFFRXC ] =markflag (MAC ), - [RJC ] =markflag (MAC ), [RNBC ] =markflag (MAC ), - [MGTPDC ] =markflag (MAC ), [MGTPTC ] =markflag (MAC ), - [RUC ] =markflag (MAC ), [ROC ] =markflag (MAC ), - [GORCL ] =markflag (MAC ), [GORCH ] =markflag (MAC ), - [GOTCL ] =markflag (MAC ), [GOTCH ] =markflag (MAC ), - [BPRC ] =markflag (MAC ), [MPRC ] =markflag (MAC ), - [TSCTC ] =markflag (MAC ), [PRC64 ] =markflag (MAC ), - [PRC127 ] =markflag (MAC ), [PRC255 ] =markflag (MAC ), - [PRC511 ] =markflag (MAC ), [PRC1023 ] =markflag (MAC ), - [PRC1522 ] =markflag (MAC ), [PTC64 ] =markflag (MAC ), - [PTC127 ] =markflag (MAC ), [PTC255 ] =markflag (MAC ), - [PTC511 ] =markflag (MAC ), [PTC1023 ] =markflag (MAC ), - [PTC1522 ] =markflag (MAC ), [MPTC ] =markflag (MAC ), - [BPTC ] =markflag (MAC ), - - [TDFH ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFT ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFHS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFTS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [TDFPC ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFH ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFT ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFHS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFTS ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [RDFPC ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , - [PBM ] =markflag (MAC ) |MAC_ACCESS_PARTIAL , + [TDFH ] =MAC_ACCESS_PARTIAL , + [TDFT ] =MAC_ACCESS_PARTIAL , + [TDFHS ] =MAC_ACCESS_PARTIAL , + [TDFTS ] =MAC_ACCESS_PARTIAL , + [TDFPC ] =MAC_ACCESS_PARTIAL , + [RDFH ] =MAC_ACCESS_PARTIAL , + [RDFT ] =MAC_ACCESS_PARTIAL , + [RDFHS ] =MAC_ACCESS_PARTIAL , + [RDFTS ] =MAC_ACCESS_PARTIAL , + [RDFPC ] =MAC_ACCESS_PARTIAL , + [PBM ] =MAC_ACCESS_PARTIAL , }; static void@@ -1268,8 +1236,7 @@ e1000_mmio_write(void *opaque, hwaddr addr, uint64_t val,unsigned int index = (addr &0x1ffff ) >>2 ;if (index <NWRITEOPS && macreg_writeops[index]) { -if (!(mac_reg_access[index] &MAC_ACCESS_FLAG_NEEDED ) - || (s->compat_flags & (mac_reg_access[index] >>2 ))) { +if (s->compat_flags & (mac_reg_access[index] >>2 )) {if (mac_reg_access[index] &MAC_ACCESS_PARTIAL ) {DBGOUT (GENERAL ,"Writing to register at offset: 0x%08x. " "It is not fully implemented.\n" , index<<2 );
hw/net/e1000.c e1000_mmio_read(void *opaque, hwaddr addr, unsigned size) · line 1268
Quoted 9 lines
hw/net/e1000.c +1
-2@@ -1295,8 +1262,7 @@ e1000_mmio_read(void *opaque, hwaddr addr, unsigned size)unsigned int index = (addr &0x1ffff ) >>2 ;if (index <NREADOPS && macreg_readops[index]) { -if (!(mac_reg_access[index] &MAC_ACCESS_FLAG_NEEDED ) - || (s->compat_flags & (mac_reg_access[index] >>2 ))) { +if (s->compat_flags & (mac_reg_access[index] >>2 )) {if (mac_reg_access[index] &MAC_ACCESS_PARTIAL ) {DBGOUT (GENERAL ,"Reading register at offset: 0x%08x. " "It is not fully implemented.\n" , index<<2 );
There still seems to be something wrong in this patch, tests/qtest/pxe-test is failing when this is applied ... could you please have another look?
Thanks,
Thomas
Re: [PATCH v3 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag
Quoted 104 lines · Thomas Huth
Quoted 103 lines · Philippe Mathieu-Daudé
E1000_FLAG_MACwas only used by the hw_compat_2_4[] array, via the 'extra_mac_registers=off' property. We removed all machines using that array, lets remove all the code aroundE1000_FLAG_MAC, including theMAC_ACCESS_FLAG_NEEDEDenum, similarly to commitfa4ec9ffda7("e1000: remove old compatibility code").Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>---
hw/net/e1000.c| 72 ++++++++++----------------------------------------1 file changed, 14 insertions(+), 58 deletions(-)hw/net/e1000.c +12
-44@@ -127,10 +127,8 @@ struct E1000State_st { QEMUTimer *flush_queue_timer; /* Compatibility flags for migration to/from qemu 1.3.0 and older */ -#define E1000_FLAG_MAC_BIT 2 #define E1000_FLAG_TSO_BIT 3 #define E1000_FLAG_VET_BIT 4 -#define E1000_FLAG_MAC (1 << E1000_FLAG_MAC_BIT) #define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT) #define E1000_FLAG_VET (1 << E1000_FLAG_VET_BIT)@@ -1210,54 +1208,24 @@ static const writeops macreg_writeops[] = { enum { NWRITEOPS = ARRAY_SIZE(macreg_writeops) }; -enum {MAC_ACCESS_PARTIAL =1 ,MAC_ACCESS_FLAG_NEEDED =2 }; +enum {MAC_ACCESS_PARTIAL =1 }; -#define markflag (x) ((E1000_FLAG_##x << 2) | MAC_ACCESS_FLAG_NEEDED) /* In the array below the meaning of the bits is: [f|f|f|f|f|f|n|p] * f - flag bits (up to 6 possible flags) * n - flag needed * p - partially implenented */ static const uint8_t mac_reg_access[0x8000] = { - [IPAV] = markflag(MAC), [WUC] = markflag(MAC), - [IP6AT] = markflag(MAC), [IP4AT] = markflag(MAC), - [FFVT] = markflag(MAC), [WUPM] = markflag(MAC), - [ECOL] = markflag(MAC), [MCC] = markflag(MAC), - [DC] = markflag(MAC), [TNCRS] = markflag(MAC), - [RLEC] = markflag(MAC), [XONRXC] = markflag(MAC), - [XOFFTXC] = markflag(MAC), [RFC] = markflag(MAC), - [TSCTFC] = markflag(MAC), [MGTPRC] = markflag(MAC), - [WUS] = markflag(MAC), [AIT] = markflag(MAC), - [FFLT] = markflag(MAC), [FFMT] = markflag(MAC), - [SCC] = markflag(MAC), [FCRUC] = markflag(MAC), - [LATECOL] = markflag(MAC), [COLC] = markflag(MAC), - [SEQEC] = markflag(MAC), [CEXTERR] = markflag(MAC), - [XONTXC] = markflag(MAC), [XOFFRXC] = markflag(MAC), - [RJC] = markflag(MAC), [RNBC] = markflag(MAC), - [MGTPDC] = markflag(MAC), [MGTPTC] = markflag(MAC), - [RUC] = markflag(MAC), [ROC] = markflag(MAC), - [GORCL] = markflag(MAC), [GORCH] = markflag(MAC), - [GOTCL] = markflag(MAC), [GOTCH] = markflag(MAC), - [BPRC] = markflag(MAC), [MPRC] = markflag(MAC), - [TSCTC] = markflag(MAC), [PRC64] = markflag(MAC), - [PRC127] = markflag(MAC), [PRC255] = markflag(MAC), - [PRC511] = markflag(MAC), [PRC1023] = markflag(MAC), - [PRC1522] = markflag(MAC), [PTC64] = markflag(MAC), - [PTC127] = markflag(MAC), [PTC255] = markflag(MAC), - [PTC511] = markflag(MAC), [PTC1023] = markflag(MAC), - [PTC1522] = markflag(MAC), [MPTC] = markflag(MAC), - [BPTC] = markflag(MAC), - - [TDFH] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [TDFT] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [TDFHS] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [TDFTS] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [TDFPC] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [RDFH] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [RDFT] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [RDFHS] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [RDFTS] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [RDFPC] = markflag(MAC) | MAC_ACCESS_PARTIAL, - [PBM] = markflag(MAC) | MAC_ACCESS_PARTIAL, + [TDFH] = MAC_ACCESS_PARTIAL, + [TDFT] = MAC_ACCESS_PARTIAL, + [TDFHS] = MAC_ACCESS_PARTIAL, + [TDFTS] = MAC_ACCESS_PARTIAL, + [TDFPC] = MAC_ACCESS_PARTIAL, + [RDFH] = MAC_ACCESS_PARTIAL, + [RDFT] = MAC_ACCESS_PARTIAL, + [RDFHS] = MAC_ACCESS_PARTIAL, + [RDFTS] = MAC_ACCESS_PARTIAL, + [RDFPC] = MAC_ACCESS_PARTIAL, + [PBM] = MAC_ACCESS_PARTIAL, };static void
hw/net/e1000.c +1
-2@@ -1268,8 +1236,7 @@ e1000_mmio_write(void *opaque, hwaddr addr,uint64_t val, unsigned int index = (addr & 0x1ffff) >> 2; if (index < NWRITEOPS && macreg_writeops[index]) { - if (!(mac_reg_access[index] & MAC_ACCESS_FLAG_NEEDED) - || (s->compat_flags & (mac_reg_access[index] >> 2))) { + if (s->compat_flags & (mac_reg_access[index] >> 2)) { if (mac_reg_access[index] & MAC_ACCESS_PARTIAL) {DBGOUT(GENERAL, "Writing to register at offset: 0x%08x. " "It is not fully implemented.\n", index<<2);
hw/net/e1000.c +0
-0@@ -1295,8 +1262,7 @@ e1000_mmio_read(void *opaque, hwaddr addr, unsigned size) unsigned int index = (addr & 0x1ffff) >> 2; if (index < NREADOPS && macreg_readops[index]) {
Quoted 8 lines
Quoted 6 lines
hw/net/e1000.c +1
-2- if (!(mac_reg_access[index] & MAC_ACCESS_FLAG_NEEDED) - || (s->compat_flags & (mac_reg_access[index] >> 2))) { + if (s->compat_flags & (mac_reg_access[index] >> 2)) { if (mac_reg_access[index] & MAC_ACCESS_PARTIAL) {DBGOUT(GENERAL, "Reading register at offset: 0x%08x. " "It is not fully implemented.\n", index<<2);
There still seems to be something wrong in this patch, tests/qtest/pxe- test is failing when this is applied ... could you please have another look?
Fixed by not removing MAC_ACCESS_FLAG_NEEDED, thanks.
PATCH v3 7/19 hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition
In reply to Philippe Mathieu-DaudéVIRTIO_PCI_FLAG_MIGRATE_EXTRA was only used by the hw_compat_2_4[] array, via the 'migrate-extra=true' property. We removed all machines using that array, lets remove all the code around VIRTIO_PCI_FLAG_MIGRATE_EXTRA.
--- include/hw/virtio/virtio-pci.h | 4 ---- hw/virtio/virtio-pci.c | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-)
include/hw/virtio/virtio-pci.h +0 -4
@@ -32,7 +32,6 @@ DECLARE_OBJ_CHECKERS(VirtioPCIBusState, VirtioPCIBusClass,enum {VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT ,VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT , -VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT ,VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT ,VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT ,VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT ,
@@ -57,9 +56,6 @@ enum {/* virtio version flags */ #define VIRTIO_PCI_FLAG_DISABLE_PCIE (1 << VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT) -/* migrate extra state */ -#define VIRTIO_PCI_FLAG_MIGRATE_EXTRA (1 << VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT) -/* have pio notification for modern device ? */ #define VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY \ (1 << VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT)
hw/virtio/virtio-pci.c +1 -5
@@ -146,9 +146,7 @@ static const VMStateDescription vmstate_virtio_pci = {static bool virtio_pci_has_extra_state (DeviceState *d) { -VirtIOPCIProxy *proxy =to_virtio_pci_proxy (d); - -return proxy->flags &VIRTIO_PCI_FLAG_MIGRATE_EXTRA ; +return true; }static void virtio_pci_save_extra_state (DeviceState *d,QEMUFile *f)
@@ -2349,8 +2347,6 @@ static void virtio_pci_bus_reset_hold(Object *obj, ResetType type)static const Property virtio_pci_properties[] = {DEFINE_PROP_BIT ("virtio-pci-bus-master-bug-migration" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT , false), -DEFINE_PROP_BIT ("migrate-extra" , VirtIOPCIProxy, flags, -VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT , true),DEFINE_PROP_BIT ("modern-pio-notify" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT , false), DEFINE_PROP_BIT("x-disable-pcie", VirtIOPCIProxy, flags,
Signature · 1 line
2.47.1
Re: [PATCH v3 07/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition
Quoted 11 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:53 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 07/19] hw/virtio/virtio-pci: Remove
VIRTIO_PCI_FLAG_MIGRATE_EXTRAdefinition
X-Mailer: git-send-email 2.47.1
VIRTIO_PCI_FLAG_MIGRATE_EXTRAwas only used by the hw_compat_2_4[] array, via the 'migrate-extra=true' property. We removed all machines using that array, lets remove all the code aroundVIRTIO_PCI_FLAG_MIGRATE_EXTRA.
Quoted 7 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- include/hw/virtio/virtio-pci.h | 4 ---- hw/virtio/virtio-pci.c | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-)
PATCH v3 8/19 hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition
In reply to Philippe Mathieu-DaudéVIRTIO_PCI_FLAG_DISABLE_PCIE was only used by the hw_compat_2_4[] array, via the 'x-disable-pcie=false' property. We removed all machines using that array, lets remove all the code around VIRTIO_PCI_FLAG_DISABLE_PCIE (see commit 9a4c0e220d8 for similar VIRTIO_PCI_FLAG_* enum removal).
--- include/hw/virtio/virtio-pci.h | 4 ---- hw/virtio/virtio-pci.c | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-)
include/hw/virtio/virtio-pci.h +0 -4
@@ -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_DISABLE_PCIE_BIT ,VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT ,VIRTIO_PCI_FLAG_ATS_BIT , VIRTIO_PCI_FLAG_INIT_DEVERR_BIT,
@@ -53,9 +52,6 @@ enum {* vcpu thread using ioeventfd for some devices. */ #define VIRTIO_PCI_FLAG_USE_IOEVENTFD (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT) -/* virtio version flags */ -#define VIRTIO_PCI_FLAG_DISABLE_PCIE (1 << VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT) -/* have pio notification for modern device ? */ #define VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY \ (1 << VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT)
hw/virtio/virtio-pci.c +1 -4
@@ -2349,8 +2349,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 ("x-disable-pcie" , VirtIOPCIProxy, flags, -VIRTIO_PCI_FLAG_DISABLE_PCIE_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,
@@ -2379,8 +2377,7 @@ static void virtio_pci_dc_realize(DeviceState *qdev, Error **errp)VirtIOPCIProxy *proxy =VIRTIO_PCI (qdev);PCIDevice *pci_dev = &proxy->pci_dev; -if (!(proxy->flags &VIRTIO_PCI_FLAG_DISABLE_PCIE ) && -virtio_pci_modern (proxy)) { +if (virtio_pci_modern (proxy)) { pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; }
Signature · 1 line
2.47.1
Re: [PATCH v3 08/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition
Quoted 12 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:54 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 08/19] hw/virtio/virtio-pci: Remove
VIRTIO_PCI_FLAG_DISABLE_PCIEdefinition
X-Mailer: git-send-email 2.47.1
VIRTIO_PCI_FLAG_DISABLE_PCIEwas only used by the hw_compat_2_4[] array, via the 'x-disable-pcie=false' property. We removed all machines using that array, lets remove all the code aroundVIRTIO_PCI_FLAG_DISABLE_PCIE(see commit9a4c0e220d8for similar VIRTIO_PCI_FLAG_* enum removal).
Quoted 7 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- include/hw/virtio/virtio-pci.h | 4 ---- hw/virtio/virtio-pci.c | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-)
PATCH v3 9/19 hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines
In reply to Philippe Mathieu-DaudéThese machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.
Remove the now unused empty pc_compat_2_5[] array.
--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 3 --- hw/i386/pc_piix.c | 13 ------------- hw/i386/pc_q35.c | 13 ------------- 4 files changed, 32 deletions(-)
include/hw/i386/pc.h +0 -3
@@ -298,9 +298,6 @@ extern const size_t pc_compat_2_7_len;extern GlobalProperty pc_compat_2_6[];extern const size_t pc_compat_2_6_len; -extern GlobalProperty pc_compat_2_5[]; -extern const size_t pc_compat_2_5_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \
hw/i386/pc.c +0 -3
@@ -259,9 +259,6 @@ GlobalProperty pc_compat_2_6[] = { };const size_t pc_compat_2_6_len =G_N_ELEMENTS (pc_compat_2_6); -GlobalProperty pc_compat_2_5[] = {}; -const size_t pc_compat_2_5_len =G_N_ELEMENTS (pc_compat_2_5); -/* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
hw/i386/pc_piix.c +0 -13
@@ -778,19 +778,6 @@ static void pc_i440fx_machine_2_6_options(MachineClass *m)DEFINE_I440FX_MACHINE (2 ,6 ); -static void pc_i440fx_machine_2_5_options (MachineClass *m) -{ -X86MachineClass *x86mc =X86_MACHINE_CLASS (m); - -pc_i440fx_machine_2_6_options (m); - x86mc->save_tsc_khz = false; - m->legacy_fw_cfg_order =1 ; -compat_props_add (m->compat_props, hw_compat_2_5, hw_compat_2_5_len); -compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); -} - -DEFINE_I440FX_MACHINE (2 ,5 ); -#ifdef CONFIG_ISAPC static void isapc_machine_options (MachineClass *m) {
hw/i386/pc_q35.c +0 -13
@@ -672,16 +672,3 @@ static void pc_q35_machine_2_6_options(MachineClass *m) }DEFINE_Q35_MACHINE (2 ,6 ); - -static void pc_q35_machine_2_5_options (MachineClass *m) -{ -X86MachineClass *x86mc =X86_MACHINE_CLASS (m); - -pc_q35_machine_2_6_options (m); - x86mc->save_tsc_khz = false; - m->legacy_fw_cfg_order =1 ; -compat_props_add (m->compat_props, hw_compat_2_5, hw_compat_2_5_len); -compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); -} - -DEFINE_Q35_MACHINE (2 ,5 );
Signature · 1 line
2.47.1
Re: [PATCH v3 09/19] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines
Quoted 13 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:55 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 09/19] hw/i386/pc: Remove deprecated pc-q35-2.5 and
pc-i440fx-2.5 machines
X-Mailer: git-send-email 2.47.1These 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 now unused empty pc_compat_2_5[] array.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 3 --- hw/i386/pc_piix.c | 13 ------------- hw/i386/pc_q35.c | 13 ------------- 4 files changed, 32 deletions(-)
PATCH v3 10/19 hw/i386/x86: Remove X86MachineClass::save_tsc_khz field
In reply to Philippe Mathieu-DaudéThe X86MachineClass::save_tsc_khz boolean was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it and simplify tsc_khz_needed().
--- include/hw/i386/x86.h | 5 ----- hw/i386/x86.c | 1 - target/i386/machine.c | 5 ++--- 3 files changed, 2 insertions(+), 9 deletions(-)
include/hw/i386/x86.h +0 -5
@@ -27,13 +27,8 @@#include "qom/object.h" struct X86MachineClass { -/*< private >*/ MachineClass parent; -/*< public >*/ - -/* TSC rate migration: */ -bool save_tsc_khz;/* use DMA capable linuxboot option rom */ bool fwcfg_dma_enabled;/* CPU and apic information: */
hw/i386/x86.c +0 -1
@@ -382,7 +382,6 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data) 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->save_tsc_khz = true; x86mc->fwcfg_dma_enabled = true; nc->nmi_monitor_handler = x86_nmi;
target/i386/machine.c +2 -3
@@ -1060,9 +1060,8 @@ static bool tsc_khz_needed(void *opaque) {X86CPU *cpu = opaque;CPUX86State *env = &cpu->env; -MachineClass *mc =MACHINE_GET_CLASS (qdev_get_machine ()); -X86MachineClass *x86mc =X86_MACHINE_CLASS (mc); -return env->tsc_khz && x86mc->save_tsc_khz; + +return env->tsc_khz; }static const VMStateDescription vmstate_tsc_khz = {
Signature · 1 line
2.47.1
Re: [PATCH v3 10/19] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:56 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 10/19] hw/i386/x86: RemoveX86MachineClass::save_tsc_khz
field
X-Mailer: git-send-email 2.47.1The
X86MachineClass::save_tsc_khzboolean was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it and simplifytsc_khz_needed().
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- include/hw/i386/x86.h | 5 ----- hw/i386/x86.c | 1 - target/i386/machine.c | 5 ++--- 3 files changed, 2 insertions(+), 9 deletions(-)
PATCH v3 11/19 hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE
In reply to Philippe Mathieu-DaudéThe MachineClass::legacy_fw_cfg_order boolean was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it along with:
- FW_CFG_ORDER_OVERRIDE_* definitions
- fw_cfg_set_order_override()
- fw_cfg_reset_order_override()
- fw_cfg_order[]
- rom_set_order_override()
- rom_reset_order_override()
Simplify CLI and pc_vga_init() / pc_nic_init().
--- include/hw/boards.h | 3 +- include/hw/loader.h | 2 - include/hw/nvram/fw_cfg.h | 10 ---- hw/core/loader.c | 14 ----- hw/i386/pc.c | 7 +-- hw/nvram/fw_cfg.c | 109 +++----------------------------------- system/vl.c | 5 -- 7 files changed, 9 insertions(+), 141 deletions(-)
include/hw/boards.h +1 -2
@@ -286,8 +286,7 @@ struct MachineClass { no_parallel:1, no_floppy:1, no_cdrom:1, - pci_allow_0_address:1, - legacy_fw_cfg_order:1; + pci_allow_0_address:1;bool auto_create_sdcard;bool is_default;const char *default_machine_opts;
include/hw/loader.h +0 -2
@@ -270,8 +270,6 @@ int rom_add_elf_program(const char *name, GMappedFile *mapped_file, void *data, AddressSpace *as);int rom_check_and_register_reset (void );void rom_set_fw (FWCfgState *f); -void rom_set_order_override (int order); -void rom_reset_order_override (void );/** * rom_transaction_begin:
include/hw/nvram/fw_cfg.h +0 -10
@@ -42,14 +42,6 @@ struct FWCfgDataGeneratorClass {typedef struct fw_cfg_file FWCfgFile ; -#define FW_CFG_ORDER_OVERRIDE_VGA 70 -#define FW_CFG_ORDER_OVERRIDE_NIC 80 -#define FW_CFG_ORDER_OVERRIDE_USER 100 -#define FW_CFG_ORDER_OVERRIDE_DEVICE 110 - -void fw_cfg_set_order_override (FWCfgState *fw_cfg,int order); -void fw_cfg_reset_order_override (FWCfgState *fw_cfg); - typedef struct FWCfgFiles { uint32_t count; FWCfgFile f[];
@@ -75,8 +67,6 @@ struct FWCfgState {uint32_t cur_offset;Notifier machine_ready; -int fw_cfg_order_override; -bool dma_enabled;dma_addr_t dma_addr;AddressSpace *dma_as;
hw/core/loader.c +0 -14
@@ -1333,20 +1333,6 @@ void rom_set_fw(FWCfgState *f) fw_cfg = f; } -void rom_set_order_override (int order) -{ -if (!fw_cfg) -return ; -fw_cfg_set_order_override (fw_cfg, order); -} - -void rom_reset_order_override (void ) -{ -if (!fw_cfg) -return ; -fw_cfg_reset_order_override (fw_cfg); -} -void rom_transaction_begin (void ) {Rom *rom;
hw/i386/pc.c +1 -6
@@ -1033,7 +1033,6 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) {DeviceState *dev =NULL ; -rom_set_order_override (FW_CFG_ORDER_OVERRIDE_VGA );if (pci_bus) {PCIDevice *pcidev =pci_vga_init (pci_bus); dev = pcidev ? &pcidev->qdev :NULL ;
@@ -1041,7 +1040,7 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)ISADevice *isadev =isa_vga_init (isa_bus); dev = isadev ?DEVICE (isadev) :NULL ; } -rom_reset_order_override (); +return dev; }
@@ -1231,8 +1230,6 @@ void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)bool default_is_ne2k =g_str_equal (mc->default_nic,TYPE_ISA_NE2000 );NICInfo *nd; -rom_set_order_override (FW_CFG_ORDER_OVERRIDE_NIC ); -while ((nd =qemu_find_nic_info (TYPE_ISA_NE2000 , default_is_ne2k,NULL ))) {pc_init_ne2k_isa (isa_bus, nd, &error_fatal); }
@@ -1241,8 +1238,6 @@ void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)if (pci_bus) {pci_init_nic_devices (pci_bus, mc->default_nic); } - -rom_reset_order_override (); }void pc_i8259_create (ISABus *isa_bus,qemu_irq *i8259_irqs)
hw/nvram/fw_cfg.c +7 -102
145 lines not on this page · raw message
system/vl.c +0 -5
@@ -1191,10 +1191,7 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)return -1 ; } } -/* For legacy, keep user files in a specific global order. */ -fw_cfg_set_order_override (fw_cfg,FW_CFG_ORDER_OVERRIDE_USER );fw_cfg_add_file (fw_cfg, name, buf, size); -fw_cfg_reset_order_override (fw_cfg);return 0 ; }
@@ -2744,7 +2741,6 @@ static void qemu_create_cli_devices(void) }/* init generic devices */ -rom_set_order_override (FW_CFG_ORDER_OVERRIDE_DEVICE );qemu_opts_foreach (qemu_find_opts ("device" ), device_init_func,NULL , &error_fatal); QTAILQ_FOREACH(opt, &device_opts, next) {
@@ -2755,7 +2751,6 @@ static void qemu_create_cli_devices(void)assert (ret_data ==NULL );/* error_fatal aborts */ loc_pop (&opt->loc); } -rom_reset_order_override (); }static bool qemu_machine_creation_done (Error **errp)
Signature · 1 line
2.47.1
Re: [PATCH v3 11/19] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE
Quoted 21 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:57 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 11/19] hw/nvram/fw_cfg: Remove legacy
FW_CFG_ORDER_OVERRIDE
X-Mailer: git-send-email 2.47.1The
MachineClass::legacy_fw_cfg_orderboolean was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it along with:- FW_CFG_ORDER_OVERRIDE_* definitions
-fw_cfg_set_order_override()
-fw_cfg_reset_order_override()
- fw_cfg_order[]
-rom_set_order_override()
-rom_reset_order_override()Simplify CLI and
pc_vga_init()/pc_nic_init().Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>
Quoted 9 lines
--- include/hw/boards.h | 3 +- include/hw/loader.h | 2 - include/hw/nvram/fw_cfg.h | 10 ---- hw/core/loader.c | 14 ----- hw/i386/pc.c | 7 +-- hw/nvram/fw_cfg.c | 109 +++----------------------------------- system/vl.c | 5 -- 7 files changed, 9 insertions(+), 141 deletions(-)
PATCH v3 12/19 hw/core/machine: Remove hw_compat_2_5[] array
In reply to Philippe Mathieu-DaudéThe hw_compat_2_5[] array was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it.
--- include/hw/boards.h | 3 --- hw/core/machine.c | 9 --------- 2 files changed, 12 deletions(-)
include/hw/boards.h +0 -3
@@ -844,7 +844,4 @@ extern const size_t hw_compat_2_7_len;extern GlobalProperty hw_compat_2_6[];extern const size_t hw_compat_2_6_len; -extern GlobalProperty hw_compat_2_5[]; -extern const size_t hw_compat_2_5_len; -#endif
hw/core/machine.c +0 -9
@@ -283,15 +283,6 @@ GlobalProperty hw_compat_2_6[] = { };const size_t hw_compat_2_6_len =G_N_ELEMENTS (hw_compat_2_6); -GlobalProperty hw_compat_2_5[] = { - {"isa-fdc" ,"fallback" ,"144" }, - {"pvscsi" ,"x-old-pci-configuration" ,"on" }, - {"pvscsi" ,"x-disable-pcie" ,"on" }, - {"vmxnet3" ,"x-old-msi-offsets" ,"on" }, - {"vmxnet3" ,"x-disable-pcie" ,"on" }, -}; -const size_t hw_compat_2_5_len =G_N_ELEMENTS (hw_compat_2_5); -MachineState *current_machine;static char *machine_get_kernel (Object *obj,Error **errp)
Signature · 1 line
2.47.1
Re: [PATCH v3 12/19] hw/core/machine: Remove hw_compat_2_5[] array
Quoted 8 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:58 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 12/19] hw/core/machine: Remove hw_compat_2_5[] array
X-Mailer: git-send-email 2.47.1The hw_compat_2_5[] array was only used by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got removed. Remove it.
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- include/hw/boards.h | 3 --- hw/core/machine.c | 9 --------- 2 files changed, 12 deletions(-)
PATCH v3 13/19 hw/block/fdc-isa: Remove 'fallback' property
In reply to Philippe Mathieu-DaudéThe "fallback" property was only used by the hw_compat_2_5[] array, as 'fallback=144'. We removed all machines using that array, lets remove ISA floppy drive 'fallback' property, manually setting the default value in isabus_fdc_realize().
--- hw/block/fdc-isa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/block/fdc-isa.c +1 -3
@@ -112,6 +112,7 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) }qdev_set_legacy_instance_id (dev, isa->iobase,2 ); +qdev_prop_set_enum (dev,"fallback" ,FLOPPY_DRIVE_TYPE_288 );fdctrl_realize_common (dev, fdctrl, &err);if (err !=NULL ) {
@@ -293,9 +294,6 @@ static const Property isa_fdc_properties[] = {DEFINE_PROP_SIGNED ("fdtypeB" , FDCtrlISABus, state.qdev_for_drives[1 ].type,FLOPPY_DRIVE_TYPE_AUTO , qdev_prop_fdc_drive_type, FloppyDriveType), -DEFINE_PROP_SIGNED ("fallback" , FDCtrlISABus, state.fallback, -FLOPPY_DRIVE_TYPE_288 , qdev_prop_fdc_drive_type, - FloppyDriveType), };static void isabus_fdc_class_init (ObjectClass *klass,const void *data)
Signature · 1 line
2.47.1
Re: [PATCH v3 13/19] hw/block/fdc-isa: Remove 'fallback' property
Quoted 10 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:38:59 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 13/19] hw/block/fdc-isa: Remove 'fallback' property
X-Mailer: git-send-email 2.47.1The "fallback" property was only used by the hw_compat_2_5[] array, as 'fallback=144'. We removed all machines using that array, lets remove ISA floppy drive 'fallback' property, manually setting the default value in
isabus_fdc_realize().
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/block/fdc-isa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
PATCH v3 14/19 hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition
In reply to Philippe Mathieu-DaudéPVSCSI_COMPAT_OLD_PCI_CONFIGURATION was only used by the hw_compat_2_5[] array, via the 'x-old-pci-configuration=on' property. We removed all machines using that array, lets remove all the code around PVSCSI_COMPAT_OLD_PCI_CONFIGURATION.
--- hw/scsi/vmw_pvscsi.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-)
hw/scsi/vmw_pvscsi.c +7 -19
@@ -69,17 +69,11 @@ OBJECT_DECLARE_TYPE(PVSCSIState, PVSCSIClass, PVSCSI)/* Compatibility flags for migration */ -#define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT 0 -#define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION \ - (1 << PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT)#define PVSCSI_COMPAT_DISABLE_PCIE_BIT 1#define PVSCSI_COMPAT_DISABLE_PCIE \ (1 << PVSCSI_COMPAT_DISABLE_PCIE_BIT) -#define PVSCSI_USE_OLD_PCI_CONFIGURATION (s) \ - ((s)->compat_flags & PVSCSI_COMPAT_OLD_PCI_CONFIGURATION) -#define PVSCSI_MSI_OFFSET (s) \ - (PVSCSI_USE_OLD_PCI_CONFIGURATION(s) ? 0x50 : 0x7c) +#define PVSCSI_MSI_OFFSET (0x7c)#define PVSCSI_EXP_EP_OFFSET (0x40) typedef struct PVSCSIRingInfo {
@@ -1110,7 +1104,7 @@ pvscsi_init_msi(PVSCSIState *s)int res;PCIDevice *d =PCI_DEVICE (s); - res =msi_init (d,PVSCSI_MSI_OFFSET (s),PVSCSI_MSIX_NUM_VECTORS , + res =msi_init (d,PVSCSI_MSI_OFFSET ,PVSCSI_MSIX_NUM_VECTORS ,PVSCSI_USE_64BIT ,PVSCSI_PER_VECTOR_MASK ,NULL );if (res <0 ) {trace_pvscsi_init_msi_fail (res);
@@ -1158,15 +1152,11 @@ pvscsi_realizefn(PCIDevice *pci_dev, Error **errp)trace_pvscsi_state ("init" );/* PCI subsystem ID, subsystem vendor ID, revision */ -if (PVSCSI_USE_OLD_PCI_CONFIGURATION (s)) { -pci_set_word (pci_dev->config +PCI_SUBSYSTEM_ID ,0x1000 ); - }else { -pci_set_word (pci_dev->config +PCI_SUBSYSTEM_VENDOR_ID , -PCI_VENDOR_ID_VMWARE ); -pci_set_word (pci_dev->config +PCI_SUBSYSTEM_ID , -PCI_DEVICE_ID_VMWARE_PVSCSI ); -pci_config_set_revision (pci_dev->config,0x2 ); - } +pci_set_word (pci_dev->config +PCI_SUBSYSTEM_VENDOR_ID , +PCI_VENDOR_ID_VMWARE ); +pci_set_word (pci_dev->config +PCI_SUBSYSTEM_ID , +PCI_DEVICE_ID_VMWARE_PVSCSI ); +pci_config_set_revision (pci_dev->config,0x2 );/* PCI latency timer = 255 */ pci_dev->config[PCI_LATENCY_TIMER ] =0xff ;
@@ -1298,8 +1288,6 @@ static const VMStateDescription vmstate_pvscsi = {static const Property pvscsi_properties[] = {DEFINE_PROP_UINT8 ("use_msg" , PVSCSIState, use_msg,1 ), -DEFINE_PROP_BIT ("x-old-pci-configuration" , PVSCSIState, compat_flags, -PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT , false),DEFINE_PROP_BIT ("x-disable-pcie" , PVSCSIState, compat_flags,PVSCSI_COMPAT_DISABLE_PCIE_BIT , false), };
Signature · 1 line
2.47.1
Re: [PATCH v3 14/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition
Quoted 11 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:00 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 14/19] hw/scsi/vmw_pvscsi: Remove
PVSCSI_COMPAT_OLD_PCI_CONFIGURATIONdefinition
X-Mailer: git-send-email 2.47.1
PVSCSI_COMPAT_OLD_PCI_CONFIGURATIONwas only used by the hw_compat_2_5[] array, via the 'x-old-pci-configuration=on' property. We removed all machines using that array, lets remove all the code aroundPVSCSI_COMPAT_OLD_PCI_CONFIGURATION.
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- hw/scsi/vmw_pvscsi.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-)
PATCH v3 15/19 hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition
In reply to Philippe Mathieu-DaudéPVSCSI_COMPAT_DISABLE_PCIE_BIT was only used by the hw_compat_2_5[] array, via the 'x-disable-pcie=on' property. We removed all machines using that array, lets remove all the code around PVSCSI_COMPAT_DISABLE_PCIE_BIT, including the now unused PVSCSIState::compat_flags field.
--- hw/scsi/vmw_pvscsi.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-)
hw/scsi/vmw_pvscsi.c +1 -29
@@ -68,11 +68,6 @@ struct PVSCSIClass { OBJECT_DECLARE_TYPE(PVSCSIState, PVSCSIClass, PVSCSI) -/* Compatibility flags for migration */ -#define PVSCSI_COMPAT_DISABLE_PCIE_BIT 1 -#define PVSCSI_COMPAT_DISABLE_PCIE \ - (1 << PVSCSI_COMPAT_DISABLE_PCIE_BIT) -#define PVSCSI_MSI_OFFSET (0x7c)#define PVSCSI_EXP_EP_OFFSET (0x40)
@@ -123,8 +118,6 @@ struct PVSCSIState {uint8_t msi_used;/* For migration compatibility */ PVSCSIRingInfo rings;/* Data transfer rings manager */ uint32_t resetting;/* Reset in progress */ - -uint32_t compat_flags; }; typedef struct PVSCSIRequest {
@@ -1224,21 +1217,8 @@ pvscsi_post_load(void *opaque, int version_id)return 0 ; } -static bool pvscsi_vmstate_need_pcie_device (void *opaque) -{ -PVSCSIState *s =PVSCSI (opaque); - -return !(s->compat_flags &PVSCSI_COMPAT_DISABLE_PCIE ); -} - -static bool pvscsi_vmstate_test_pci_device (void *opaque,int version_id) -{ -return !pvscsi_vmstate_need_pcie_device (opaque); -} -static const VMStateDescription vmstate_pvscsi_pcie_device = { .name ="pvscsi/pcie" , - .needed = pvscsi_vmstate_need_pcie_device, .fields = (const VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PVSCSIState),VMSTATE_END_OF_LIST ()
@@ -1252,9 +1232,6 @@ static const VMStateDescription vmstate_pvscsi = { .pre_save = pvscsi_pre_save, .post_load = pvscsi_post_load, .fields = (const VMStateField []) { -VMSTATE_STRUCT_TEST (parent_obj, PVSCSIState, - pvscsi_vmstate_test_pci_device,0 , - vmstate_pci_device, PCIDevice),VMSTATE_UINT8 (msi_used, PVSCSIState),VMSTATE_UINT32 (resetting, PVSCSIState),VMSTATE_UINT64 (reg_interrupt_status, PVSCSIState),
@@ -1288,19 +1265,14 @@ static const VMStateDescription vmstate_pvscsi = {static const Property pvscsi_properties[] = {DEFINE_PROP_UINT8 ("use_msg" , PVSCSIState, use_msg,1 ), -DEFINE_PROP_BIT ("x-disable-pcie" , PVSCSIState, compat_flags, -PVSCSI_COMPAT_DISABLE_PCIE_BIT , false), };static void pvscsi_realize (DeviceState *qdev,Error **errp) {PVSCSIClass *pvs_c =PVSCSI_GET_CLASS (qdev);PCIDevice *pci_dev =PCI_DEVICE (qdev); -PVSCSIState *s =PVSCSI (qdev); -if (!(s->compat_flags &PVSCSI_COMPAT_DISABLE_PCIE )) { - pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; - } + pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; pvs_c->parent_dc_realize (qdev, errp); }
Signature · 1 line
2.47.1
Re: [PATCH v3 15/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition
Quoted 12 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:01 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 15/19] hw/scsi/vmw_pvscsi: Remove
PVSCSI_COMPAT_DISABLE_PCIE_BITdefinition
X-Mailer: git-send-email 2.47.1
PVSCSI_COMPAT_DISABLE_PCIE_BITwas only used by the hw_compat_2_5[] array, via the 'x-disable-pcie=on' property. We removed all machines using that array, lets remove all the code aroundPVSCSI_COMPAT_DISABLE_PCIE_BIT, including the now unusedPVSCSIState::compat_flagsfield.
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- hw/scsi/vmw_pvscsi.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-)
PATCH v3 16/19 hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit
In reply to Philippe Mathieu-DaudéSimplify replacing pvscsi_realize() by pvscsi_instance_init(), removing the need for device_class_set_parent_realize().
--- hw/scsi/vmw_pvscsi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
hw/scsi/vmw_pvscsi.c +3 -10
@@ -1267,21 +1267,15 @@ static const Property pvscsi_properties[] = { DEFINE_PROP_UINT8("use_msg", PVSCSIState, use_msg, 1), }; -static void pvscsi_realize (DeviceState *qdev,Error **errp) +static void pvscsi_instance_init (Object *obj) { -PVSCSIClass *pvs_c =PVSCSI_GET_CLASS (qdev); -PCIDevice *pci_dev =PCI_DEVICE (qdev); - - pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; - - pvs_c->parent_dc_realize (qdev, errp); +PCI_DEVICE (obj)->cap_present |=QEMU_PCI_CAP_EXPRESS ; }static void pvscsi_class_init (ObjectClass *klass,const void *data) {DeviceClass *dc =DEVICE_CLASS (klass);PCIDeviceClass *k =PCI_DEVICE_CLASS (klass); -PVSCSIClass *pvs_k =PVSCSI_CLASS (klass);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (klass); k->realize = pvscsi_realizefn;
@@ -1290,8 +1284,6 @@ static void pvscsi_class_init(ObjectClass *klass, const void *data) k->device_id =PCI_DEVICE_ID_VMWARE_PVSCSI ; k->class_id =PCI_CLASS_STORAGE_SCSI ; k->subsystem_id =0x1000 ; -device_class_set_parent_realize (dc, pvscsi_realize, - &pvs_k->parent_dc_realize);device_class_set_legacy_reset (dc, pvscsi_reset); dc->vmsd = &vmstate_pvscsi;device_class_set_props (dc, pvscsi_properties);
@@ -1306,6 +1298,7 @@ static const TypeInfo pvscsi_info = { .class_size = sizeof(PVSCSIClass), .instance_size = sizeof(PVSCSIState), .class_init = pvscsi_class_init, + .instance_init = pvscsi_instance_init, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, {INTERFACE_PCIE_DEVICE },
Signature · 1 line
2.47.1
Re: [PATCH v3 16/19] hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:02 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 16/19] hw/scsi/vmw_pvscsi: Convert DeviceRealize ->
InstanceInit
X-Mailer: git-send-email 2.47.1
Quoted 8 lines
Simplify replacing
pvscsi_realize()bypvscsi_instance_init(), removing the need fordevice_class_set_parent_realize().Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/scsi/vmw_pvscsi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
PATCH v3 17/19 hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition
In reply to Philippe Mathieu-DaudéVMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS was only used by the hw_compat_2_5[] array, via the 'x-old-msi-offsets=on' property. We removed all machines using that array, lets remove all the code around VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS.
--- hw/net/vmxnet3.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
hw/net/vmxnet3.c +6 -14
@@ -42,18 +42,13 @@#define VMXNET3_MSIX_BAR_SIZE 0x2000/* Compatibility flags for migration */ -#define VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT 0 -#define VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS \ - (1 << VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT)#define VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT 1#define VMXNET3_COMPAT_FLAG_DISABLE_PCIE \ (1 << VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT)#define VMXNET3_EXP_EP_OFFSET (0x48) -#define VMXNET3_MSI_OFFSET (s) \ - ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0x50 : 0x84) -#define VMXNET3_MSIX_OFFSET (s) \ - ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0 : 0x9c) +#define VMXNET3_MSI_OFFSET (0x84) +#define VMXNET3_MSIX_OFFSET (0x9c)#define VMXNET3_DSN_OFFSET (0x100)#define VMXNET3_BAR0_IDX (0)
@@ -61,8 +56,7 @@#define VMXNET3_MSIX_BAR_IDX (2)#define VMXNET3_OFF_MSIX_TABLE (0x000) -#define VMXNET3_OFF_MSIX_PBA (s) \ - ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0x800 : 0x1000) +#define VMXNET3_OFF_MSIX_PBA (0x1000)/* Link speed in Mbps should be shifted by 16 */ #define VMXNET3_LINK_SPEED (1000 << 16)
@@ -2122,8 +2116,8 @@ vmxnet3_init_msix(VMXNET3State *s) &s->msix_bar,VMXNET3_MSIX_BAR_IDX ,VMXNET3_OFF_MSIX_TABLE , &s->msix_bar, -VMXNET3_MSIX_BAR_IDX ,VMXNET3_OFF_MSIX_PBA (s), - VMXNET3_MSIX_OFFSET(s), NULL); +VMXNET3_MSIX_BAR_IDX ,VMXNET3_OFF_MSIX_PBA , + VMXNET3_MSIX_OFFSET, NULL);if (0 > res) {VMW_WRPRN ("Failed to initialize MSI-X, error %d" , res);
@@ -2221,7 +2215,7 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp)/* Interrupt pin A */ pci_dev->config[PCI_INTERRUPT_PIN ] =0x01 ; - ret =msi_init (pci_dev,VMXNET3_MSI_OFFSET (s),VMXNET3_MAX_NMSIX_INTRS , + ret =msi_init (pci_dev,VMXNET3_MSI_OFFSET ,VMXNET3_MAX_NMSIX_INTRS ,VMXNET3_USE_64BIT ,VMXNET3_PER_VECTOR_MASK ,NULL );/* Any error other than -ENOTSUP(board's MSI support is broken) * is a programming error. Fall back to INTx silently on -ENOTSUP */
@@ -2472,8 +2466,6 @@ static const VMStateDescription vmstate_vmxnet3 = {static const Property vmxnet3_properties[] = {DEFINE_NIC_PROPERTIES (VMXNET3State, conf), -DEFINE_PROP_BIT ("x-old-msi-offsets" , VMXNET3State, compat_flags, -VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT , false),DEFINE_PROP_BIT ("x-disable-pcie" , VMXNET3State, compat_flags,VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT , false), };
Signature · 1 line
2.47.1
Re: [PATCH v3 17/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition
Quoted 11 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:03 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 17/19] hw/net/vmxnet3: Remove
VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETSdefinition
X-Mailer: git-send-email 2.47.1
VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETSwas only used by the hw_compat_2_5[] array, via the 'x-old-msi-offsets=on' property. We removed all machines using that array, lets remove all the code aroundVMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS.
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/net/vmxnet3.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
PATCH v3 18/19 hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition
In reply to Philippe Mathieu-DaudéVMXNET3_COMPAT_FLAG_DISABLE_PCIE was only used by the hw_compat_2_5[] array, via the 'x-disable-pcie=on' property. We removed all machines using that array, lets remove all the code around VMXNET3_COMPAT_FLAG_DISABLE_PCIE.
--- hw/net/vmxnet3.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
hw/net/vmxnet3.c +1 -10
@@ -41,11 +41,6 @@#define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1#define VMXNET3_MSIX_BAR_SIZE 0x2000 -/* Compatibility flags for migration */ -#define VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT 1 -#define VMXNET3_COMPAT_FLAG_DISABLE_PCIE \ - (1 << VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT) -#define VMXNET3_EXP_EP_OFFSET (0x48)#define VMXNET3_MSI_OFFSET (0x84)#define VMXNET3_MSIX_OFFSET (0x9c)
@@ -2466,8 +2461,6 @@ static const VMStateDescription vmstate_vmxnet3 = {static const Property vmxnet3_properties[] = {DEFINE_NIC_PROPERTIES (VMXNET3State, conf), -DEFINE_PROP_BIT ("x-disable-pcie" , VMXNET3State, compat_flags, -VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT , false), };static void vmxnet3_realize (DeviceState *qdev,Error **errp)
@@ -2476,9 +2469,7 @@ static void vmxnet3_realize(DeviceState *qdev, Error **errp)PCIDevice *pci_dev =PCI_DEVICE (qdev);VMXNET3State *s =VMXNET3 (qdev); -if (!(s->compat_flags &VMXNET3_COMPAT_FLAG_DISABLE_PCIE )) { - pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; - } + pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; vc->parent_dc_realize (qdev, errp); }
Signature · 1 line
2.47.1
Re: [PATCH v3 18/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition
Quoted 11 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:04 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 18/19] hw/net/vmxnet3: Remove
VMXNET3_COMPAT_FLAG_DISABLE_PCIEdefinition
X-Mailer: git-send-email 2.47.1
VMXNET3_COMPAT_FLAG_DISABLE_PCIEwas only used by the hw_compat_2_5[] array, via the 'x-disable-pcie=on' property. We removed all machines using that array, lets remove all the code aroundVMXNET3_COMPAT_FLAG_DISABLE_PCIE.
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/net/vmxnet3.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
PATCH v3 19/19 hw/net/vmxnet3: Merge DeviceRealize in InstanceInit
In reply to Philippe Mathieu-DaudéSimplify merging vmxnet3_realize() within vmxnet3_instance_init(), removing the need for device_class_set_parent_realize().
--- hw/net/vmxnet3.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
hw/net/vmxnet3.c +1 -14
@@ -2238,6 +2238,7 @@ static void vmxnet3_instance_init(Object *obj)device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" ,DEVICE (obj)); +PCI_DEVICE (obj)->cap_present |=QEMU_PCI_CAP_EXPRESS ; }static void vmxnet3_pci_uninit (PCIDevice *pci_dev)
@@ -2463,22 +2464,10 @@ static const Property vmxnet3_properties[] = { DEFINE_NIC_PROPERTIES(VMXNET3State, conf), }; -static void vmxnet3_realize (DeviceState *qdev,Error **errp) -{ -VMXNET3Class *vc =VMXNET3_DEVICE_GET_CLASS (qdev); -PCIDevice *pci_dev =PCI_DEVICE (qdev); -VMXNET3State *s =VMXNET3 (qdev); - - pci_dev->cap_present |=QEMU_PCI_CAP_EXPRESS ; - - vc->parent_dc_realize (qdev, errp); -} -static void vmxnet3_class_init (ObjectClass *class,const void *data) {DeviceClass *dc =DEVICE_CLASS (class);PCIDeviceClass *c =PCI_DEVICE_CLASS (class); -VMXNET3Class *vc =VMXNET3_DEVICE_CLASS (class); c->realize = vmxnet3_pci_realize; c->exit = vmxnet3_pci_uninit;
@@ -2489,8 +2478,6 @@ static void vmxnet3_class_init(ObjectClass *class, const void *data) c->class_id =PCI_CLASS_NETWORK_ETHERNET ; c->subsystem_vendor_id =PCI_VENDOR_ID_VMWARE ; c->subsystem_id =PCI_DEVICE_ID_VMWARE_VMXNET3 ; -device_class_set_parent_realize (dc, vmxnet3_realize, - &vc->parent_dc_realize); dc->desc ="VMWare Paravirtualized Ethernet v3" ;device_class_set_legacy_reset (dc, vmxnet3_qdev_reset); dc->vmsd = &vmstate_vmxnet3;
Signature · 1 line
2.47.1
Re: [PATCH v3 19/19] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit
Quoted 6 lines · Philippe Mathieu-Daudé
Date: Tue, 6 May 2025 16:39:05 +0200
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v3 19/19] hw/net/vmxnet3: Merge DeviceRealize in
InstanceInit
X-Mailer: git-send-email 2.47.1
Quoted 8 lines
Simplify merging
vmxnet3_realize()withinvmxnet3_instance_init(), removing the need fordevice_class_set_parent_realize().Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>--- hw/net/vmxnet3.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
Quoted 8 lines · Philippe Mathieu-Daudé
(series reviewed)
Since v2:
- Removed qtest intest-x86-cpuid-compat.cSince v1:
- Fixed issues noticed by Thomas
Quoted 7 lines
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.4 and 2.5 machines removal, as it is a big enough number of LoC removed. Rest will follow. Highlight is the legacy
fw_cfgAPI removal :)
Hi Philippe,
I just gave this series a try, but it fails in at least two spots.
First, you missed this:
hw/block/fdc-isa.c +0 -1
@@ -112,7 +112,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) }qdev_set_legacy_instance_id (dev, isa->iobase,2 ); -qdev_prop_set_enum (dev,"fallback" ,FLOPPY_DRIVE_TYPE_288 );fdctrl_realize_common (dev, fdctrl, &err);if (err !=NULL ) {
Second, bios-tables-test now complains about a mismatch in the ACPI tables somewhere...
Could you please fix that up and check in the gitlab CI whether the problems are gone? Thanks!
Thomas
Quoted 27 lines · Thomas Huth
Quoted 8 lines · Philippe Mathieu-Daudé
(series reviewed)
Since v2:
- Removed qtest intest-x86-cpuid-compat.cSince v1:
- Fixed issues noticed by ThomasQuoted 7 lines
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.4 and 2.5 machines removal, as it is a big enough number of LoC removed. Rest will follow. Highlight is the legacy
fw_cfgAPI removal :)Hi Philippe,
I just gave this series a try, but it fails in at least two spots.
First, you missed this:
hw/block/fdc-isa.c static void isabus_fdc_realize(DeviceState *dev, · line 116
Quoted 5 lines
hw/block/fdc-isa.c +0
-1@@ -112,7 +112,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) } qdev_set_legacy_instance_id(dev, isa->iobase, 2); - qdev_prop_set_enum(dev, "fallback", FLOPPY_DRIVE_TYPE_288);
This should be:
+ fdctrl->fallback = FLOPPY_DRIVE_TYPE_288;
Quoted 5 lines
hw/block/fdc-isa.c +0
-0fdctrl_realize_common(dev, fdctrl, &err); if (err != NULL) {Second, bios-tables-test now complains about a mismatch in the ACPI tables somewhere...
I can not reproduce that (tested on macOS and Linux).
Quoted 5 lines
Could you please fix that up and check in the gitlab CI whether the problems are gone? Thanks!
Thomas
Quoted 39 lines · Philippe Mathieu-Daudé
Quoted 27 lines · Thomas Huth
Quoted 8 lines · Philippe Mathieu-Daudé
(series reviewed)
Since v2:
- Removed qtest intest-x86-cpuid-compat.cSince v1:
- Fixed issues noticed by ThomasQuoted 7 lines
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.4 and 2.5 machines removal, as it is a big enough number of LoC removed. Rest will follow. Highlight is the legacy
fw_cfgAPI removal :)Hi Philippe,
I just gave this series a try, but it fails in at least two spots.
First, you missed this:
hw/block/fdc-isa.c static void isabus_fdc_realize(DeviceState *dev, Error · line 116
Quoted 5 lines
hw/block/fdc-isa.c +0
-1@@ -112,7 +112,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) } qdev_set_legacy_instance_id(dev, isa->iobase, 2); - qdev_prop_set_enum(dev, "fallback", FLOPPY_DRIVE_TYPE_288);This should be:
+
fdctrl->fallback=FLOPPY_DRIVE_TYPE_288;Quoted 1 line
Quoted 6 lines
Quoted 4 lines
fdctrl_realize_common(dev, fdctrl, &err);
if (err != NULL) {Second, bios-tables-test now complains about a mismatch in the ACPI tables somewhere...
I can not reproduce that (tested on macOS and Linux).
Maybe it was just a side-effect of my removal of the qdev_prop_set_enum(dev, "fallback", ...) line from the code ... if "make check" now works fine, then never mind!
Thomas