From patchwork Thu Oct 24 09:02:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 21246 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 97E63244EE for ; Thu, 24 Oct 2013 09:03:07 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id db12sf5377856veb.11 for ; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=nUSVOFKi0gNC/if2dTCK0JXKQUIvbvlZeJDty08SgA4=; b=l1OxEuo2wiDH4ZatHLAdbzkjsJdfkS0y6hB8rPlUOa0KSni/6OejMfoEYCrfcaLZYH P/0SxaG51y1mqwVM5Iu6aNHSkbIpd7oh0n0E816x8QxUeOlIsS09GZCrKwICe0MIrAqA MFIV69XjdgAio8BY8qx3oOcBEBqmvzitts/hHOnf3NMfyV4Hin1da0VlBv8lQcFTIHQP in0+1IWQAP0f9H6SV+UUc0IBJ+knH02ha7bPu09prxAGWxXOyK+39AlKOvI9srfEY5+M tFrxu/AXpBiFwXPfqazsNz9SW3cL1KSKe4tWGOw6q6l3xIj1ZtamtV/E+YwlFDne1Au3 sqqw== X-Received: by 10.58.136.6 with SMTP id pw6mr606102veb.32.1382605387471; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.72 with SMTP id w8ls760917qej.59.gmail; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) X-Received: by 10.220.250.4 with SMTP id mm4mr20512vcb.47.1382605387369; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id j1si110575vci.101.2013.10.24.02.03.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 02:03:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so1290659vbg.29 for ; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) X-Gm-Message-State: ALoCoQnFSYTMGM3UkHkg3jHeod6mG6WW8fW/4F/IRhHexxCaB37fQ2V7/aDUW58wAtVwTaI2MGRt X-Received: by 10.52.105.195 with SMTP id go3mr756844vdb.24.1382605387249; Thu, 24 Oct 2013 02:03:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp374595vcz; Thu, 24 Oct 2013 02:03:06 -0700 (PDT) X-Received: by 10.194.110.138 with SMTP id ia10mr1532326wjb.3.1382605386343; Thu, 24 Oct 2013 02:03:06 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx.google.com with ESMTPS id m9si262417wic.0.2013.10.24.02.03.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 02:03:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.170 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.170; Received: by mail-wi0-f170.google.com with SMTP id l12so9516379wiv.5 for ; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) X-Received: by 10.180.36.242 with SMTP id t18mr1218961wij.28.1382605385894; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) Received: from laptop.eicc.co.uk (ed03490-ge-0-0-0.mgdfwr.lumison.net. [212.20.242.100]) by mx.google.com with ESMTPSA id fb4sm24947864wib.8.2013.10.24.02.03.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2013 02:03:05 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: ian.campbell@citrix.com, tim@xen.org, patches@linaro.org, stefano.stabellini@eu.citrix.com, 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> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> References: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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