From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqXaE-0001Cp-QG for qemu-devel@nongnu.org; Thu, 07 May 2015 22:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqXaA-0002NQ-OA for qemu-devel@nongnu.org; Thu, 07 May 2015 22:00:10 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:11694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqXaA-0002EX-7a for qemu-devel@nongnu.org; Thu, 07 May 2015 22:00:06 -0400 Message-ID: <554C1562.9060807@huawei.com> Date: Fri, 8 May 2015 09:46:10 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1430990964-10528-1-git-send-email-zhaoshenglong@huawei.com> <1430990964-10528-4-git-send-email-zhaoshenglong@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 03/22] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: hangaohuai@huawei.com, "Michael S. Tsirkin" , Alexander Spyridakis , Claudio Fontana , QEMU Developers , "Huangpeng (Peter)" , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Hanjun Guo , Igor Mammedov , Paolo Bonzini , Laszlo Ersek , Christoffer Dall , Shannon Zhao On 2015/5/7 23:44, Peter Maydell wrote: > On 7 May 2015 at 10:29, Shannon Zhao wrote: >> From: Shannon Zhao >> >> Introduce a preliminary framework in virt-acpi-build.c with the main >> ACPI build functions. It exposes the generated ACPI contents to >> guest over fw_cfg. >> >> The required ACPI v5.1 tables for ARM are: >> - RSDP: Initial table that points to XSDT >> - RSDT: Points to FADT GTDT MADT tables >> - FADT: Generic information about the machine >> - GTDT: Generic timer description table >> - MADT: Multiple APIC description table >> - DSDT: Holds all information about system devices/peripherals, pointed by FADT >> >> Signed-off-by: Shannon Zhao >> Signed-off-by: Shannon Zhao >> --- >> hw/arm/Makefile.objs | 1 + >> hw/arm/virt-acpi-build.c | 184 +++++++++++++++++++++++++++++++++++++++ >> include/hw/arm/virt-acpi-build.h | 70 +++++++++++++++ >> qemu-options.hx | 2 +- >> trace-events | 3 + >> 5 files changed, 259 insertions(+), 1 deletion(-) >> create mode 100644 hw/arm/virt-acpi-build.c >> create mode 100644 include/hw/arm/virt-acpi-build.h >> >> diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs >> index 2577f68..a1bfb19 100644 >> --- a/hw/arm/Makefile.objs >> +++ b/hw/arm/Makefile.objs >> @@ -3,6 +3,7 @@ obj-$(CONFIG_DIGIC) += digic_boards.o >> obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o >> obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o >> obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o >> +obj-$(CONFIG_ACPI) += virt-acpi-build.o >> obj-y += netduino2.o >> >> obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o >> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c >> new file mode 100644 >> index 0000000..960206d >> --- /dev/null >> +++ b/hw/arm/virt-acpi-build.c >> @@ -0,0 +1,184 @@ >> +/* Support for generating ACPI tables and passing them to Guests >> + * >> + * ARM virt ACPI generation >> + * >> + * Copyright (C) 2008-2010 Kevin O'Connor >> + * Copyright (C) 2006 Fabrice Bellard >> + * Copyright (C) 2013 Red Hat Inc >> + * >> + * Author: Michael S. Tsirkin >> + * >> + * Copyright (c) 2015 HUAWEI TECHNOLOGIES CO.,LTD. >> + * >> + * Author: Shannon Zhao >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License as published by >> + * the Free Software Foundation; either version 2 of the License, or >> + * (at your option) any later version. >> + >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + >> + * You should have received a copy of the GNU General Public License along >> + * with this program; if not, see . >> + */ >> + >> +#include "hw/arm/virt-acpi-build.h" > > This should go below qemu-common.h, not above it. > >> +#include >> +#include > > You shouldn't need to include these system-level headers: qemu-common.h > will take care of them for you. > Ok, will remove these. >> +#include "qemu-common.h" >> +#include "qemu/bitmap.h" >> +#include "trace.h" >> +#include "qom/cpu.h" >> +#include "target-arm/cpu.h" >> +#include "hw/acpi/acpi-defs.h" >> +#include "hw/acpi/acpi.h" >> +#include "hw/nvram/fw_cfg.h" >> +#include "hw/acpi/bios-linker-loader.h" >> +#include "hw/loader.h" >> +#include "hw/hw.h" >> +#include "hw/acpi/aml-build.h" >> + >> +typedef >> +struct AcpiBuildState { >> + /* Copy of table in RAM (for patching). */ >> + MemoryRegion *table_mr; >> + MemoryRegion *rsdp_mr; >> + MemoryRegion *linker_mr; >> + /* Is table patched? */ >> + uint8_t patched; > > Why not a bool? > Ok, will replace it. -- Shannon