From patchwork Thu Jun 23 03:16:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 70721 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp217368qgy; Wed, 22 Jun 2016 20:20:54 -0700 (PDT) X-Received: by 10.36.133.197 with SMTP id r188mr18400940itd.43.1466652042797; Wed, 22 Jun 2016 20:20:42 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j135si3066254itj.27.2016.06.22.20.20.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 20:20:42 -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 1bFvAQ-0000kF-Pb; Thu, 23 Jun 2016 03:18:58 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFvAP-0000jL-5G for xen-devel@lists.xen.org; Thu, 23 Jun 2016 03:18:57 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id CC/9A-23871-0255B675; Thu, 23 Jun 2016 03:18:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVi9XuGg658aHa 4Qds3fYslHxezODB6HN39mymAMYo1My8pvyKBNeP/zE6mgjaeijP7G1kaGJ9ydjFycggJnGKU WPvLpIuRC8jewyjx8sw1dpAEm4CuxMeNU8BsEQFZidVdc9hBipgFrjNK3Hm/jRUkISxgJ/Hx+ D1mEJtFQFXi/su9bCA2r4CHxMd9zWA1EgIaEit7J7CA2JxA8ZOznjBDbHaXmLNmLwtEvaDEyZ lPwGxmAQmJgy9eMEP0Kkq0rT/JBmFLShxccYMF5AgJkKufH2yFKjKVmHd1HeMERsFZSGbNQjJ rASPTKkb14tSistQiXVO9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK95PzcTYzAAK1nYGDc wXj5q9MhRkkOJiVRXiuH7HAhvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErzHgoFygkWp6akVaZk5w FiBSUtw8CiJ8DqHAKV5iwsSc4sz0yFSpxgVpcR5D4H0CYAkMkrz4Npg8XmJUVZKmJeRgYFBiK cgtSg3swRV/hWjOAejkjDvWpApPJl5JXDTXwEtZgJavKw/HWRxSSJCSqqBce6SZeK5ty3XWn5 dkzqdNcucWfDlHDMlA/3PveXv/c+rK3/hL9g5+2zNQY5KgyvbNSQ+PC1vnnQze+Ic3bhOxvba j5tK8itql7sYHZ+wfZtyenOVysej/q0TmH6fCM4rzE05MWPXjjm3596K0hNYXJB5aOW0fSs5y +9nTQ0/ZbnruEeu6Jwjy5RYijMSDbWYi4oTAQt4S3zKAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1466651902!20483234!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39321 invoked from network); 23 Jun 2016 03:18:54 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jun 2016 03:18:54 -0000 Received: from 172.24.1.36 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.36]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DMQ09538; Thu, 23 Jun 2016 11:17:44 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Thu, 23 Jun 2016 11:17:32 +0800 From: Shannon Zhao To: Date: Thu, 23 Jun 2016 11:16:57 +0800 Message-ID: <1466651824-6964-11-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1466651824-6964-1-git-send-email-zhaoshenglong@huawei.com> References: <1466651824-6964-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.576B54D8.0197, 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: d8d6d12160dcb23922aceb5201870438 Cc: 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 v2 10/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 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c index 659dbfa..353d774 100644 --- a/tools/libxl/libxl_arm_acpi.c +++ b/tools/libxl/libxl_arm_acpi.c @@ -234,6 +234,28 @@ 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 acpi_table_fadt *fadt; + size_t size = sizeof(*fadt); + + fadt = libxl__zalloc(gc, size); + + /* 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; + + make_acpi_header(&fadt->header, "FACP", size, 5); + + acpitables[FADT].table = fadt; + acpitables[FADT].size = size; + /* Align to 64bit. */ + dom->acpitable_size += ROUNDUP(acpitables[FADT].size, 3); +} + int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -261,6 +283,8 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, if (rc) return rc; + make_acpi_fadt(gc, dom); + return 0; }