From patchwork Tue May 31 04:43:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 68865 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1727827qge; Mon, 30 May 2016 21:50:42 -0700 (PDT) X-Received: by 10.176.67.97 with SMTP id k88mr10408520uak.95.1464670242016; Mon, 30 May 2016 21:50:42 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 13si22887375vke.148.2016.05.30.21.50.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 21:50:42 -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 1b7bcT-0008Nm-KQ; Tue, 31 May 2016 04:49:33 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7bcS-0008NP-Pi for xen-devel@lists.xen.org; Tue, 31 May 2016 04:49:32 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id 87/DD-07247-CD71D475; Tue, 31 May 2016 04:49:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVSPpHPSfe2uG+ 4QddFVYslHxezODB6HN39mymAMYo1My8pvyKBNaNtbgNrwXPuiu9v9zM1MG7h7GLk4hASOMMo 8XzlA3YIZw+jxJMj51m6GDk52AR0JT5unMIOYosIyEqs7poDVsQssIlRou3LRbAiYQFrie0/1 wIlODhYBFQl2g+FgJi8Ap4Sb3viQCokBDQkVvZOAKvmBAqfn/iSGcQWEvCQ2LfsNCOIzSsgKH Fy5hOwGmYBCYmDL14wQ/QqSrStP8kGYUtKHFxxgwXkBAmBU4wSDTvboBKmElveHWaewCg4C8m sWUhmLWBkWsWoUZxaVJZapGtorJdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5hUrJecn7uJERig DECwg/HfNs9DjJIcTEqivFa/fcKF+JLyUyozEosz4otKc1KLDzHKcHAoSfC+EvUNFxIsSk1Pr UjLzAHGCkxagoNHSYTXQgwozVtckJhbnJkOkTrFqCglzrsbpE8AJJFRmgfXBovPS4yyUsK8jE CHCPEUpBblZpagyr9iFOdgVAKqABnPk5lXAjf9FdBiJqDF8Rk+IItLEhFSUg2MFXZ7imV45/B UBBQ1J65+6D9Te4duou47bZt7ScuSlhrInj4Y0Z6pmKH1bNn65XLdXnunnzM19vu5b5N20/PW lukpF9bcDRD8+HjJ86/mq390hNS93Knl9GVJ+60yZ/HU2quZc3SuK6zdqr332xq1ybMMPX+nX dd+ZdxxvdcoXHrfx3+6msdilFiKMxINtZiLihMBNzKDt8oCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1464670170!26329543!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17449 invoked from network); 31 May 2016 04:49:31 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-2.tower-206.messagelabs.com with SMTP; 31 May 2016 04:49:31 -0000 Received: from 172.24.1.137 (EHLO szxeml428-hub.china.huawei.com) ([172.24.1.137]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CCK66912; Tue, 31 May 2016 12:44:49 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.235.1; Tue, 31 May 2016 12:44:38 +0800 From: Shannon Zhao To: Date: Tue, 31 May 2016 12:43:31 +0800 Message-ID: <1464669816-11476-10-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1464669816-11476-1-git-send-email-zhaoshenglong@huawei.com> References: <1464669816-11476-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.0A020203.574D1715.002D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 40dc9290845e0d589abb171116d5615a Cc: sstabellini@kernel.org, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, wei.liu2@citrix.comg Subject: [Xen-devel] [PATCH 09/14] libxl/arm: Construct ACPI XSDT table 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 Signed-off-by: Shannon Zhao --- tools/libxl/libxl_arm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index f72f692..84ea8b6 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -1061,6 +1061,27 @@ static int make_acpi_madt(libxl__gc *gc, struct xc_dom_image *dom, int nr_cpus, return 0; } +static void make_acpi_xsdt(libxl__gc *gc, struct xc_dom_image *dom) +{ + uint32_t size; + struct acpi_xsdt_descriptor *xsdt; + + /* + * Currently only 3 tables(GTDT, FADT, MADT) are pointed by XSDT. Alloc + * entries for them but the entry values will be specified when they are + * copied to the guest memory. + */ + size = sizeof(*xsdt) + sizeof(uint64_t) * 3; + xsdt = libxl__zalloc(gc, size); + + make_acpi_header(&xsdt->header, "XSDT", size, 1); + + dom->acpitable_blob->xsdt.table = (void *)xsdt; + /* Align to 64bit. */ + dom->acpitable_blob->xsdt.size = size; + dom->acpitable_size += dom->acpitable_blob->xsdt.size; +} + static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -1089,6 +1110,8 @@ static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, if (rc) return rc; + make_acpi_xsdt(gc, dom); + return 0; }