From patchwork Tue Aug 16 10:25:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 74002 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1919688qga; Tue, 16 Aug 2016 03:32:21 -0700 (PDT) X-Received: by 10.36.210.68 with SMTP id z65mr2179937itf.32.1471343535160; Tue, 16 Aug 2016 03:32:15 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z15si21304996ita.28.2016.08.16.03.32.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 03:32:15 -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 1bZbdW-0003DZ-L8; Tue, 16 Aug 2016 10:30:22 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZbdU-0003C1-Sp for xen-devel@lists.xen.org; Tue, 16 Aug 2016 10:30:20 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id C9/C7-05661-C3BE2B75; Tue, 16 Aug 2016 10:30:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVi9XuGg671603 hBvd+Klgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlLWhIKrghXfLv9l7GBcRN/FyMXh5DAKUaJ JU2zmCCcPYwSH36sY+1i5ORgE9CV+LhxCjuILSIgK7G6aw47SBGzwHVGiTvvt4EVCQuYSCxZd psJxGYRUJV43baLDcTmFfCUOPDzAQuILSGgIbGydwKQzcHBCRS/NgWsREjAQ+L0zIWsEOWCEi dnPgErZxaQkDj44gUzRKuiRNv6k2wQtqTEwRU3WEBukAC5esOXe+wQCVOJhge7WScwCs5CMms WklkLGJlWMWoUpxaVpRbpGhnqJRVlpmeU5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEBigD EOxg/LMs4BCjJAeTkijvzIkbw4X4kvJTKjMSizPii0pzUosPMcpwcChJ8N58uSlcSLAoNT21I i0zBxgrMGkJDh4lEd7VIGne4oLE3OLMdIjUKUZFKXHeBSAJAZBERmkeXBssPi8xykoJ8zICHS LEU5BalJtZgir/ilGcg1FJmHc9yBSezLwSuOmvgBYzAS3Wl94AsrgkESEl1cC4JOng/FO1kSc 3dn9/LSvzST3ww5sFz8Q/iCa+ePBz0oZmJ8u5b6S2x7Za2q560bJs8YW5CsGLjZbl6S+9dqVy ffjbmx/VK/Zv/zP5aOlSyfXV8p9mPnIo+1S0rSrZf0bs8nUvVW90GfqJCl/f0bb8Vv/PVzdOP dydrpKUFsC2+PBUtSvdT8S3OSixFGckGmoxFxUnAgCIqZyTygIAAA== X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1471343412!53330836!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.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3556 invoked from network); 16 Aug 2016 10:30:18 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Aug 2016 10:30:18 -0000 Received: from 172.24.1.36 (EHLO szxeml434-hub.china.huawei.com) ([172.24.1.36]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DPP02659; Tue, 16 Aug 2016 18:26:21 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.235.1; Tue, 16 Aug 2016 18:25:41 +0800 From: Shannon Zhao To: Date: Tue, 16 Aug 2016 18:25:10 +0800 Message-ID: <1471343113-10652-14-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1471343113-10652-1-git-send-email-zhaoshenglong@huawei.com> References: <1471343113-10652-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.0A090201.57B2EA4E.0083, 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: 7cf40b3ec5152d608af0e45511dfc8e8 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 v4 13/16] libxl/arm: Add ACPI module 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 Add the ARM Multiboot module for ACPI, so UEFI or DomU can get the base address of ACPI tables from it. Signed-off-by: Shannon Zhao Acked-by: Julien Grall --- docs/misc/arm/device-tree/acpi.txt | 24 ++++++++++++++++++++++++ tools/libxl/libxl_arm.c | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 docs/misc/arm/device-tree/acpi.txt diff --git a/docs/misc/arm/device-tree/acpi.txt b/docs/misc/arm/device-tree/acpi.txt new file mode 100644 index 0000000..3e70157 --- /dev/null +++ b/docs/misc/arm/device-tree/acpi.txt @@ -0,0 +1,24 @@ +DomU ACPI module +================================ + +Xen toolstack passes the domU ACPI tables via a reference in the /chosen node of +the device tree. + +Each node contains the following properties: + +- compatible + + "xen,guest-acpi", "multiboot,module" + +- reg + + Specifies the physical address and the length of the module. + RSDP table is always located at the beginning of this region. + +Examples +======== + + module@0x20000000 { + compatible = "xen,guest-acpi", "multiboot,module"; + reg = <0x20000000 0x1234>; + }; diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index b95fdf5..11a6f6e 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -285,6 +285,25 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk, if (res) return res; } + if (libxl_defbool_val(info->acpi)) { + const uint64_t acpi_base = GUEST_ACPI_BASE; + const char *name = GCSPRINTF("module@%"PRIx64, acpi_base); + + res = fdt_begin_node(fdt, name); + if (res) return res; + + res = fdt_property_compat(gc, fdt, 2, "xen,guest-acpi", + "multiboot,module"); + if (res) return res; + + res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS, + 1, 0, 0); + if (res) return res; + + res = fdt_end_node(fdt); + if (res) return res; + } + res = fdt_end_node(fdt); if (res) return res; @@ -974,6 +993,11 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc *gc, finalise_one_node(gc, fdt, "/memory", bankbase[i], size); } + if (dom->acpi_modules[0].data) { + finalise_one_node(gc, fdt, "/chosen/module", GUEST_ACPI_BASE, + dom->acpi_modules[0].length); + } + debug_dump_fdt(gc, fdt); return 0;