From patchwork Thu Nov 12 19:02:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 56466 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp597917lbb; Thu, 12 Nov 2015 11:09:34 -0800 (PST) X-Received: by 10.129.80.138 with SMTP id e132mr16258822ywb.90.1447355372497; Thu, 12 Nov 2015 11:09:32 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o187si10429276ywc.419.2015.11.12.11.09.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Nov 2015 11:09:32 -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; dkim=fail header.i=@gmail.com Received: from localhost ([::1]:49262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwxFU-0005YV-0D for patch@linaro.org; Thu, 12 Nov 2015 14:09:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwx91-0001Wi-Dq for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwx90-00053i-GK for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:51 -0500 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]:34088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwx90-00053b-BE for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:50 -0500 Received: by padhx2 with SMTP id hx2so73149211pad.1 for ; Thu, 12 Nov 2015 11:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/n7Vp6UQyNUK4udmQrILzg+L/d/poykTnA/0Jykpdgc=; b=AevBeY2iVaq3kAl8E8HrIdicjnSFzR33HdHj2BZxjxA4/8BKdn0QJ/F7WFH0LtUbYX DnhseHY6N5mavnj8vwI337+jLI9DnDjOg4Ureg+aA8OBBypX93IcMfaqkujAiRjHixwp IANJOnj9ax8HS0u+lC8UFXVqNiQ4I7GG5GNOktmF3Ni6sSLH+eDx0kZJ/0ETlHwMA2uy eFt2OooP3AMus7f4FjQSKG4ewDaK5X2gETgMQhE+43j6EeOUKKmwPsaeLr+bE7xWjTna LF6FWCFUAatloklTFK0zFlzvJupLDxs3a8w4hmTagCt3nJyMPYNyzIaKPKMoI78RedEX zpgg== X-Received: by 10.66.194.16 with SMTP id hs16mr1383709pac.93.1447354969672; Thu, 12 Nov 2015 11:02:49 -0800 (PST) Received: from t430.minyard.home (pool-173-57-176-17.dllstx.fios.verizon.net. [173.57.176.17]) by smtp.gmail.com with ESMTPSA id tt7sm16134396pab.45.2015.11.12.11.02.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 11:02:46 -0800 (PST) Received: from t430.minyard.home (t430.minyard.home [127.0.0.1]) by t430.minyard.home (8.14.7/8.14.7) with ESMTP id tACJ2iiw019753; Thu, 12 Nov 2015 13:02:44 -0600 Received: (from cminyard@localhost) by t430.minyard.home (8.14.7/8.14.7/Submit) id tACJ2it8019752; Thu, 12 Nov 2015 13:02:44 -0600 From: minyard@acm.org To: qemu-devel@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Date: Thu, 12 Nov 2015 13:02:29 -0600 Message-Id: <1447354953-18893-14-git-send-email-minyard@acm.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1447354953-18893-1-git-send-email-minyard@acm.org> References: <1447354953-18893-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22e Cc: Corey Minyard Subject: [Qemu-devel] [PATCH v4 13/17] 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(-) -- 1.8.3.1 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0cb8afd..47faef7 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)