From patchwork Thu Dec 17 18:50:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 58616 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp568128lbb; Thu, 17 Dec 2015 11:24:23 -0800 (PST) X-Received: by 10.140.99.86 with SMTP id p80mr69144398qge.97.1450380263397; Thu, 17 Dec 2015 11:24:23 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x67si12614830qhx.0.2015.12.17.11.24.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 11:24:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:56495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9eA2-00025g-Un for patch@linaro.org; Thu, 17 Dec 2015 14:24:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ddf-0007QA-Nk for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9ddc-0007Lf-SE for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:50:55 -0500 Received: from vms173019pub.verizon.net ([206.46.173.19]:60690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ddc-0007Kg-OK for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:50:52 -0500 Received: from serve.minyard.net ([173.57.176.17]) by vms173019.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NZI007WVN05ID81@vms173019.mailsrvcs.net> for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:50:30 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=WpDWSorv c=1 sm=1 tr=0 a=bXmWQgKa9n63w7XTPFb8JQ==:117 a=N54-gffFAAAA:8 a=HL3alpDKAAAA:8 a=oR5dmqMzAAAA:8 a=xqWC_Br6kY4A:10 a=wUQvQvOEmiQA:10 a=fk1lIlRQAAAA:8 a=6yxNTBahKsxDoOHaevQA:9 Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:53a:188f:9b92:a0a7]) by serve.minyard.net (Postfix) with ESMTPA id B4DC8A428; Thu, 17 Dec 2015 12:50:29 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 3AA7D300FED; Thu, 17 Dec 2015 12:50:27 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Date: Thu, 17 Dec 2015 12:50:15 -0600 Message-id: <1450378219-25799-13-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.5.0 In-reply-to: <1450378219-25799-1-git-send-email-minyard@acm.org> References: <1450378219-25799-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.19 X-Mailman-Approved-At: Thu, 17 Dec 2015 14:22:15 -0500 Cc: Corey Minyard Subject: [Qemu-devel] [PATCH v5 12/16] pc: Postpone SMBIOS table installation to post machine init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 --- hw/i386/pc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.5.0 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5e20e07..861f887 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -781,8 +781,6 @@ static FWCfgState *bochs_bios_init(AddressSpace *as) acpi_tables, acpi_tables_len); fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override()); - pc_build_smbios(fw_cfg); - 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, @@ -1174,6 +1172,7 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState, machine_done); + FWCfgState *fw_cfg = guest_info_state->info.fw_cfg; PCIBus *bus = find_i440fx(); if (bus) { @@ -1185,15 +1184,17 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) extra_hosts++; } } - if (extra_hosts && guest_info_state->info.fw_cfg) { + if (extra_hosts && fw_cfg) { uint64_t *val = g_malloc(sizeof(*val)); *val = cpu_to_le64(extra_hosts); - fw_cfg_add_file(guest_info_state->info.fw_cfg, - "etc/extra-pci-roots", val, sizeof(*val)); + fw_cfg_add_file(fw_cfg, "etc/extra-pci-roots", val, sizeof(*val)); } } acpi_setup(&guest_info_state->info); + if (fw_cfg) { + pc_build_smbios(fw_cfg); + } } PcGuestInfo *pc_guest_info_init(PCMachineState *pcms)