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: 64482 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp183623lbc; Fri, 25 Mar 2016 06:51:39 -0700 (PDT) X-Received: by 10.55.203.200 with SMTP id u69mr17464633qkl.51.1458913879689; Fri, 25 Mar 2016 06:51:19 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f195si10765566qhf.83.2016.03.25.06.51.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Mar 2016 06:51:19 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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 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" 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