From patchwork Fri Dec 13 19:37:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22364 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C29E202E2 for ; Fri, 13 Dec 2013 19:38:29 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf6539899pdj.7 for ; Fri, 13 Dec 2013 11:38:28 -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=mSQlVp36kWf4VKCtni9hh8oMYLvxxBdoih+KIMgoLpk=; b=aJuUya945R7G9us4pWKfTUtsoSLuRQzV6neyGri5m96BSXZY7ltpxiumXTA29Q6Vsp uKSGuwsQXD7zbUB/DvEwXmzjnBl0oAXCIFpLFc2WWVEXeJCqubMKDGxezFTyiGOfejtO 29ZJyLWTCHNpCRY/Q6vipuRuo9zzWAkHCV1FfFuPirB8USU01tgUoMx1tBQb6WdYl9YV j7wMRyiiIpToOR5PDf/XpD6eFUbDBo/8TyH+FfD3qIKpeXjpAwzMmN43JZvXi8UCiau7 PNjNokYWf7Jkk5F3DhSDcuAiDvkkpNlO3O/BBObD9TU80fLC3XNHQn/syUsW6iA8nNmR 5dJQ== X-Gm-Message-State: ALoCoQkCn3CUsIHRNPyqjK8GSqiiypFP015MqIaqnsoALpjAL2QsIPdRf5ll8/ztpXwp6hfNKbCv X-Received: by 10.66.66.163 with SMTP id g3mr2567782pat.3.1386963508608; Fri, 13 Dec 2013 11:38:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.50.41.100 with SMTP id e4ls604962igl.9.canary; Fri, 13 Dec 2013 11:38:28 -0800 (PST) X-Received: by 10.68.230.137 with SMTP id sy9mr5293994pbc.126.1386963508466; Fri, 13 Dec 2013 11:38:28 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id cx4si1084215vcb.5.2013.12.13.11.38.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:38:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 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.44; Received: by mail-vb0-f44.google.com with SMTP id x8so1614816vbf.31 for ; Fri, 13 Dec 2013 11:38:28 -0800 (PST) X-Received: by 10.220.97.69 with SMTP id k5mr1941406vcn.45.1386963508347; Fri, 13 Dec 2013 11:38:28 -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 u4csp64214vcz; Fri, 13 Dec 2013 11:38:27 -0800 (PST) X-Received: by 10.14.108.134 with SMTP id q6mr4639497eeg.96.1386963507086; Fri, 13 Dec 2013 11:38:27 -0800 (PST) Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by mx.google.com with ESMTPS id t6si3145725eeh.129.2013.12.13.11.38.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:38:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.182 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.182; Received: by mail-ea0-f182.google.com with SMTP id a15so1066032eae.41 for ; Fri, 13 Dec 2013 11:38:26 -0800 (PST) X-Received: by 10.14.4.67 with SMTP id 43mr4589399eei.70.1386963506677; Fri, 13 Dec 2013 11:38:26 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id m1sm10199792eeg.0.2013.12.13.11.38.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 11:38:25 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, tim@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH v4 11/11] xen/arm: grant-table: Support read-only mapping Date: Fri, 13 Dec 2013 19:37:41 +0000 Message-Id: <1386963461-6520-12-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386963461-6520-1-git-send-email-julien.grall@linaro.org> References: <1386963461-6520-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.44 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 --- Changes in v2: - Use p2m grant type to map grant-table mapping --- 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 0434296..f8bda79 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1296,19 +1296,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_grant_map_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_grant_map_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