From patchwork Thu Dec 5 15:42:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22078 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31F76202E0 for ; Thu, 5 Dec 2013 15:42:40 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf58480551oag.5 for ; Thu, 05 Dec 2013 07:42:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=6yYHJMcNo+Kr+6cMQlx8+8VetTVikvhQsuSn7Jj1njo=; b=cDInMlU2cQsRaREbrpGT2J1PJs1/nbRxuEfQhoRqT6FHQj0JnEyIQXBKa91DqqOGVx FQ7hEIjjEPf1RsNvQvacQync4rc4cfaVYAfaVe+iHnljB8jhw6fxiOOKcSpCpSXwkQq1 nA7stxgMpDa2DNxOGA+OBMImiIMf7E9+Ug6vPm0rVMaUAAlrYE8/kVBInIJgfyKWrn9S fxaxv1q7OwER58YYCO2gpo3DXdpQFnpQFvMbb1RWSqT9HT/40Ziu0E7AqlzFTv1CFyoa Mv99dvjSePYXNh/whobZKamyJFEO4/EaaGI55aw6ehShAVwb/ftEHDHY/YZHMRmBQW3I Ihng== X-Gm-Message-State: ALoCoQmTTJ2sfEyaFtjCaYot1Zxa1k7yNhlJXyzvA7MMxtfM5+e9ic2p0+apGPqDngMZxq/YeGjE X-Received: by 10.43.76.6 with SMTP id zc6mr6427126icb.26.1386258159805; Thu, 05 Dec 2013 07:42:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.66 with SMTP id o2ls811532qeq.18.gmail; Thu, 05 Dec 2013 07:42:39 -0800 (PST) X-Received: by 10.52.74.74 with SMTP id r10mr1081944vdv.78.1386258159682; Thu, 05 Dec 2013 07:42:39 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id sx7si69159vdc.16.2013.12.05.07.42.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so14169951veb.32 for ; Thu, 05 Dec 2013 07:42:39 -0800 (PST) X-Received: by 10.52.72.100 with SMTP id c4mr1038901vdv.86.1386258159539; Thu, 05 Dec 2013 07:42:39 -0800 (PST) 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 u4csp24849vcz; Thu, 5 Dec 2013 07:42:39 -0800 (PST) X-Received: by 10.194.123.8 with SMTP id lw8mr17436103wjb.40.1386258158622; Thu, 05 Dec 2013 07:42:38 -0800 (PST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id w7si778248wie.33.2013.12.05.07.42.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id ca18so10012402wib.5 for ; Thu, 05 Dec 2013 07:42:38 -0800 (PST) X-Received: by 10.194.48.115 with SMTP id k19mr17995861wjn.47.1386258158064; Thu, 05 Dec 2013 07:42:38 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id w20sm7350575wia.5.2013.12.05.07.42.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 07:42:37 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, time@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH 8/8] xen/arm: grant-table: Support read-only mapping Date: Thu, 5 Dec 2013 15:42:11 +0000 Message-Id: <1386258131-755-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386258131-755-1-git-send-email-julien.grall@linaro.org> References: <1386258131-755-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.128.173 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: , Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/mm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index bf383a7..8e190ec 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1277,19 +1277,17 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame, unsigned int flags, unsigned int cache_flags) { int rc; + p2m_type_t t = p2m_ram_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; - } + t = p2m_ram_ro; + + rc = guest_physmap_add_entry(current->domain, addr >> PAGE_SHIFT, + frame, 0, t); - rc = guest_physmap_add_page(current->domain, - addr >> PAGE_SHIFT, frame, 0); if ( rc ) return GNTST_general_error; else