From patchwork Thu May 14 09:19:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48499 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2AB752121F for ; Thu, 14 May 2015 09:32:28 +0000 (UTC) Received: by wgvl6 with SMTP id l6sf16333669wgv.2 for ; Thu, 14 May 2015 02:32:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=NzaKGE7Fqrd+quRvGg0Ej1XKjXru3rSF8uHOiShdXdA=; b=ZHEWCBO64tgBRp5jWGhMYhzMnvDhGMXPlR/+ONphQmD2XKpLnrg8QqlcfEVXUlsYMi yNiXut2nRcQElZPQsCyYDhCgZyyRFIZk+nt54gJHbHMc8SLosayzWNUPhnHbScj+y/1V hEZoeZEMccu93uXN9eQo6ERoiiQZ0gI1WVqctrhMUYMuaJtDn39JUigx4U7xx/dkRC5A InjJdWkeGBCSOHEp4zUJcyFABvAMcdSB7XW5R2Pc4v1K2OSvq5GmkPSFSTLeUI/tCrkN MfIChOCAOndTyw77z0hiCinuDeSKHmmLb2i5DHM6NoQ0mu2CfyciLPsw0DAFs+57iqGE 15tQ== X-Gm-Message-State: ALoCoQlOI9iYVx67EjuqZWbhmJAigF8FlO9/G0ttJ4l+RDJLxow/mPJhjS+3TlgoxBcoAfZg/7Hi X-Received: by 10.112.162.228 with SMTP id yd4mr2461842lbb.8.1431595947405; Thu, 14 May 2015 02:32:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.42 with SMTP id u10ls346803laz.64.gmail; Thu, 14 May 2015 02:32:27 -0700 (PDT) X-Received: by 10.112.163.168 with SMTP id yj8mr2480913lbb.36.1431595947227; Thu, 14 May 2015 02:32:27 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id o2si14112826lah.165.2015.05.14.02.32.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 02:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laat2 with SMTP id t2so59241350laa.1 for ; Thu, 14 May 2015 02:32:27 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr2389277lac.41.1431595947135; Thu, 14 May 2015 02:32:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1119315lbb; Thu, 14 May 2015 02:32:26 -0700 (PDT) X-Received: by 10.141.23.201 with SMTP id z192mr1746018qhd.82.1431595945694; Thu, 14 May 2015 02:32:25 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f79si854832qki.28.2015.05.14.02.32.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 14 May 2015 02:32:25 -0700 (PDT) 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; Received: from localhost ([::1]:53346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspVA-0000xf-S1 for patch@linaro.org; Thu, 14 May 2015 05:32:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspNm-0005hQ-Sd for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YspNl-0001bs-Ey for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:46 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:32581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspNk-0001Z1-RG for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:45 -0400 Received: from 172.24.2.119 (EHLO szxeml430-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLJ60817; Thu, 14 May 2015 17:21:21 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.158.1; Thu, 14 May 2015 17:21:11 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 14 May 2015 17:19:42 +0800 Message-ID: <1431595182-7552-24-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1431595182-7552-1-git-send-email-zhaoshenglong@huawei.com> References: <1431595182-7552-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v7 23/23] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao Initialize VirtGuestInfoState and register a machine_init_done notify to call virt_acpi_build(). Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a6a399d..05db8cb 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -44,6 +44,7 @@ #include "qemu/bitops.h" #include "qemu/error-report.h" #include "hw/pci-host/gpex.h" +#include "hw/arm/virt-acpi-build.h" /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 128 @@ -697,6 +698,14 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) return board->fdt; } +static +void virt_guest_info_machine_done(Notifier *notifier, void *data) +{ + VirtGuestInfoState *guest_info_state = container_of(notifier, + VirtGuestInfoState, machine_done); + virt_acpi_setup(&guest_info_state->info); +} + static void machvirt_init(MachineState *machine) { VirtMachineState *vms = VIRT_MACHINE(machine); @@ -706,6 +715,8 @@ static void machvirt_init(MachineState *machine) MemoryRegion *ram = g_new(MemoryRegion, 1); const char *cpu_model = machine->cpu_model; VirtBoardInfo *vbi; + VirtGuestInfoState *guest_info_state = g_malloc0(sizeof *guest_info_state); + VirtGuestInfo *guest_info = &guest_info_state->info; uint32_t gic_phandle; char **cpustr; @@ -798,6 +809,14 @@ static void machvirt_init(MachineState *machine) create_virtio_devices(vbi, pic); create_fw_cfg(vbi); + rom_set_fw(fw_cfg_find()); + + guest_info->smp_cpus = smp_cpus; + guest_info->fw_cfg = fw_cfg_find(); + guest_info->memmap = vbi->memmap; + guest_info->irqmap = vbi->irqmap; + guest_info_state->machine_done.notify = virt_guest_info_machine_done; + qemu_add_machine_init_done_notifier(&guest_info_state->machine_done); vbi->bootinfo.ram_size = machine->ram_size; vbi->bootinfo.kernel_filename = machine->kernel_filename;