From patchwork Thu May 21 02:28:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9D4932121F for ; Thu, 21 May 2015 02:42:53 +0000 (UTC) Received: by lbbuh7 with SMTP id uh7sf2756316lbb.3 for ; Wed, 20 May 2015 19:42:52 -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=so+GUBCSzhx8H9NX+EvhUSqMftw4yBN38YEwPTLpWZo=; b=ij+uXlWbx75DwjFEFGdOWIB6uMrq2RXNK3GOWkh+hLm+UjXspe58j2edG/6QSNjtLF BBAYW9hVbIQ2QxcGW4p3DN/SgXl7UQSqeFuL7xY5XhEj629XlBNAwZfafWlPp7dp3lFt gbWPgEi9EjAc2k4auLfyG/PVjOADLPQG2p+deVi5H0di4CvN//Mz1prTxkbZ8O1ZYO85 slJ2Ag3MAmxLz6nTudhGm7OEgCesJJKWhUwKNmYpTym5DIAJ366Gv6UNAuG1Wp/Z5UYT nhV/WNMeA+btTPKUofd5HlajDWvGqDx1pnCa9smhUZ8oPaeYaZEMPm8XJfb31ApNQ34L 2XHg== X-Gm-Message-State: ALoCoQkzF7S4qrxnaoVIU3TQ4nHz6Y+tdQGQq7Nu1+dWfd7ZzJIPae9LzkGmXMrapUX2nCVXhSyY X-Received: by 10.112.13.200 with SMTP id j8mr475244lbc.14.1432176172598; Wed, 20 May 2015 19:42:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.100 with SMTP id j4ls289591lah.92.gmail; Wed, 20 May 2015 19:42:52 -0700 (PDT) X-Received: by 10.112.210.2 with SMTP id mq2mr330116lbc.17.1432176172488; Wed, 20 May 2015 19:42:52 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id s10si12340497lae.50.2015.05.20.19.42.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 19:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by laat2 with SMTP id t2so92555267laa.1 for ; Wed, 20 May 2015 19:42:52 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr357359lbh.56.1432176172360; Wed, 20 May 2015 19:42:52 -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 hn6csp232738lbb; Wed, 20 May 2015 19:42:51 -0700 (PDT) X-Received: by 10.140.84.104 with SMTP id k95mr554507qgd.45.1432176171155; Wed, 20 May 2015 19:42:51 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y62si2574794qky.22.2015.05.20.19.42.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 19:42:51 -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]:54673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGRe-0005Te-9u for patch@linaro.org; Wed, 20 May 2015 22:42:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGJN-00072g-Li for qemu-devel@nongnu.org; Wed, 20 May 2015 22:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvGJI-0007Aa-Ub for qemu-devel@nongnu.org; Wed, 20 May 2015 22:34:17 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:3022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGJI-000770-CW for qemu-devel@nongnu.org; Wed, 20 May 2015 22:34:12 -0400 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLR49696; Thu, 21 May 2015 10:30:44 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Thu, 21 May 2015 10:30:34 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 21 May 2015 10:28:51 +0800 Message-ID: <1432175331-12548-25-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432175331-12548-1-git-send-email-zhaoshenglong@huawei.com> References: <1432175331-12548-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 v8 24/24] 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.52 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;