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 3/3] xen/arm: grant-table: Support read-only mapping
Date: Thu, 24 Oct 2013 10:02:45 +0100	[thread overview]
Message-ID: <1382605365-19244-4-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1382605365-19244-1-git-send-email-julien.grall@linaro.org>

Use guest_physmap_add_page_rw to map the page in the guest with a
specific read-write attribute.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eaeb0c3..e45c6aa 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1262,19 +1262,15 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
                               unsigned int flags, unsigned int cache_flags)
 {
     int rc;
+    bool_t rw;
 
     if ( cache_flags  || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
         return GNTST_general_error;
 
-    /* XXX: read only mappings */
-    if ( flags & GNTMAP_readonly )
-    {
-        gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
-        return GNTST_general_error;
-    }
+    rw = !(flags & GNTMAP_readonly);
 
-    rc = guest_physmap_add_page(current->domain,
-                                 addr >> PAGE_SHIFT, frame, 0);
+    rc = guest_physmap_add_page_rw(current->domain,
+                                   addr >> PAGE_SHIFT, frame, 0, rw);
     if ( rc )
         return GNTST_general_error;
     else
-- 
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 ` [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw Julien Grall
2013-11-11 13:30   ` Ian Campbell
2013-10-24  9:02 ` Julien Grall [this message]

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-4-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).