From patchwork Tue Jul 5 03:12:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 71382 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp91596qgy; Mon, 4 Jul 2016 20:18:24 -0700 (PDT) X-Received: by 10.107.147.86 with SMTP id v83mr10902281iod.3.1467688703869; Mon, 04 Jul 2016 20:18:23 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id v17si1379100iov.11.2016.07.04.20.18.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 20:18:23 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKGoo-0008OK-CH; Tue, 05 Jul 2016 03:14:38 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKGon-0008MZ-0E for xen-devel@lists.xen.org; Tue, 05 Jul 2016 03:14:37 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id A7/2A-11548-C162B775; Tue, 05 Jul 2016 03:14:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRWlGSWpSXmKPExsVSPpHPUVdGrTr coPc3v8WSj4tZHBg9ju7+zRTAGMWamZeUX5HAmjHrJHfBZ56Kc+172BsY13N1MXJxCAmcYpTY sPckK4Szm1Fi4982ti5GTg42AV2JjxunsIPYIgKyEqu75oDZzAIfGCVOzZboYuTgEBawkzjyP xgkzCKgItG34QEjiM0r4CnRuuA0C4gtIaAhsbJ3ApjNCRT/ehPCFhLwkOg/sJ4Vol5Q4uTMJy wQ4yUkDr54wQzRqyjRtv4kG4QtKXFwxQ0WkDslQI5e+rCNCSJhKtGycjnTBEbBWUhmzUIyawE j0ypG9eLUorLUIl1DvaSizPSMktzEzBxdQwMzvdzU4uLE9NScxKRiveT83E2MwOBkAIIdjDuf Ox1ilORgUhLlffWvKlyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBK+oanW4kGBRanpqRVpmDjBOY NISHDxKIrxKIGne4oLE3OLMdIjUKUZFKXFeQZCEAEgiozQPrg0Wm5cYZaWEeRmBDhHiKUgtys 0sQZV/xSjOwagkzPtCBWgKT2ZeCdz0V0CLmYAWs8aWgywuSURISTUwJiyq/eD/jTW44vnd00Y pKkdK9/pmH+/Nv/1usq+e/Pe6ePH2LrddvTurvS99PjG/1qPYwE04+sVnu+5QdgGn+iO3c2qU l+8TWfF9r4ZVfDfX0RlRXh0zzvFcl/qzyeNP8CoZrh02a+/KfLK4bFjNP4Vx/2Quy1eLXr5Yp /TE/1LBnNcSq+YeVmIpzkg01GIuKk4EAOza2DbIAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1467688470!17859759!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26936 invoked from network); 5 Jul 2016 03:14:35 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 5 Jul 2016 03:14:35 -0000 Received: from 172.24.1.47 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DJT72006; Tue, 05 Jul 2016 11:14:13 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Tue, 5 Jul 2016 11:14:03 +0800 From: Shannon Zhao To: Date: Tue, 5 Jul 2016 11:12:42 +0800 Message-ID: <1467688367-17320-13-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1467688367-17320-1-git-send-email-zhaoshenglong@huawei.com> References: <1467688367-17320-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.577B2605.0063, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1b9e5b5221322cfb63a07338388e638d Cc: hangaohuai@huawei.com, sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v3 12/17] libxl/arm: Construct ACPI FADT table X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao Signed-off-by: Shannon Zhao --- tools/libxl/libxl_arm_acpi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c index 96ce605..6075391 100644 --- a/tools/libxl/libxl_arm_acpi.c +++ b/tools/libxl/libxl_arm_acpi.c @@ -279,6 +279,25 @@ static int make_acpi_madt(libxl__gc *gc, struct xc_dom_image *dom, int nr_cpus, return 0; } +static void make_acpi_fadt(libxl__gc *gc, struct xc_dom_image *dom, + struct acpitable acpitables[]) +{ + uint64_t offset = acpitables[FADT].addr - GUEST_ACPI_BASE; + struct acpi_table_fadt *fadt = dom->acpitable_blob + offset; + + /* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */ + fadt->flags = ACPI_FADT_HW_REDUCED; + fadt->arm_boot_flags = (ACPI_FADT_PSCI_COMPLIANT) | ACPI_FADT_PSCI_USE_HVC; + + /* ACPI v5.1 (fadt->revision.fadt->minor_revision) */ + fadt->minor_revision = 0x1; + fadt->dsdt = acpitables[DSDT].addr; + + make_acpi_header(&fadt->header, "FACP", acpitables[FADT].size, 5); + calculate_checksum(fadt, offsetof(struct acpi_table_header, checksum), + acpitables[FADT].size); +} + int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -311,6 +330,8 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, if (rc) return rc; + make_acpi_fadt(gc, dom, acpitables); + return 0; }