From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFYo1-0004U4-S2 for qemu-devel@nongnu.org; Sun, 25 Jan 2015 20:49:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFYny-0007Dl-MA for qemu-devel@nongnu.org; Sun, 25 Jan 2015 20:49:33 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:41415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFYny-00077t-2M for qemu-devel@nongnu.org; Sun, 25 Jan 2015 20:49:30 -0500 Message-ID: <54C59D0B.3030400@huawei.com> Date: Mon, 26 Jan 2015 09:48:59 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1422091280-14532-1-git-send-email-zhaoshenglong@huawei.com> <1422091280-14532-8-git-send-email-zhaoshenglong@huawei.com> <54C41714.7070809@redhat.com> In-Reply-To: <54C41714.7070809@redhat.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: Laszlo Ersek 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 On 2015/1/25 6:05, Laszlo Ersek wrote: > 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. > Ok, Thanks for pointing this out :-) I think we should drop the FACS to make it simple. Thanks, Shannon