xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org,
	ian.campbell@citrix.com, Julien Grall <julien.grall@linaro.org>,
	patches@linaro.org
Subject: [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw
Date: Thu, 24 Oct 2013 10:02:44 +0100	[thread overview]
Message-ID: <1382605365-19244-3-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1382605365-19244-1-git-send-email-julien.grall@linaro.org>

This function allows Xen to map memory read/write or read-only to the
guest memory.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 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

  parent reply	other threads:[~2013-10-24  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  9:02 [PATCH 0/3] ARM: Support read-only mapping in the grant table Julien Grall
2013-10-24  9:02 ` [PATCH 1/3] xen/arm: p2m: extend create_p2m_entries to support read-only mapping Julien Grall
2013-11-11 13:23   ` Ian Campbell
2013-11-12 13:13     ` Julien Grall
2013-10-24  9:02 ` Julien Grall [this message]
2013-11-11 13:30   ` [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw Ian Campbell
2013-10-24  9:02 ` [PATCH 3/3] xen/arm: grant-table: Support read-only mapping Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382605365-19244-3-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).