From patchwork Fri May 13 13:07:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 622021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r5qsb62JBz9t69 for ; Fri, 13 May 2016 23:08:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=JSnP9LMO; dkim-atps=neutral Received: from localhost ([::1]:34465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1Coz-0003yc-Le for incoming@patchwork.ozlabs.org; Fri, 13 May 2016 09:08:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1CoT-0002wF-26 for qemu-devel@nongnu.org; Fri, 13 May 2016 09:07:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1CoN-0006ZT-W6 for qemu-devel@nongnu.org; Fri, 13 May 2016 09:07:28 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:34920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1CoN-0006ZI-QU for qemu-devel@nongnu.org; Fri, 13 May 2016 09:07:23 -0400 Received: by mail-oi0-x241.google.com with SMTP id w198so17275120oiw.2 for ; Fri, 13 May 2016 06:07:23 -0700 (PDT) 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=frcDSYIVB3YKEOmRVCH8ew2TTpaxXHX3r5VRaJNqBY8=; b=JSnP9LMOD5ENuG4U6PYev5F0B2GJyN0EoqjUyoh+JUekulSboDZKvHJcgd5KZYgiEC D5UYDrviBNMqwPlk+2iOafz73fddXlbT71WjVC0W2GZOky7lEbJBDG5cn31xV4JYoJ8Z HJrSCNzG2Oytd7Jxk5UdRtBKdF5TsEaN6rLHI76Wa2A9GpOxsot24xCpd1LguCibEsEd Uor4tLcSzT9eC6PI3PInAMynpLNgahOC/2qvLCWiirUf+3iZw/gHBNfKTC+NCGVVQ2iH gTbHF3/4skoK7C2h688N6QXlCOt7H+rPwAvz5vXW48bqfGoc7q9KD5dV4ybWnpmrgQmg KmQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=frcDSYIVB3YKEOmRVCH8ew2TTpaxXHX3r5VRaJNqBY8=; b=YVJeqilly/SCBXQzzcX8IQ18fwxS4B6avkGRuHrjNa7njYWScBh5xC5WBDMXE7yfQj mi2+oekZa/EEDXciVbN8RId5bgZSYfVqSSiR3iXVONmC0JNV2QwEXnGdbfakEWsXrbCB spWuMAzERA/fEUjo+f4m8jNILAMtaSbqwtDZ2rEgZMh5zxMsMwe8LijZkRcsrog32oOR X2En4y3FA10neiHSbmbjME4AH3WlWDvArMmqt/9lUNVNUINL9A1nT+SEqrBQzOYFiEoB Hfz9vSgFl3b3hpa5Pb4jz9yrWTB45GFYgMQolE/Lf2URPaCpNcb/ZGi+YnXBXJrhfpZu Gzig== X-Gm-Message-State: AOPr4FXwl50Ol93EaDTxLJfcFGrvBnud4Ne4mMMiqUA5FSLhOqRfxz64RMrtEebMhokO3Q== X-Received: by 10.202.192.196 with SMTP id q187mr8897621oif.126.1463144843143; Fri, 13 May 2016 06:07:23 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id y7sm5354369obx.28.2016.05.13.06.07.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 May 2016 06:07:22 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id D91B7183B; Fri, 13 May 2016 08:07:20 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 25CEB30054B; Fri, 13 May 2016 08:07:18 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Fri, 13 May 2016 08:07:07 -0500 Message-Id: <1463144831-4502-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1463144831-4502-1-git-send-email-minyard@acm.org> References: <1463144831-4502-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH v3 2/6] pc: Postpone SMBIOS table installation to post machine init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 99437e0..5e78ef4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -764,8 +764,6 @@ static FWCfgState *bochs_bios_init(AddressSpace *as, PCMachineState *pcms) 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, @@ -1161,6 +1159,7 @@ void pc_machine_done(Notifier *notifier, void *data) { PCMachineState *pcms = container_of(notifier, PCMachineState, machine_done); + FWCfgState *fw_cfg = pcms->fw_cfg; PCIBus *bus = pcms->bus; if (bus) { @@ -1172,15 +1171,17 @@ void pc_machine_done(Notifier *notifier, void *data) extra_hosts++; } } - if (extra_hosts && pcms->fw_cfg) { + if (extra_hosts && fw_cfg) { uint64_t *val = g_malloc(sizeof(*val)); *val = cpu_to_le64(extra_hosts); - fw_cfg_add_file(pcms->fw_cfg, - "etc/extra-pci-roots", val, sizeof(*val)); + fw_cfg_add_file(fw_cfg, "etc/extra-pci-roots", val, sizeof(*val)); } } acpi_setup(); + if (fw_cfg) { + pc_build_smbios(fw_cfg); + } } void pc_guest_info_init(PCMachineState *pcms)