From patchwork Thu Sep 29 01:18:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 9355531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51A6B6077A for ; Thu, 29 Sep 2016 01:22:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B79928E6B for ; Thu, 29 Sep 2016 01:22:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 301D9296CB; Thu, 29 Sep 2016 01:22:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 95D2528E6B for ; Thu, 29 Sep 2016 01:22:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpQ0v-0001cE-Mi; Thu, 29 Sep 2016 01:19:53 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpQ0u-0001YR-Px for xen-devel@lists.xen.org; Thu, 29 Sep 2016 01:19:52 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 42/1B-21986-83C6CE75; Thu, 29 Sep 2016 01:19:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsVyMfSOtq55zpt wg3MrLC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1ozvX14yFrSJVNye/Iq9gfERfxcjJ4eQwERG iRPXg7sYuThYBOYxS+ze8psNxJEQ6GeV6P3dywJSJSEQI7H5yxVGCLtKor/rNRtEt5rEssMLm SHsJiaJ762yIDabgI7Ei0k7wWpEBKQlrn2+zAgylFngCKPErfkngRo4OIQFTCRW39IBqWERUJ Xo+7EZbBevgI3EzxmvofZqSkyf9RpsPidQ/EPLL6hd1hLLvm1mmcAosICRYRWjRnFqUVlqka6 RqV5SUWZ6RkluYmaOrqGBmV5uanFxYnpqTmJSsV5yfu4mRmBgMQDBDsZVCwIPMUpyMCmJ8nL6 vAkX4kvKT6nMSCzOiC8qzUktPsQow8GhJMF7JQsoJ1iUmp5akZaZAwxxmLQEB4+SCO8rkDRvc UFibnFmOkTqFKMxx5bf19YycWybem8tkxBLXn5eqpQ471WQUgGQ0ozSPLhBsNi7xCgrJczLCH SaEE9BalFuZgmq/CtGcQ5GJWHe1yBTeDLzSuD2vQI6hQnolKUnXoCcUpKIkJJqYIwq+lnb9C+ yar3CESWTvRbmXyLTImU0+c3d/oY83NY9RZS178Jce/b9gf9COnzXTnjx5GrAi/RFEm+YV+/V aOY/7Jki3nxLRkHu3ML/DlF7f+xnPv6mqHva0uvR7FcmbT0hrxPKr/Mid8lb/7mHxfq73Sadn 2J10+P3iuIDQrXbnrjwzFs8n02JpTgj0VCLuag4EQCU3Hx3uAIAAA== X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-14.tower-21.messagelabs.com!1475111990!30184277!1 X-Originating-IP: [209.85.220.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48309 invoked from network); 29 Sep 2016 01:19:51 -0000 Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by server-14.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 29 Sep 2016 01:19:51 -0000 Received: by mail-pa0-f43.google.com with SMTP id oz2so21905395pac.2 for ; Wed, 28 Sep 2016 18:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=od9aO6v79Oag0OuitnOzafZ1R6tvr8ZQgR+oPDRchuA=; b=U/QpVXqC9M1Cq60eH94KtZ0MTHbmswGU1l665JjX6cMcQH7CrdEkxNCqRFxF+rsb9T I20qwsEz7d6hTWnUGeHSgqTBvYT9Ks8looeXdCvX9AovAJYt4T1oY0zsixOPPh2KSx5l Pla7GihmoO+TbMx22/qh4An/nVzszjmaASmK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=od9aO6v79Oag0OuitnOzafZ1R6tvr8ZQgR+oPDRchuA=; b=ePcoi2TnWN1vdioAr4tW02SS3DVob8rUxV7LezI5nfT8jlCobl1pxmbcwUz8PHeTGE a0AaasNzlnTpJsRhuDD5KclcBr/9BQcS8wiymrjlfGhgflxgNYaoxEX4+w33mgcwRBD8 5SarjSqn2FtkuoxHkoqX3YLoafYlZmNlCVa+J1o25rrUKeya+k5nijzs6Un0aipDhtMe KdQwNrtMkp/SPQdJDZsS0Tr7Kw5vFOdeuS93aqw/xhqHh8HoVuugH8+gQgdaPkIqCgGc PgD2whryJew2cljIby0Hbk0tUCR+TeiRhD63AbfUjWYQEhtRPYIzi/Dns/3l1Y/gEtS2 R8dw== X-Gm-Message-State: AA6/9Rl9wVS/hEIgaGdJ3lDrVIkQ7Jo3boDpJqSLFHjXsMrr2tqgR8NOc3ePBRuWjY9gMAcD X-Received: by 10.66.246.13 with SMTP id xs13mr52753057pac.57.1475111990396; Wed, 28 Sep 2016 18:19:50 -0700 (PDT) Received: from HZA160860128-A.china.huawei.com ([67.238.99.186]) by smtp.gmail.com with ESMTPSA id wd7sm15228744pab.2.2016.09.28.18.19.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Sep 2016 18:19:49 -0700 (PDT) From: Shannon Zhao To: xen-devel@lists.xen.org Date: Wed, 28 Sep 2016 18:18:59 -0700 Message-Id: <20160929011902.7784-14-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.10.0.windows.1 In-Reply-To: <20160929011902.7784-1-shannon.zhao@linaro.org> References: <20160929011902.7784-1-shannon.zhao@linaro.org> Cc: sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, julien.grall@arm.com, Shannon Zhao , zhaoshenglong@huawei.com, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v8 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Wei Liu --- 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 19d3067..376307e 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;