From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAwA5-0006tc-6x for qemu-devel@nongnu.org; Fri, 03 Jul 2015 04:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAwA2-0008N6-1I for qemu-devel@nongnu.org; Fri, 03 Jul 2015 04:17:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAwA1-0008N2-Pi for qemu-devel@nongnu.org; Fri, 03 Jul 2015 04:17:25 -0400 Date: Fri, 3 Jul 2015 10:17:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20150703101323-mutt-send-email-mst@redhat.com> References: <1433812331-18993-1-git-send-email-minyard@acm.org> <1433812331-18993-13-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433812331-18993-13-git-send-email-minyard@acm.org> Subject: Re: [Qemu-devel] [PATCH v3 12/16] pc: Postpone SMBIOS table installation to post machine init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: minyard@acm.org Cc: Corey Minyard , qemu-devel@nongnu.org, kraxel@redhat.com On Mon, Jun 08, 2015 at 08:12:07PM -0500, minyard@acm.org wrote: > From: Corey Minyard > > This is the same place that the ACPI SSDT table gets added, so that > devices can add themselves to the SMBIOS table. > > Signed-off-by: Corey Minyard This will change the order of fwcfg files, problematic for cross version migrations. That's exactly the type of problem I pointed out. Should be made conditional on the new machine type? Cc Gerd for an opinion. > --- > hw/i386/pc.c | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index a8e6be1..efe3c2f 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -680,8 +680,6 @@ static unsigned int pc_apic_id_limit(unsigned int max_cpus) > static FWCfgState *bochs_bios_init(void) > { > FWCfgState *fw_cfg; > - uint8_t *smbios_tables, *smbios_anchor; > - size_t smbios_tables_len, smbios_anchor_len; > uint64_t *numa_fw_cfg; > int i, j; > unsigned int apic_id_limit = pc_apic_id_limit(max_cpus); > @@ -707,21 +705,6 @@ static FWCfgState *bochs_bios_init(void) > acpi_tables, acpi_tables_len); > fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override()); > > - smbios_tables = smbios_get_table_legacy(&smbios_tables_len); > - if (smbios_tables) { > - fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES, > - smbios_tables, smbios_tables_len); > - } > - > - smbios_get_tables(&smbios_tables, &smbios_tables_len, > - &smbios_anchor, &smbios_anchor_len); > - if (smbios_anchor) { > - fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables", > - smbios_tables, smbios_tables_len); > - fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", > - smbios_anchor, smbios_anchor_len); > - } > - > fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, > &e820_reserve, sizeof(e820_reserve)); > fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, > @@ -1119,7 +1102,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) > PcGuestInfoState *guest_info_state = container_of(notifier, > PcGuestInfoState, > machine_done); > + uint8_t *smbios_tables, *smbios_anchor; > + size_t smbios_tables_len, smbios_anchor_len; > + FWCfgState *fw_cfg = guest_info_state->info.fw_cfg; > + > acpi_setup(&guest_info_state->info); > + > + smbios_tables = smbios_get_table_legacy(&smbios_tables_len); > + if (smbios_tables) { > + fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES, > + smbios_tables, smbios_tables_len); > + } > + smbios_get_tables(&smbios_tables, &smbios_tables_len, > + &smbios_anchor, &smbios_anchor_len); > + if (smbios_anchor) { > + fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables", > + smbios_tables, smbios_tables_len); > + fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", > + smbios_anchor, smbios_anchor_len); > + } > } > > PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size, > -- > 1.8.3.1 >