From patchwork Mon Dec 9 03:34:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22157 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFD9023FE0 for ; Mon, 9 Dec 2013 03:34:28 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id va2sf12002459obc.0 for ; Sun, 08 Dec 2013 19:34: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=HH6tx0tO7NxOgM+KPcT3tGEifn1fJx8+Apw5fx3VB1g=; b=jvkLy+VLcfxjMEY/jqeGeBSLtT3c265J2DvLibgvFTRtKpbQuc2F4P3rMK+qrIOqK0 h0juN/T+6uCZ5I2CxHwnttImRDU5xOPak2aRwBCdtT7uSaIx57ufOOt+nbhcw2mnwyyH heDspg2Mv4jyztlnF2LMMtYEBMM/XrF2znt9pOXa7SpgdmEzyxcw0Cg3vL22CK+IX+76 pkdXj8N5EAPYbGjj4NEkgmoPjj9I2gf9Q+pNXQSNj+WaVkDXMS9DYa2UX5wyRvMw+8az +nFxqlQIln3IlmCusc4iENx+DWhZJUY17e10PDONntzyqV0KjrY8njQWaKemfEr3ipG/ 0bDA== X-Gm-Message-State: ALoCoQnZcsxxiliOPhclCHKq5eG4DdTOEAu1efxG0NnliUNvA9kT8RuA2lw/QwEbPau6mWxyxX1M X-Received: by 10.50.164.198 with SMTP id ys6mr5577477igb.5.1386560068254; Sun, 08 Dec 2013 19:34:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.130.195 with SMTP id og3ls1891560qeb.62.gmail; Sun, 08 Dec 2013 19:34:28 -0800 (PST) X-Received: by 10.58.46.18 with SMTP id r18mr10026463vem.4.1386560068131; Sun, 08 Dec 2013 19:34:28 -0800 (PST) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id bq2si3169191vcb.115.2013.12.08.19.34.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 19:34:28 -0800 (PST) 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 w5so132677vbf.15 for ; Sun, 08 Dec 2013 19:34:28 -0800 (PST) X-Received: by 10.52.97.35 with SMTP id dx3mr8480237vdb.18.1386560068056; Sun, 08 Dec 2013 19:34: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 u4csp75735vcz; Sun, 8 Dec 2013 19:34:27 -0800 (PST) X-Received: by 10.14.212.69 with SMTP id x45mr25952772eeo.69.1386560066996; Sun, 08 Dec 2013 19:34:26 -0800 (PST) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by mx.google.com with ESMTPS id m49si7700340eeg.157.2013.12.08.19.34.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 19:34:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.171 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.171; Received: by mail-ea0-f171.google.com with SMTP id h10so1281411eak.16 for ; Sun, 08 Dec 2013 19:34:26 -0800 (PST) X-Received: by 10.14.29.66 with SMTP id h42mr11087875eea.4.1386560066593; Sun, 08 Dec 2013 19:34:26 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id g7sm23681234eet.12.2013.12.08.19.34.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Dec 2013 19:34: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 v2 10/10] xen/arm: grant-table: Support read-only mapping Date: Mon, 9 Dec 2013 03:34:07 +0000 Message-Id: <1386560047-17500-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386560047-17500-1-git-send-email-julien.grall@linaro.org> References: <1386560047-17500-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: , 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 b08ffa0..4dedfe7 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1297,19 +1297,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