From patchwork Mon May 25 02:55:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48944 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3E0C2121F for ; Mon, 25 May 2015 03:08:47 +0000 (UTC) Received: by lagv1 with SMTP id v1sf18654971lag.1 for ; Sun, 24 May 2015 20:08:46 -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=FkxRzJiR/onuuIBPVkC6XRbnMqzY084ZdrRcIm1aklWhLpZ65i7lDxuCK7koyqbO4r 8n1sZJDlvzq1Jo4YSACrtZqndkZjgyXk9+tJ1igMCJG10c31hyuc09Y5pbezJiFI+SqS wC9v4ijKKNS6yukVd3w7y/a8Ym++nbteexq/UonqdmxbGVDRWbHCRKl1NVXF6DzDgogy aYtG3yf5fI88L2Ofe58UdnA5Xhr8Dc68A/Df+CYdl0Q9cuQJIOLJshJ/DEPHBAkp28Yf 1m+II7LasImSb5p2Bkz/AcPgmH9UYv5X9xkd09HiGieaRF6MrAXt3Sj/eOXa1Km6r6Il oB4Q== X-Gm-Message-State: ALoCoQmYDKgKGUTLuQrb+xCf4LsYJtn6y7SnGzOqgUkJ7e1Y+VXT8J33ducvssydEdpG05mfFYdm X-Received: by 10.112.42.236 with SMTP id r12mr20342744lbl.2.1432523326791; Sun, 24 May 2015 20:08:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.232 with SMTP id p8ls735290laf.13.gmail; Sun, 24 May 2015 20:08:46 -0700 (PDT) X-Received: by 10.112.168.102 with SMTP id zv6mr16285894lbb.45.1432523326662; Sun, 24 May 2015 20:08:46 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id n2si7305692lae.61.2015.05.24.20.08.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 20:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcmx3 with SMTP id mx3so43905533lbc.1 for ; Sun, 24 May 2015 20:08:46 -0700 (PDT) X-Received: by 10.152.44.166 with SMTP id f6mr1191736lam.86.1432523326224; Sun, 24 May 2015 20:08:46 -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 hn6csp1544595lbb; Sun, 24 May 2015 20:08:45 -0700 (PDT) X-Received: by 10.140.48.171 with SMTP id o40mr25138167qga.0.1432523325358; Sun, 24 May 2015 20:08:45 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 80si10136567qga.22.2015.05.24.20.08.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 24 May 2015 20:08:45 -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]:41731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywiku-0008NO-DM for patch@linaro.org; Sun, 24 May 2015 23:08:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywicu-0002RI-Kt for qemu-devel@nongnu.org; Sun, 24 May 2015 23:00:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ywicq-0001um-OB for qemu-devel@nongnu.org; Sun, 24 May 2015 23:00:28 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:61036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywicp-0001tU-Vz for qemu-devel@nongnu.org; Sun, 24 May 2015 23:00:24 -0400 Received: from 172.24.2.119 (EHLO szxeml428-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id COJ09220; Mon, 25 May 2015 10:56:47 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.158.1; Mon, 25 May 2015 10:56:39 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Mon, 25 May 2015 10:55:20 +0800 Message-ID: <1432522520-8068-25-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432522520-8068-1-git-send-email-zhaoshenglong@huawei.com> References: <1432522520-8068-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: 58.251.152.64 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v9 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.217.177 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;