From patchwork Fri Sep 2 02:55:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 75264 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp623758qga; Thu, 1 Sep 2016 19:58:47 -0700 (PDT) X-Received: by 10.157.7.137 with SMTP id 9mr19096231oto.108.1472785127420; Thu, 01 Sep 2016 19:58:47 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id b190si10080003oii.260.2016.09.01.19.58.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 19:58:47 -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 1bfeex-0006vz-6O; Fri, 02 Sep 2016 02:56:51 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfeew-0006ve-Ix for xen-devel@lists.xen.org; Fri, 02 Sep 2016 02:56:50 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 88/F2-12285-17AE8C75; Fri, 02 Sep 2016 02:56:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsVi9XuGg27hqxP hBkuXilos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBm/J91hLmgSqTh9dzdLA+Md/i5GLg4hgVOM EvcfLmSFcHYzSjS3nWLrYuTkYBPQlfi4cQo7iC0iICuxumsOO0gRs8B1Rok777exgiSEBUwkD rydA1bEIqAi0bLvKiOIzSvgKdG78TlYXEJAQ2Jl7wQWEJsTKP521SewuJCAh8TjV4+YIOoFJU 7OfAJWwywgIXHwxQtmiF5Fibb1J9kgbEmJgytusIAcIQFydtuBbSwQCVOJji2/2CcwCs5CMms WklkLGJlWMWoUpxaVpRbpGhnoJRVlpmeU5CZm5ugaGpjq5aYWFyemp+YkJhXrJefnbmIEBmk9 AwPjDsbG2X6HGCU5mJREefOfnAgX4kvKT6nMSCzOiC8qzUktPsQow8GhJMFr9BIoJ1iUmp5ak ZaZA4wXmLQEB4+SCO8KkDRvcUFibnFmOkTqFKOilDhvDkhCACSRUZoH1waL0UuMslLCvIwMDA xCPAWpRbmZJajyrxjFORiVhHl5QabwZOaVwE1/BbSYCWhxybXjIItLEhFSUg2Mpm3M+0p/fLh RNPPgvv6kP2rKGofctzVbvbpz9/liXcbat847fBtqPpeeTPhVmtd1Nz3gW/fy5R+sUnZsMH++ Rs9Hy/VZvEDRDoPZ1+rbNDdu/XQypPxhTojMkfZXGh1flN73nxf57jMl4r+o/e31Cd/fPNPdf rXvfWR0+J2HV/yqD5oZTZt/QImlOCPRUIu5qDgRABewrBLMAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1472785004!57270166!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 4890 invoked from network); 2 Sep 2016 02:56:48 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 2 Sep 2016 02:56:48 -0000 Received: from 172.24.1.60 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.60]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DQM36332; Fri, 02 Sep 2016 10:56:22 +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; Fri, 2 Sep 2016 10:56:10 +0800 From: Shannon Zhao To: Date: Fri, 2 Sep 2016 10:55:36 +0800 Message-ID: <1472784939-14404-14-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1472784939-14404-1-git-send-email-zhaoshenglong@huawei.com> References: <1472784939-14404-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.0A0B0203.57C8EA57.00A7, 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: c36d74e37deae25c395a9defa0897936 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 v5 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;