From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YF8pY-0007kv-AD for qemu-devel@nongnu.org; Sat, 24 Jan 2015 17:05:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YF8pV-00024l-5J for qemu-devel@nongnu.org; Sat, 24 Jan 2015 17:05:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YF8pU-00024b-Sy for qemu-devel@nongnu.org; Sat, 24 Jan 2015 17:05:21 -0500 Message-ID: <54C41714.7070809@redhat.com> Date: Sat, 24 Jan 2015 23:05:08 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <1422091280-14532-1-git-send-email-zhaoshenglong@huawei.com> <1422091280-14532-8-git-send-email-zhaoshenglong@huawei.com> In-Reply-To: <1422091280-14532-8-git-send-email-zhaoshenglong@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 07/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com, a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, wanghaibin.wang@huawei.com, peter.huangpeng@huawei.com, hanjun.guo@linaro.org, imammedo@redhat.com, pbonzini@redhat.com, christoffer.dall@linaro.org comments below On 01/24/15 10:21, Shannon Zhao wrote: > FADT points to FACS and DSDT, in the case of mach virt, it is also used > to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. > > Update the header definitions for FADT taking into account the new > additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` > > Signed-off-by: Shannon Zhao > --- > hw/arm/virt-acpi-build.c | 26 ++++++++++ > include/hw/acpi/acpi-defs.h | 114 +++++++++++++++++++++++++++++-------------- > 2 files changed, 103 insertions(+), 37 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 2872dff..e3c708d 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -218,6 +218,32 @@ build_gtdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) > static void > build_fadt(GArray *table_data, GArray *linker, uint64_t facs, uint64_t dsdt) > { > + AcpiFadtDescriptorRev5_1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); > + > + /* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */ You set "Hardware Reduced" here. > + fadt->flags = cpu_to_le32(1 << ACPI_FADT_F_HW_REDUCED_ACPI); > + fadt->arm_boot_flags = cpu_to_le16((1 << ACPI_FADT_ARM_USE_PSCI_G_0_2) | > + (1 << ACPI_FADT_ARM_PSCI_USE_HVC)); > + > + /* ACPI v5.1 (fadt->revision.fadt->minor_revision) */ > + fadt->minor_revision = 0x1; > + > + fadt->Xfacs = cpu_to_le64(facs); But you also set up a FACS table. Hardware Reduced mode makes Linux ignore the FACS table. Please see upstream kernel commit commit 22e5b40ab21fcac21db0ff25fbb844ffecc73a4a Author: Bob Moore Date: Wed Nov 16 10:57:28 2011 +0800 ACPI 5.0: Implement hardware-reduced option You can probably drop the generation of the FACS, unless you intend to disable HW reduced mode. Thanks Laszlo