From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZLV6-0003py-9O for qemu-devel@nongnu.org; Sat, 21 Mar 2015 11:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZLV0-0007vq-HV for qemu-devel@nongnu.org; Sat, 21 Mar 2015 11:39:48 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:35622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZLV0-0007vl-7Z for qemu-devel@nongnu.org; Sat, 21 Mar 2015 11:39:42 -0400 Received: by wibdy8 with SMTP id dy8so11882633wib.0 for ; Sat, 21 Mar 2015 08:39:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <550D90B6.5040205@redhat.com> Date: Sat, 21 Mar 2015 16:39:34 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1426789244-26318-1-git-send-email-somlo@cmu.edu> In-Reply-To: <1426789244-26318-1-git-send-email-somlo@cmu.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] fw_cfg: factor out initialization of FW_CFG_ID (rev. number) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" , qemu-devel@nongnu.org Cc: matt.fleming@intel.com, gleb@cloudius-systems.com, jordan.l.justen@intel.com, mdroth@linux.vnet.ibm.com, rjones@redhat.com, gsomlo@gmail.com, kraxel@redhat.com, lersek@redhat.com, armbru@redhat.com On 19/03/2015 19:20, Gabriel L. Somlo wrote: > Signed-off-by: Gabriel Somlo > --- > > 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 >> On Thu, Mar 19, 2015 at 06:25:15PM +0100, Paolo Bonzini wrote: >>> On 19/03/2015 18:14, Gabriel L. Somlo wrote: >>>> 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. >> >> OK, here it is. I have no idea how urgent this is, but since the rest >> of my fw_cfg series 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(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 4b46c29..cf5274d 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -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); > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > index 4caf536..68eff77 100644 > --- a/hw/nvram/fw_cfg.c > +++ b/hw/nvram/fw_cfg.c > @@ -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); > diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c > index 624b4ab..e0397bc 100644 > --- a/hw/ppc/mac_newworld.c > +++ b/hw/ppc/mac_newworld.c > @@ -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); > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index 3079510..f26133d 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -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); > diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c > index b879aa9..255ba1f 100644 > --- a/hw/sparc/sun4m.c > +++ b/hw/sparc/sun4m.c > @@ -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); > diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c > index f027caf..6f34e87 100644 > --- a/hw/sparc64/sun4u.c > +++ b/hw/sparc64/sun4u.c > @@ -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); >