From patchwork Thu Sep 22 12:52:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 76789 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp16285qgf; Thu, 22 Sep 2016 05:59:08 -0700 (PDT) X-Received: by 10.107.6.200 with SMTP id f69mr2493948ioi.211.1474549148639; Thu, 22 Sep 2016 05:59:08 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 188si1826064iob.137.2016.09.22.05.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 05:59:08 -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 1bn3Z1-0005r1-PV; Thu, 22 Sep 2016 12:57:19 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn3Z1-0005qn-F2 for xen-devel@lists.xen.org; Thu, 22 Sep 2016 12:57:19 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id C4/A8-13744-E25D3E75; Thu, 22 Sep 2016 12:57:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVi9XuGg67e1cf hBguu8Fos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBm/J91hLmgSqTh9dzdLA+Md/i5GLg4hgVOM Euff/mSEcPYwSsw6OIeli5GTg01AS+L89B/sILaIgKzE6q457CBFzALXGSXuvN/GCpIQFjCR6 P65jg3EZhFQlZj9cRVzFyMHB6+Ap8TWdhOQsISAhsTK3glgMzmBwhOOrAdrFRLwkFh5ZSGYzS sgKHFy5hOwGmYBCYmDL14wQ/QqSrStP8kGYUtKHFxxgwXkBgmQqy/9m8gEkTCVWHzqB9sERsF ZSGbNQjJrASPTKkb14tSistQiXWO9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYzA AGUAgh2MHf+cDjFKcjApifJe6H8cLsSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mC9+5loJxgUWp6a kVaZg4wVmDSEhw8SiK8xSBp3uKCxNzizHSI1ClGRSlx3jqQhABIIqM0D64NFp+XGGWlhHkZgQ 4R4ilILcrNLEGVf8UozsGoJMx7DGQKT2ZeCdz0V0CLmYAWb/n5AGRxSSJCSqqBMZVj8o9Xr/7 uO2yXs7Ag+VWuarwdw0Wp1vc+uU0TJBkqnEo+HFAwlf+vXdNaEHDedZLkEcaNPzq8+bvTGQov aO6a8JZ9x6zCvsXmdYFvSiZXW+l7NLbyTDMJ/ZNs4HYk+GfQsh1u87Re7Qp78Zlr/dOSarWgb wz1hbPuF57I7J/dXCMkfIlViaU4I9FQi7moOBEAWaXLfcoCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1474549029!60852073!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 25480 invoked from network); 22 Sep 2016 12:57:17 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 22 Sep 2016 12:57:17 -0000 Received: from 172.24.1.36 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.36]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DRK49279; Thu, 22 Sep 2016 20:53:11 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Thu, 22 Sep 2016 20:52:59 +0800 From: z00226004 To: Date: Thu, 22 Sep 2016 20:52:30 +0800 Message-ID: <1474548753-12596-14-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1474548753-12596-1-git-send-email-zhaoshenglong@huawei.com> References: <1474548753-12596-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.0A020205.57E3D439.0103, 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: 465a6ea46185b2f2ffd7366758f7bd79 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 v6 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 f7f2c60..6f0bc70 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; @@ -975,6 +994,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;