Received: from eggs.gnu.org ([208.118.235.92]:48221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swk0y-0001Pn-Hh for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:15:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swk0w-0007Ds-0g for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:15:48 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:57984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swk0v-0007DY-SR for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:15:45 -0400 Received: by vcbfl15 with SMTP id fl15so7278805vcb.4 for ; Wed, 01 Aug 2012 18:15:45 -0700 (PDT) Date: Wed, 1 Aug 2012 21:15:43 -0400 From: Kevin O'Connor Message-ID: <20120802011543.GA12333@morn.localdomain> References: <1342724013-1633-1-git-send-email-minyard@acm.org> <1342724013-1633-2-git-send-email-minyard@acm.org> <87obmxxntb.fsf@codemonkey.ws> <5016B9D2.2010401@mvista.com> <87sjc917r7.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sjc917r7.fsf@codemonkey.ws> Subject: Re: [Qemu-devel] [PATCH 01/18] smbios: Add a function to directly add an entry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Corey Minyard , qemu-devel@nongnu.org, minyard@acm.org On Mon, Jul 30, 2012 at 12:25:16PM -0500, Anthony Liguori wrote: > Corey Minyard writes: > > On 07/30/2012 10:37 AM, Anthony Liguori wrote: > >> minyard@acm.org writes: > >>> There was no way to directly add a table entry to the SMBIOS table, > >>> even though the BIOS supports this. So add a function to do this. > >>> This is in preparation for the IPMI handler adding it's SMBIOS table > >>> entry. > >> I don't expect that hardware ever adds SMBIOS entries. Rather, the BIOS > >> adds the entries by probing the hardware. > > > > Well, memory entries are added by QEMU, why not let the BIOS probe for > > that? > QEMU doesn't add any entries by default. SeaBIOS owns SMBIOS. QEMU > uses a backchannel to hand SeaBIOS tables that SeaBIOS can then expose. > The reason we use a table based interface is because type 0 and type 1 > tables can have vendor extensions that are in a vendor specific format. > > But SeaBIOS unquestionably owns SMBIOS generation. [...] > >> So I think you should solve this in SeaBIOS, instead of trying to do it > >> in QEMU. I think that also solves the problem you have with > >> pre-firmware init. > > The user can pass the I/O base and IRQ values in on the QEMU command > > line, and they can be arbitrary values. The BIOS is not going to be > > able to probe for those. > > Then pass the information that the BIOS needs through fw_cfg. That's > what it's there for. This approach, unfortunately, leads to extra code and "double handling" of infomation. The ultimate consumer of the data wants a binary struct which looks like: struct smbios_type_38 { struct smbios_structure_header header; u8 interface_type; u8 ipmi_version; u8 i2c_slave_addr; u8 nv_storage_dev_addr; u64 base_addr; u8 base_addr_mod_and_irq_info; u8 interrupt_number; }; The proposed solution is to put the info in a binary struct which looks like: struct ipmi_info { u8 str_version; u8 interface; u8 reg_space; u8 reg_spacing; u8 slave_addr; u8 irq; u8 version; u8 reserved1; u64 base_addr; } PACKED; and then have SeaBIOS translate the latter binary struct into the former. However, there's no compelling reason to introduce a new binary struct instead of using the industry standard binary struct. I'd prefer QEMU to just pass the SMBIOS struct and let SeaBIOS pass it through to the OS. I also think the existing fw_cfg mechanism for passing SMBIOS tables should be used. I understand that this causes some contortions due to the current SMBIOS fw_cfg impementation in QEMU, but it seems wrong to introduce a new fw_cfg port that accomplishes the same goal as an existing fw_cfg port. -Kevin