Received: from eggs.gnu.org ([2001:4830:134:3::10]:46912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYe21-0006rl-TX for qemu-devel@nongnu.org; Thu, 19 Mar 2015 13:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYe1w-0004AZ-8n for qemu-devel@nongnu.org; Thu, 19 Mar 2015 13:14:53 -0400 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:33328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYe1w-0004AV-4E for qemu-devel@nongnu.org; Thu, 19 Mar 2015 13:14:48 -0400 Received: by qgfa8 with SMTP id a8so71118359qgf.0 for ; Thu, 19 Mar 2015 10:14:47 -0700 (PDT) Date: Thu, 19 Mar 2015 13:14:45 -0400 From: "Gabriel L. Somlo" Message-ID: <20150319171445.GO1832@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] Setting FW_CFG_ID (was: [PATCH] fw_cfg: add documentation file) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: matt.fleming@intel.com, mdroth@linux.vnet.ibm.com, rjones@redhat.com, jordan.l.justen@intel.com, "Gabriel L. Somlo" , qemu-devel@nongnu.org, gleb@cloudius-systems.com, kraxel@redhat.com, pbonzini@redhat.com, armbru@redhat.com On Thu, Mar 19, 2015 at 05:14:04PM +0100, Laszlo Ersek wrote: > On 03/19/15 01:18, Gabriel L. Somlo wrote: > > > +=== Revision (Key 0x0001, FW_CFG_ID) === > > + > > +A 32-bit little-endian unsigned int, this item is used as an interface > > +revision number, and is currently set to 1 by all QEMU architectures > > +which expose a fw_cfg device. > > arm/virt doesn't :) > > It could be argued that that's an error in "hw/arm/virt.c". > > On the other hand, all of the other fw_cfg providing boards set the > interface version to 1 manually, despite the device coming from the > same, shared implementation. Therefore one could argue that instead of > adding > > fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); > > to arm/virt, all such existing calls should be consolidated in the > fw_cfg initialization code instead. > > I guess I must have missed doing it the last time because I had bigger > fish to fry, and because value 1 for FW_CFG_ID didn't, and doesn't, seem > to mean anything specific. > > So, I'm just making this note here because I want it on the record that > I read the above paragraph and didn't miss that it was factually > incorrect. How it should be fixed, namely: > - modify the docs, > - modify the arm/virt board code, > - move the FW_CFG_ID setting to fw_cfg_init1() -- after all that's > where FW_CFG_SIGNATURE is set too --, > > I'll leave up to other reviewers. 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. Unless of course anyone chimes in with a good reason for NOT doing that... Thanks much, --Gabriel