From patchwork Tue Nov 17 09:40:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56744 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1827460lbb; Tue, 17 Nov 2015 01:48:55 -0800 (PST) X-Received: by 10.140.101.41 with SMTP id t38mr32855599qge.53.1447753735681; Tue, 17 Nov 2015 01:48:55 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id a141si13705382qkb.16.2015.11.17.01.48.55 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:48:55 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZycrX-00073Z-CV; Tue, 17 Nov 2015 09:47:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZycrW-00072E-5a for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:47:42 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 40/AF-01748-DB7FA465; Tue, 17 Nov 2015 09:47:41 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-9.tower-31.messagelabs.com!1447753660!1043826!1 X-Originating-IP: [74.125.82.47] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43966 invoked from network); 17 Nov 2015 09:47:40 -0000 Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:47:40 -0000 Received: by wmww144 with SMTP id w144so17355060wmw.0 for ; Tue, 17 Nov 2015 01:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lPjKI6nRhP1/vOQU6mKT/lKBl0ybQ3f9rkk7ACHYvkY=; b=kBWgVKEPlaMxm6TJJxTBrC1q9T5xQRsa2ZvCyHFTcoVGKA3e0rdGhnShTLftJBZmGe pgx4SvnUCvU0qM9+abCxXr4PgqVY1lAsNNmjwLHj5NguRThiJjn9O6lDn9ZXcIk3e3WY xS8pRCGOxHX86EqcmAQnrVDdLD6wzDLGvmRby0MjT6OUwSoP26TaeDd6QcymwKinbuiM s4GpQbsSNKxtMbvMphppVF2/CUEkytYDO+ruKrvgZeN5f0rvzqGhmyYO32R2YWZlq/58 ZulJn+RLVk0nMYncJJACLLY7ESebez/25K4WrVsDEtaqnY8OtLZ83VqxiClc51eL3oMs kGnQ== 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=lPjKI6nRhP1/vOQU6mKT/lKBl0ybQ3f9rkk7ACHYvkY=; b=lLyQAHyJpvFga7B7MKi50wNpfC+5Sttip/Qb6JvhDMEK378YVsPUYmhW8V3YPjw+64 i94iWAED3/E0sIyB+XWZDHLn6awVRzqdS7znmylPahVqB1uWAZNdBOTMOiFdE6a7TfDR wxVmbYmZOc9k0iYpiXkeHeKeZuaemSEXUmsAWFwlniaoHCSSoKBAs7dNf9Hy4POvYPS+ 3SMx9U7xP4K4cEDY2mUqYBtXjBD1JBU87GGDi8T4gsBv+3FLHZ60uKWB9oerNzwEo33P KE8MgpK8Uz7Tp4E062lzhtgBKU+B3LJm07GE7zof4yLnJ79pG6WjSKtaz9XYbtrfL2XK BMpQ== X-Gm-Message-State: ALoCoQkmjQbnJp7ZJLd9NLn0b9xym/OfDMKh+EnQGo/P9uPoB9VfzGHRHmJpV1noZMJtVKsDdHJ4 X-Received: by 10.28.139.18 with SMTP id n18mr1538044wmd.63.1447753660558; Tue, 17 Nov 2015 01:47:40 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id ft4sm38918365wjb.37.2015.11.17.01.47.38 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:47:39 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Date: Tue, 17 Nov 2015 17:40:44 +0800 Message-Id: <1447753261-7552-46-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v3 45/62] arm/acpi: Prepare STAO table for Dom0 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org From: Shannon Zhao Create STAO table for Dom0. This table is used to tell Dom0 whether it should ignore UART defined in SPCR table or the ACPI namespace names. Look at below url for details: http://wiki.xenproject.org/mediawiki/images/0/02/Status-override-table.pdf Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao --- xen/arch/arm/domain_build.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 4591955..fb3f150 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1359,6 +1359,45 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) #ifdef CONFIG_ACPI #define XEN_HYPERVISOR_ID 0x000058656E564D4D /* "XenVMM" */ +static int acpi_create_stao(struct domain *d, struct membank tbl_add[]) +{ + struct acpi_table_header *table = NULL; + struct acpi_table_stao *stao = NULL; + u64 table_size = sizeof(struct acpi_table_stao); + acpi_status status; + u8 *base_ptr; + u8 checksum; + + status = acpi_get_table(ACPI_SIG_MADT, 0, &table); + + if ( ACPI_FAILURE(status) ) + { + const char *msg = acpi_format_exception(status); + + printk("Failed to get MADT table, %s\n", msg); + return -EINVAL; + } + + base_ptr = d->arch.efi_acpi_table + + acpi_get_table_offset(tbl_add, TBL_STAO); + /* Copy header of one table, here use MADT */ + ACPI_MEMCPY(base_ptr, table, sizeof(struct acpi_table_header)); + stao = (struct acpi_table_stao *)base_ptr; + + ACPI_MEMCPY(stao->header.signature, ACPI_SIG_STAO, 4); + stao->header.revision = 1; + stao->header.length = table_size; + stao->ignore_uart = 1; + checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, stao), table_size); + stao->header.checksum = stao->header.checksum - checksum; + + tbl_add[TBL_STAO].start = d->arch.efi_acpi_gpa + + acpi_get_table_offset(tbl_add, TBL_STAO); + tbl_add[TBL_STAO].size = table_size; + + return 0; +} + static int acpi_create_madt(struct domain *d, struct membank tbl_add[]) { struct acpi_table_header *table = NULL; @@ -1561,6 +1600,10 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + rc = acpi_create_stao(d, tbl_add); + if ( rc != 0 ) + return rc; + return 0; } #else