From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw Date: Thu, 24 Oct 2013 10:02:44 +0100 Message-ID: <1382605365-19244-3-git-send-email-julien.grall@linaro.org> References: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VZGor-0000u1-79 for xen-devel@lists.xenproject.org; Thu, 24 Oct 2013 09:03:05 +0000 Received: by mail-we0-f176.google.com with SMTP id w62so1970604wes.21 for ; Thu, 24 Oct 2013 02:03:03 -0700 (PDT) In-Reply-To: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, ian.campbell@citrix.com, Julien Grall , patches@linaro.org List-Id: xen-devel@lists.xenproject.org This function allows Xen to map memory read/write or read-only to the guest memory. Signed-off-by: Julien Grall --- xen/arch/arm/p2m.c | 11 +++++++++++ xen/include/asm-arm/p2m.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index fdbb07b..0c515e1 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -267,6 +267,17 @@ int guest_physmap_add_page(struct domain *d, mfn << PAGE_SHIFT, MATTR_MEM, 1); } +int guest_physmap_add_page_rw(struct domain *d, + unsigned long gpfn, + unsigned long mfn, + unsigned int page_order, + bool_t rw) +{ + return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT, + (gpfn + (1 << page_order)) << PAGE_SHIFT, + mfn << PAGE_SHIFT, MATTR_MEM, rw); +} + void guest_physmap_remove_page(struct domain *d, unsigned long gpfn, unsigned long mfn, unsigned int page_order) diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index c660820..250f916 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -54,6 +54,11 @@ int guest_physmap_add_page(struct domain *d, unsigned long gfn, unsigned long mfn, unsigned int page_order); +int guest_physmap_add_page_rw(struct domain *d, + unsigned long gfn, + unsigned long mfn, + unsigned int page_order, + bool_t rw); void guest_physmap_remove_page(struct domain *d, unsigned long gpfn, unsigned long mfn, unsigned int page_order); -- 1.8.3.1