From patchwork Fri Mar 25 13:48:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8671691 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BC8DC0553 for ; Fri, 25 Mar 2016 13:51:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78D4C20340 for ; Fri, 25 Mar 2016 13:51:55 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 4F4972035B for ; Fri, 25 Mar 2016 13:51:54 +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 1ajS7j-0001MH-K2; Fri, 25 Mar 2016 13:49:59 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajS7i-0001KY-0n for xen-devel@lists.xen.org; Fri, 25 Mar 2016 13:49:58 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id C9/D4-07120-50245F65; Fri, 25 Mar 2016 13:49:57 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-3.tower-21.messagelabs.com!1458913795!5381471!1 X-Originating-IP: [209.85.220.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51420 invoked from network); 25 Mar 2016 13:49:56 -0000 Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by server-3.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Mar 2016 13:49:56 -0000 Received: by mail-pa0-f49.google.com with SMTP id fe3so46938324pab.1 for ; Fri, 25 Mar 2016 06:49:56 -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=RtOb82EwvOzQRT5wgGE8u8qL1UMotag4vNPs/15536A=; b=CyToajKv+RqA+oigzfV/C8B2DL5PTp2oKUBT+k4RcLuhHhSuP9WyQk0COUimcsytam vGVk7jhG9ZYB/zfSNj936YqUaUXes3dnOmCOzsM9Y98B4nwaGFoi5GszHqC8O8icrCsL 4Ke0fwLVWJAGFaHa+0Twtwk6iEBCCubO/DDaM= 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=RtOb82EwvOzQRT5wgGE8u8qL1UMotag4vNPs/15536A=; b=Cg2ZqsHBtVqEkhU6nfIsR3WbqMQfCru8SBtlXamGZPNeVZJv21EV747SK11dQZzIwV 8+xCzhmZpQ1ACGn3lDKWZ9zVcYEz28Dof9g49YE32HT6c5kCa59AXB1wGlcJ8ZHglzD1 Y5OS7ZKvE1IBT6ySwVUkxX4vJdVq7+WUlnVkhb1tE387vLE4kodqHPxb3haCLiyv8raG vv+L8EEYME0CXCUgh8/xVIVWYJTMHogxzlu0vKSr5ctMJlz3r46YP2NjWzIihPLT5nm0 G7n44gk9ZIvFGBmzrdgtZaSgYlMuRXHQGXWr1Pajgtba6CLs2SRHL2dhrv6ymtX2ul0s c5uw== X-Gm-Message-State: AD7BkJIt05JUxRtJ/l7qsxDgvDMjr7toJHzcAeV924zmDGuPOipd90PgugEmlN7WF9qQs+B8 X-Received: by 10.66.193.202 with SMTP id hq10mr20762247pac.6.1458913795271; Fri, 25 Mar 2016 06:49:55 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.2]) by smtp.gmail.com with ESMTPSA id w20sm16744178pfi.31.2016.03.25.06.49.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 06:49:54 -0700 (PDT) From: Shannon Zhao To: xen-devel@lists.xen.org Date: Fri, 25 Mar 2016 21:48:43 +0800 Message-Id: <1458913735-2678-11-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458913735-2678-1-git-send-email-shannon.zhao@linaro.org> References: <1458913735-2678-1-git-send-email-shannon.zhao@linaro.org> Cc: julien.grall@arm.com, shannon.zhao@linaro.org, stefano.stabellini@citrix.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Xen-devel] [PATCH v7 10/22] arm/acpi: Map all other tables for Dom0 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Map all other ACPI tables into Dom0 using 1:1 mappings. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- v7: Fix comments and printk log --- xen/arch/arm/domain_build.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index eeb1359..1bfb2fc 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1357,6 +1357,30 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) } #ifdef CONFIG_ACPI +static void acpi_map_other_tables(struct domain *d) +{ + int i; + unsigned long res; + u64 addr, size; + + /* Map all ACPI tables to Dom0 using 1:1 mappings. */ + for( i = 0; i < acpi_gbl_root_table_list.count; i++ ) + { + addr = acpi_gbl_root_table_list.tables[i].address; + size = acpi_gbl_root_table_list.tables[i].length; + res = map_regions_rw_cache(d, + paddr_to_pfn(addr & PAGE_MASK), + DIV_ROUND_UP(size, PAGE_SIZE), + paddr_to_pfn(addr & PAGE_MASK)); + if ( res ) + { + panic(XENLOG_ERR "Unable to map ACPI region 0x%"PRIx64 + " - 0x%"PRIx64" in domain \n", + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1); + } + } +} + static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[]) { @@ -1695,6 +1719,8 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + acpi_map_other_tables(d); + return 0; } #else