From patchwork Wed Feb 4 14:02:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 44360 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D8B02029F for ; Wed, 4 Feb 2015 14:06:48 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id h11sf2488804wiw.1 for ; Wed, 04 Feb 2015 06:06:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=rh76/HBphzc1GYXDRwB+aMfZVXZWj/AyaLTWnizK6oQ=; b=AR1HpubFQxCb1YPYeKT3RLOoKF/HbdXKW4TP/KpY5OZRyozm8/RwNE9QNebAaDee9C KtvasR9ycF7AZML25t+Gq/5gcy+7p0YTxr3P80Cx59ctBqZqTD8/5S5XqDPxA4MIwB5K Zief2BCHBIOQ/3EiQUc2w8rUo7W5FMGQ7qBnwNeOM9xWZfhMn7Eo19MJf5gyltEDEs4R /vWx37qLBf30pMKPfcfIb24IOIqB1WQ4yguq3wTtfOpIO0Y9BJeYx0cJ82oiMyEFtFEa FDihPcNiomi/1acDLpwkcEhvDbLo6lp8ykkDwSS6VaT3nqHzWtM32wzCtZYbgcgNSiBK aY2Q== X-Gm-Message-State: ALoCoQlpOsQWwa6T5AB6z/fDpvkP2WLMe9lZbJrZICIpTiuPuGSOGOYwCPuISLvadw70uHdIIOcW X-Received: by 10.180.80.7 with SMTP id n7mr2752186wix.0.1423058807432; Wed, 04 Feb 2015 06:06:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.232 with SMTP id t8ls34978laj.100.gmail; Wed, 04 Feb 2015 06:06:47 -0800 (PST) X-Received: by 10.112.144.136 with SMTP id sm8mr3314074lbb.95.1423058807207; Wed, 04 Feb 2015 06:06:47 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id u14si1403926laz.93.2015.02.04.06.06.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 06:06:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gd6so1716280lab.4 for ; Wed, 04 Feb 2015 06:06:47 -0800 (PST) X-Received: by 10.152.8.1 with SMTP id n1mr29614857laa.47.1423058807124; Wed, 04 Feb 2015 06:06:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp507914lbj; Wed, 4 Feb 2015 06:06:46 -0800 (PST) X-Received: by 10.236.61.17 with SMTP id v17mr12498661yhc.96.1423058800744; Wed, 04 Feb 2015 06:06:40 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id u32si517382yhp.95.2015.02.04.06.06.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 06:06:40 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0aT-0008VM-PI; Wed, 04 Feb 2015 14:05:49 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0aT-0008UN-B7 for xen-devel@lists.xen.org; Wed, 04 Feb 2015 14:05:49 +0000 Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id 46/EC-02777-C3722D45; Wed, 04 Feb 2015 14:05:48 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1423058746!12730637!1 X-Originating-IP: [209.85.220.41] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25595 invoked from network); 4 Feb 2015 14:05:47 -0000 Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2015 14:05:47 -0000 Received: by mail-pa0-f41.google.com with SMTP id kq14so3086630pab.0 for ; Wed, 04 Feb 2015 06:05:46 -0800 (PST) X-Received: by 10.70.56.70 with SMTP id y6mr47027645pdp.14.1423058746079; Wed, 04 Feb 2015 06:05:46 -0800 (PST) Received: from parthd-ubunutu.qualcomm.com ([202.46.23.62]) by mx.google.com with ESMTPSA id kg12sm2161881pbb.44.2015.02.04.06.05.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:05:44 -0800 (PST) From: parth.dixit@linaro.org To: xen-devel@lists.xen.org Date: Wed, 4 Feb 2015 19:32:09 +0530 Message-Id: <1423058539-26403-26-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> References: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> Cc: ian.campbell@citrix.com, julien.grall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com, Parth Dixit , christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH RFC 25/35] arm: acpi add helper functions to map memory regions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: parth.dixit@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Parth Dixit For passing ACPI tables to dom0, UEFI memory needs to be mapped by xen in dom0 address space. This patch adds helper functions for mapping. Signed-off-by: Parth Dixit --- xen/arch/arm/p2m.c | 24 ++++++++++++++++++++++++ xen/include/asm-arm/p2m.h | 10 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 8809f5a..5593a91 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -943,6 +943,30 @@ int p2m_populate_ram(struct domain *d, 0, MATTR_MEM, p2m_ram_rw); } +int map_ram_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn) +{ + return apply_p2m_changes(d, INSERT, + pfn_to_paddr(start_gfn), + pfn_to_paddr(start_gfn + nr), + pfn_to_paddr(mfn), + MATTR_MEM, p2m_mmio_direct); +} + +int unmap_ram_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn) +{ + return apply_p2m_changes(d, REMOVE, + pfn_to_paddr(start_gfn), + pfn_to_paddr(start_gfn + nr), + pfn_to_paddr(mfn), + MATTR_MEM, p2m_invalid); +} + int map_mmio_regions(struct domain *d, unsigned long start_gfn, unsigned long nr, diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index da36504..be76ecd 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -132,6 +132,16 @@ int guest_physmap_add_entry(struct domain *d, unsigned long page_order, p2m_type_t t); +int map_ram_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr_mfns, + unsigned long mfn); + +int unmap_ram_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr_mfns, + unsigned long mfn); + /* Untyped version for RAM only, for compatibility */ static inline int guest_physmap_add_page(struct domain *d, unsigned long gfn,