From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 3/3] xen/arm: grant-table: Support read-only mapping Date: Thu, 24 Oct 2013 10:02:45 +0100 Message-ID: <1382605365-19244-4-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VZGot-0000uU-J9 for xen-devel@lists.xenproject.org; Thu, 24 Oct 2013 09:03:07 +0000 Received: by mail-wg0-f46.google.com with SMTP id m15so1957290wgh.1 for ; Thu, 24 Oct 2013 02:03:05 -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 Use guest_physmap_add_page_rw to map the page in the guest with a specific read-write attribute. Signed-off-by: Julien Grall --- 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