From patchwork Fri Mar 25 13:48:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8671681 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 8B526C0554 for ; Fri, 25 Mar 2016 13:51:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0F9A20373 for ; Fri, 25 Mar 2016 13:51:54 +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 C9149202E9 for ; Fri, 25 Mar 2016 13:51:53 +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 1ajS7w-0001gp-Gl; Fri, 25 Mar 2016 13:50:12 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajS7u-0001cO-Ue for xen-devel@lists.xen.org; Fri, 25 Mar 2016 13:50:11 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 5F/1F-25417-21245F65; Fri, 25 Mar 2016 13:50:10 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-13.tower-206.messagelabs.com!1458913808!31127236!1 X-Originating-IP: [209.85.192.180] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9066 invoked from network); 25 Mar 2016 13:50:09 -0000 Received: from mail-pf0-f180.google.com (HELO mail-pf0-f180.google.com) (209.85.192.180) by server-13.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Mar 2016 13:50:09 -0000 Received: by mail-pf0-f180.google.com with SMTP id u190so83487105pfb.3 for ; Fri, 25 Mar 2016 06:50:09 -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=FcRos7jNfiKtuppLLjBO6G0ALftwO+iqEKIF0+Exv2c=; b=GW2/zVjgpOJi7IuPF7G561Dxn2YNOUujLgjfAS6IUHcwyjECKzAtnIgkxT7HmQQmA0 36KgXSrrAPRaQeHvvUsvlNgyglzXN/HT+q6QZmGGWh9IRZKg+Td5kgHVafoP29g6hQ/o 54ItwUAXEwnJYqPGx6uTOGik3FpvstrPBOBxQ= 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=FcRos7jNfiKtuppLLjBO6G0ALftwO+iqEKIF0+Exv2c=; b=P8XvawEaemF0PYUgd3UUj0Q9fq2hotHOuRknnHyl3HcI8RJyYKbOv/XhLpFYtzeKs4 C36SprUYTrcsm3o2EFYNkf1rICkluoYYvpPieBdC4JCdSs1lGmoqdrhu8M3vx4dRB8Yo NQTC3mLI6LegbD4XRDf+8GrlL/qGTiNu98kSyKAsPc70LMlRqTuFIQQof7+4ao+TwXOW 6/k7EdG0VfdVB/sTUl+Fm3xQ/JnuAonMDTVB9dL74/YeS/0QPkMf5jhXLdZ2TCFiE8An E8N8PLiGhjQSwEmSwFPisciNdooXZGYvL0xcCCoN55P+eEui1ICLi0J4eDFFW5VzclOj /9IQ== X-Gm-Message-State: AD7BkJJvll7rvfrXYhUEk+OxqPw/W9V8a6isAhrctZYfh+c/Y+840bdYXXGceK9Vt8DlLFYu X-Received: by 10.98.10.147 with SMTP id 19mr21230783pfk.87.1458913808051; Fri, 25 Mar 2016 06:50:08 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.2]) by smtp.gmail.com with ESMTPSA id w20sm16744178pfi.31.2016.03.25.06.50.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 06:50:07 -0700 (PDT) From: Shannon Zhao To: xen-devel@lists.xen.org Date: Fri, 25 Mar 2016 21:48:46 +0800 Message-Id: <1458913735-2678-14-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 13/22] arm/acpi: Map the new created EFI and ACPI tables to 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 the UEFI and ACPI tables which we created to non-RAM space in Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- v7: flush the cache --- xen/arch/arm/domain_build.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 954e0e3..70c8421 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1723,6 +1723,25 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) acpi_create_efi_system_table(d, tbl_add); acpi_create_efi_mmap_table(d, &kinfo->mem, tbl_add); + /* Map the EFI and ACPI tables to Dom0 */ + rc = map_regions_rw_cache(d, + paddr_to_pfn(d->arch.efi_acpi_gpa), + PFN_UP(d->arch.efi_acpi_len), + paddr_to_pfn(virt_to_maddr(d->arch.efi_acpi_table))); + if ( rc != 0 ) + { + printk(XENLOG_ERR "Unable to map EFI/ACPI table 0x%"PRIx64 + " - 0x%"PRIx64" in domain %d\n", + d->arch.efi_acpi_gpa & PAGE_MASK, + PAGE_ALIGN(d->arch.efi_acpi_gpa + d->arch.efi_acpi_len) - 1, + d->domain_id); + return rc; + } + + /* Flush cache of this region in case Dom0 gets wrong data. */ + clean_and_invalidate_dcache_va_range(d->arch.efi_acpi_table, + d->arch.efi_acpi_len); + return 0; } #else