From patchwork Tue Nov 17 09:40:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56746 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1827589lbb; Tue, 17 Nov 2015 01:49:15 -0800 (PST) X-Received: by 10.31.4.210 with SMTP id 201mr2648417vke.11.1447753755535; Tue, 17 Nov 2015 01:49:15 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id b70si2030078vkf.94.2015.11.17.01.49.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Nov 2015 01:49:15 -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 1Zycrw-0007QL-05; Tue, 17 Nov 2015 09:48:08 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zycru-0007Ob-AM for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:48:06 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 39/33-12831-5D7FA465; Tue, 17 Nov 2015 09:48:05 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-5.tower-206.messagelabs.com!1447753685!4237957!1 X-Originating-IP: [74.125.82.42] 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 63563 invoked from network); 17 Nov 2015 09:48:05 -0000 Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com) (74.125.82.42) by server-5.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:48:05 -0000 Received: by wmww144 with SMTP id w144so17369408wmw.0 for ; Tue, 17 Nov 2015 01:48:05 -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=pz0+/OhjrgeW68ex1sY9LrV0w6++L/DEv7dnORucjw4=; b=1fA+k/PAeasZykePO2QfF9KEnVMHfAgZ9/lbtbEuagehBks/zH09Ol++qDmncl9RSj A3BO27IKP4TijUV/U4sVLN9YEvI9ps3NhGru/rZN+eNvD9g7Uby1GCQHpMMQ31fpgAYA gUbNpw+8cBYL5lG4wASLelUycP0C1a6QSupBVCwLHCoKvmqwdDbN+YZXPU8QZ3zxSXWW JiJj1ooCTeM9KQ00xT+Zxb3GYyDSD4bUkk1hF3qFhboowTwzEJMneo9aZP2hSKNCBy5+ owfrLvAecU/LpzIT98zxdF4ozv6AsAHxdp/BWDKI6pew6gLcOzHEoFBg86xRcQ5qRVGJ Kr9g== 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=pz0+/OhjrgeW68ex1sY9LrV0w6++L/DEv7dnORucjw4=; b=F+sa5ChzPhVNM8vYvo+hl8aiD+S6eCQ+opO/d5GEOTlWPxAf61pUPLzuOqDOKx8q/P KV4NaCQcow06z2qifC+cysm/4Le4R0I3hQYhy5AbGtcma6DaFKN0f5DJQ6v+166GU8SM wH5UCUC0Fao/NLPw/u81GsV/PeBFch0VfntTnbPtBqgOpOj09V5EHMNSmaQyO0HS+Yny VCrPSLawYOiXWzbPHwvmLXXu0106fW+k5xzS11LVNC4g7HX5PaO952/rLCFMbAHkz+oa huWoEelhaeluUqwjjP1Zfwu9htg38mtA5H1GRESlDsVtR0HWJmZXPru/SXy/O0O5MBid T0+Q== X-Gm-Message-State: ALoCoQkt0XNpAh0tPR3inHVu7oXxzmnU4udWKqV9cJQVIsWj653mqO6M02EQ1MKOQB1k4OGCVt/l X-Received: by 10.28.229.15 with SMTP id c15mr1538729wmh.76.1447753685024; Tue, 17 Nov 2015 01:48:05 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id q141sm23041535wmg.3.2015.11.17.01.48.03 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:48:04 -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:47 +0800 Message-Id: <1447753261-7552-49-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 48/62] arm/acpi: Prepare RSDP 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 Copy RSDP table and replace rsdp->xsdt_physical_address with new address of XSDT table, so it can point to the right XSDT table. Signed-off-by: Shannon Zhao --- xen/arch/arm/domain_build.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 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 894328f..6ae5761 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1359,6 +1359,38 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) #ifdef CONFIG_ACPI #define XEN_HYPERVISOR_ID 0x000058656E564D4D /* "XenVMM" */ +static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[]) +{ + + struct acpi_table_rsdp *rsdp = NULL; + u64 addr; + u64 table_size = sizeof(struct acpi_table_rsdp); + u8 *base_ptr; + u8 checksum; + + addr = acpi_os_get_root_pointer(); + if( !addr ) + panic("Unable to get acpi root pointer\n"); + + rsdp = acpi_os_map_memory(addr, table_size); + base_ptr = d->arch.efi_acpi_table + + acpi_get_table_offset(tbl_add, TBL_RSDP); + ACPI_MEMCPY(base_ptr, rsdp, table_size); + acpi_os_unmap_memory(rsdp, table_size); + + rsdp = (struct acpi_table_rsdp *)base_ptr; + /* Replace xsdt_physical_address */ + rsdp->xsdt_physical_address = tbl_add[TBL_XSDT].start; + checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, rsdp), table_size); + rsdp->checksum = rsdp->checksum - checksum; + + tbl_add[TBL_RSDP].start = d->arch.efi_acpi_gpa + + acpi_get_table_offset(tbl_add, TBL_RSDP); + tbl_add[TBL_RSDP].size = table_size; + + return 0; +} + static void acpi_xsdt_modify_entry(u64 entry[], unsigned long entry_count, char *signature, u64 addr) { @@ -1675,6 +1707,10 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + rc = acpi_create_rsdp(d, tbl_add); + if ( rc != 0 ) + return rc; + return 0; } #else