From patchwork Thu Jun 23 03:17:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 70722 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp217374qgy; Wed, 22 Jun 2016 20:20:56 -0700 (PDT) X-Received: by 10.107.7.228 with SMTP id g97mr42958141ioi.64.1466652054081; Wed, 22 Jun 2016 20:20:54 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z10si2969726itc.91.2016.06.22.20.20.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 20:20:54 -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 1bFvAX-0000nv-1k; Thu, 23 Jun 2016 03:19:05 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFvAV-0000mp-46 for xen-devel@lists.xen.org; Thu, 23 Jun 2016 03:19:03 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id 7D/70-01707-6255B675; Thu, 23 Jun 2016 03:19:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVi9XuGg65KaHa 4wYrLUhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aiLw0sBb+EKnae+8TewPiEr4uRk0NI4BSj xKETQl2MXED2HkaJu9e2soIk2AR0JT5unMIOYosIyEqs7prDDlLELHCdUeLO+21gRcICJhIrT s4EK2IRUJVo6f7MBGLzCnhIPN8MUSMhoCGxsncCC4jNCRQ/OesJM8Rmd4k5a/ayQNQLSpyc+Q TMZhaQkDj44gUzRK+iRNv6k2wQtqTEwRU3WECOkAC5+tTi/UBFHECOqcT9S6oTGAVnIRk1C8m oBYxMqxg1ilOLylKLdA3N9JKKMtMzSnITM3N0DQ1N9HJTi4sT01NzEpOK9ZLzczcxAgO0noGB cQfj19OehxglOZiURHkV72eFC/El5adUZiQWZ8QXleakFh9ilOHgUJLg1dDMDhcSLEpNT61Iy 8wBxgpMWoKDR0mElwUkzVtckJhbnJkOkTrFqCglzisPkhAASWSU5sG1weLzEqOslDAvIwMDgx BPQWpRbmYJqvwrRnEORiVhXm+QKTyZeSVw018BLWYCWrysPx1kcUkiQkqqgXHa1u1evTorly1 NOh+++8NDPoOeYPtgL93bu7SmG+ScblomN8/42+kq89qGZx56qibh4hffvFSdK5bySC2LexVD 69yHh+/WXb/2Z2qLqf2Ejw6XPG5f7JT9bcU6S/FR3LfK95KFDxy55C5vffxeJM30ye2Kd/PvX 1L8miVXdqIorZ7nmavZnkYlluKMREMt5qLiRABOY9IkygIAAA== X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1466651919!49363184!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 38231 invoked from network); 23 Jun 2016 03:18:56 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jun 2016 03:18:56 -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 DMQ09551; Thu, 23 Jun 2016 11:17:46 +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:36 +0800 From: Shannon Zhao To: Date: Thu, 23 Jun 2016 11:17:02 +0800 Message-ID: <1466651824-6964-16-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.0A020201.576B54E0.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: b2b0a6a8f6424e054b566f837bba465b 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 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 | 23 +++++++++++++++++++++++ tools/libxl/libxl_arm.c | 24 ++++++++++++++++++++++++ 2 files changed, 47 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..c39c4d0 --- /dev/null +++ b/docs/misc/arm/device-tree/acpi.txt @@ -0,0 +1,23 @@ +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. + +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 97958ed..240a215 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -288,6 +288,25 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk, if (res) return res; } + if (state->config.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; @@ -973,6 +992,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;