From patchwork Tue Jul 5 03:12:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 71378 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp91365qgy; Mon, 4 Jul 2016 20:17:25 -0700 (PDT) X-Received: by 10.36.43.216 with SMTP id h207mr12182390ita.66.1467688641418; Mon, 04 Jul 2016 20:17:21 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id c90si1405615ioa.243.2016.07.04.20.17.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 20:17:21 -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 1bKGpF-0000JF-29; Tue, 05 Jul 2016 03:15:05 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKGpD-0000Hf-Ss for xen-devel@lists.xen.org; Tue, 05 Jul 2016 03:15:03 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 0B/03-32245-7362B775; Tue, 05 Jul 2016 03:15:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVSPpHPUddMrTr c4Mp1FYslHxezODB6HN39mymAMYo1My8pvyKBNWPbD7uC88IVr5YnNDCu5e9i5OIQEjjFKLF/ 3Xk2CGc3o8SNn/OZuhg5OdgEdCU+bpzCDmKLCMhKrO6aA2YzC3xglDg1WwLEFhYwkZi++QIji M0ioCIx+91MsF5eAU+JzqVP2UBsCQENiZW9E1hAbE6g+NebELaQgIdE/4H1rBD1ghInZz5hgZ gvIXHwxQtmiF5Fibb1J6HmSEocXHGDBeRQCZCr5z6ZzQKRMJWY3HeZeQKj4Cwks2YhmbWAkWk Vo0ZxalFZapGusYFeUlFmekZJbmJmjq6hgbFebmpxcWJ6ak5iUrFecn7uJkZgeNYzMDDuYOw8 4XeIUZKDSUmU99W/qnAhvqT8lMqMxOKM+KLSnNTiQ4wyHBxKEryiqtXhQoJFqempFWmZOcBIg UlLcPAoifAqgaR5iwsSc4sz0yFSpxgVpcR5BUESAiCJjNI8uDZYdF5ilJUS5mVkYGAQ4ilILc rNLEGVf8UozsGoJMybCDKFJzOvBG76K6DFTECLWWPLQRaXJCKkpBoYNV6KnbrbOH/3WYG1Kqu kA0QsexbtuT+llcF4kc6DaadPX90tvqb5zESpaZIXrpdv2GSea/T19J17bsVClvO8Awx7Xvz4 9Chf17xPMqFwm/SMHd5c8rsjV3NPTOHTtWU6JNNSFLxzheKcnyFV7Q/uvvVV4o9c2RrwvczxK tel4xyPgl65H3wkqMRSnJFoqMVcVJwIAJNVlr7JAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1467688495!45686462!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 33344 invoked from network); 5 Jul 2016 03:15:01 -0000 Received: from unknown (HELO szxga02-in.huawei.com) (119.145.14.65) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 5 Jul 2016 03:15:01 -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 DJT72007; 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:06 +0800 From: Shannon Zhao To: Date: Tue, 5 Jul 2016 11:12:45 +0800 Message-ID: <1467688367-17320-16-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.0A020205.577B2605.0096, 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: ef185f5959c6b1a5a65b142bc798a80e 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 15/17] 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 --- 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 6820fd4..bc38318 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->arch_arm.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; @@ -970,6 +989,11 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc *gc, finalise_one_node(gc, fdt, "/memory", bankbase[i], size); } + if (dom->acpitable_blob) { + finalise_one_node(gc, fdt, "/chosen/module", GUEST_ACPI_BASE, + dom->acpitable_size); + } + debug_dump_fdt(gc, fdt); return 0;