fw_cfg: factor out initialization of FW_CFG_ID (rev. number)
PATCH v2 1/1 fw_cfg: factor out initialization of FW_CFG_ID (rev. number)
---
And, once again, this time after testing and making sure semicolons were't inadvertently left out :)
Sorry for all the noise,
Gabriel
Quoted 11 lines · Paolo Bonzini
Quoted 9 lines · Gabriel L. Somlo
Quoted 6 lines
I'd be happy to add a patch factoring out the call to
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);into
fw_cfg_init1(), which would then make it consistent across all architectures, including arm/virt.Yes, please---this should be a 2.3 blocker.
Quoted 8 lines
OK, here it is. I have no idea how urgent this is, but since the rest of my
fw_cfgseries is still being worked on (I don't want to rush figuring out the part where I deal with -readconfig on the command line :) I thought maybe it would make sense to submit this as a standalone patch.I can always just re-submit it as part of my series' v3 later, if that's more convenient. Let me know either way.
hw/i386/pc.c | 1 - hw/nvram/fw_cfg.c | 1 + hw/ppc/mac_newworld.c | 1 - hw/ppc/mac_oldworld.c | 1 - hw/sparc/sun4m.c | 1 - hw/sparc64/sun4u.c | 1 - 6 files changed, 1 insertion(+), 5 deletions(-)
hw/i386/pc.c +0 -1
@@ -702,7 +702,6 @@ static FWCfgState *bochs_bios_init(void)* the APIC ID, not the "CPU index" */ fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )apic_id_limit); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_bytes (fw_cfg,FW_CFG_ACPI_TABLES , acpi_tables, acpi_tables_len);
hw/nvram/fw_cfg.c +1 -0
@@ -614,6 +614,7 @@ static void fw_cfg_init1(DeviceState *dev)qdev_init_nofail (dev);fw_cfg_add_bytes (s,FW_CFG_SIGNATURE , (char *)"QEMU" ,4 ); +fw_cfg_add_i32 (s,FW_CFG_ID ,1 );fw_cfg_add_bytes (s,FW_CFG_UUID , qemu_uuid,16 );fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )(display_type ==DT_NOGRAPHIC ));fw_cfg_add_i16 (s,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);
hw/ppc/mac_newworld.c +0 -1
@@ -460,7 +460,6 @@ static void ppc_core99_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , machine_arch);fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);
hw/ppc/mac_oldworld.c +0 -1
@@ -315,7 +315,6 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID ,ARCH_HEATHROW );fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);
hw/sparc/sun4m.c +0 -1
@@ -1088,7 +1088,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_DEPTH , graphic_depth);
hw/sparc64/sun4u.c +0 -1
@@ -895,7 +895,6 @@ static void sun4uv_init(MemoryRegion *address_space_mem, fw_cfg =fw_cfg_init_io (BIOS_CFG_IOPORT );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i64 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_entry);
Signature · 1 line
2.1.0
Quoted 103 lines · Gabriel L. Somlo
Signed-off-by Gabriel Somlo <[email protected]>---
And, once again, this time after testing and making sure semicolons were't inadvertently left out :)
Sorry for all the noise,
GabrielQuoted 11 lines · Paolo Bonzini
Quoted 9 lines · Gabriel L. Somlo
Quoted 6 lines
I'd be happy to add a patch factoring out the call to
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);into
fw_cfg_init1(), which would then make it consistent across all architectures, including arm/virt.Yes, please---this should be a 2.3 blocker.
Quoted 8 lines
OK, here it is. I have no idea how urgent this is, but since the rest of my
fw_cfgseries is still being worked on (I don't want to rush figuring out the part where I deal with -readconfig on the command line :) I thought maybe it would make sense to submit this as a standalone patch.I can always just re-submit it as part of my series' v3 later, if that's more convenient. Let me know either way.
hw/i386/pc.c | 1 - hw/nvram/fw_cfg.c | 1 + hw/ppc/mac_newworld.c | 1 - hw/ppc/mac_oldworld.c | 1 - hw/sparc/sun4m.c | 1 - hw/sparc64/sun4u.c | 1 - 6 files changed, 1 insertion(+), 5 deletions(-)hw/i386/pc.c +0
-1@@ -702,7 +702,6 @@ static FWCfgState *bochs_bios_init(void)* the APIC ID, not the "CPU index" */ fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )apic_id_limit); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_bytes (fw_cfg,FW_CFG_ACPI_TABLES , acpi_tables, acpi_tables_len);hw/nvram/fw_cfg.c +1
-0@@ -614,6 +614,7 @@ static void fw_cfg_init1(DeviceState *dev)qdev_init_nofail (dev);fw_cfg_add_bytes (s,FW_CFG_SIGNATURE , (char *)"QEMU" ,4 ); +fw_cfg_add_i32 (s,FW_CFG_ID ,1 );fw_cfg_add_bytes (s,FW_CFG_UUID , qemu_uuid,16 );fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )(display_type ==DT_NOGRAPHIC ));fw_cfg_add_i16 (s,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);hw/ppc/mac_newworld.c +0
-1@@ -460,7 +460,6 @@ static void ppc_core99_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , machine_arch);fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);hw/ppc/mac_oldworld.c +0
-1@@ -315,7 +315,6 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID ,ARCH_HEATHROW );fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);hw/sparc/sun4m.c +0
-1@@ -1088,7 +1088,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_DEPTH , graphic_depth);hw/sparc64/sun4u.c +0
-0
hw/sparc64/sun4u.c static void sun4uv_init(MemoryRegion *address_space_mem, · line 900
Quoted 7 lines
hw/sparc64/sun4u.c +0
-1@@ -895,7 +895,6 @@ static void sun4uv_init(MemoryRegion *address_space_mem, fw_cfg =fw_cfg_init_io (BIOS_CFG_IOPORT );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i64 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_entry);
Quoted 8 lines · Gabriel L. Somlo
Signed-off-by Gabriel Somlo <[email protected]>---
And, once again, this time after testing and making sure semicolons were't inadvertently left out :)
Sorry for all the noise,
Gabriel
Queued for 2.3.0-rc.
Paolo
Quoted 101 lines
Quoted 11 lines · Paolo Bonzini
Quoted 9 lines · Gabriel L. Somlo
Quoted 6 lines
I'd be happy to add a patch factoring out the call to
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);into
fw_cfg_init1(), which would then make it consistent across all architectures, including arm/virt.Yes, please---this should be a 2.3 blocker.
Quoted 8 lines
OK, here it is. I have no idea how urgent this is, but since the rest of my
fw_cfgseries is still being worked on (I don't want to rush figuring out the part where I deal with -readconfig on the command line :) I thought maybe it would make sense to submit this as a standalone patch.I can always just re-submit it as part of my series' v3 later, if that's more convenient. Let me know either way.
hw/i386/pc.c | 1 - hw/nvram/fw_cfg.c | 1 + hw/ppc/mac_newworld.c | 1 - hw/ppc/mac_oldworld.c | 1 - hw/sparc/sun4m.c | 1 - hw/sparc64/sun4u.c | 1 - 6 files changed, 1 insertion(+), 5 deletions(-)hw/i386/pc.c +0
-1@@ -702,7 +702,6 @@ static FWCfgState *bochs_bios_init(void)* the APIC ID, not the "CPU index" */ fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )apic_id_limit); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_bytes (fw_cfg,FW_CFG_ACPI_TABLES , acpi_tables, acpi_tables_len);hw/nvram/fw_cfg.c +1
-0@@ -614,6 +614,7 @@ static void fw_cfg_init1(DeviceState *dev)qdev_init_nofail (dev);fw_cfg_add_bytes (s,FW_CFG_SIGNATURE , (char *)"QEMU" ,4 ); +fw_cfg_add_i32 (s,FW_CFG_ID ,1 );fw_cfg_add_bytes (s,FW_CFG_UUID , qemu_uuid,16 );fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )(display_type ==DT_NOGRAPHIC ));fw_cfg_add_i16 (s,FW_CFG_NB_CPUS , (uint16_t )smp_cpus);hw/ppc/mac_newworld.c +0
-1@@ -460,7 +460,6 @@ static void ppc_core99_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , machine_arch);fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);hw/ppc/mac_oldworld.c +0
-1@@ -315,7 +315,6 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID ,ARCH_HEATHROW );fw_cfg_add_i32 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_base);hw/sparc/sun4m.c +0
-1@@ -1088,7 +1088,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, fw_cfg =fw_cfg_init_mem (CFG_ADDR ,CFG_ADDR +2 );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i16 (fw_cfg,FW_CFG_SUN4M_DEPTH , graphic_depth);hw/sparc64/sun4u.c +0
-1@@ -895,7 +895,6 @@ static void sun4uv_init(MemoryRegion *address_space_mem, fw_cfg =fw_cfg_init_io (BIOS_CFG_IOPORT );fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , (uint16_t )max_cpus); -fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 );fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size);fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id);fw_cfg_add_i64 (fw_cfg,FW_CFG_KERNEL_ADDR , kernel_entry);