From patchwork Tue Dec 10 14:18:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22221 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 85A3023908 for ; Tue, 10 Dec 2013 14:18:55 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf23041300pdj.11 for ; Tue, 10 Dec 2013 06:18:54 -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=Iw5c4z0r6JKmYUnlMJNQn7bB7HEtYS7DLh6czGlB4Nw=; b=F9OyG1w3Nis+v7zdZxHozn0Q/QsJQD1yba8rBM4JNGM8WHKyNpV92Y5czpsor9tKOc d1LAp7Rz7rJG+jPSLdBprBOBXGLsQUZiZeO5D54gDEBNE6BlyrCfDLfWIWJbwjg0oEAl dqHZbkzh1BUzbAFgAdhvcwAGWNqD+agW7yWYv1UH4FOiCZxJlFlnN69vMaPuIVEz/wqV a/AFG0/u8G3l7lyH0RpbcCOY0qietJAzdX686U55Xh+60b4I0hfn4eFh0iRrqsw4BerB 2Bdv0cV1bNukhAMmmVlXm2JfV7xHysq2qxZ827xfhkOnm679vyZcXgC1q0wcSumdjs0k QY2w== X-Gm-Message-State: ALoCoQmsqJD7On5D7fkiE/eYJJIcsyb/KwMTclRd7QTIz5f/Zrim0fQTe5Hn3q0KfzU6t5U9Wxqg X-Received: by 10.66.118.37 with SMTP id kj5mr13497439pab.17.1386685134781; Tue, 10 Dec 2013 06:18:54 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.16.35 with SMTP id c3ls2417845qed.83.gmail; Tue, 10 Dec 2013 06:18:54 -0800 (PST) X-Received: by 10.58.208.130 with SMTP id me2mr14111838vec.13.1386685134617; Tue, 10 Dec 2013 06:18:54 -0800 (PST) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id ud10si5170687vcb.141.2013.12.10.06.18.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 06:18:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.41 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.41; Received: by mail-vb0-f41.google.com with SMTP id m10so582788vbh.14 for ; Tue, 10 Dec 2013 06:18:54 -0800 (PST) X-Received: by 10.58.187.51 with SMTP id fp19mr29031vec.47.1386685134556; Tue, 10 Dec 2013 06:18:54 -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 u4csp191448vcz; Tue, 10 Dec 2013 06:18:54 -0800 (PST) X-Received: by 10.180.81.33 with SMTP id w1mr19605532wix.42.1386685133217; Tue, 10 Dec 2013 06:18:53 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id hc3si1010816wib.87.2013.12.10.06.18.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 06:18:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id cc10so5381072wib.16 for ; Tue, 10 Dec 2013 06:18:52 -0800 (PST) X-Received: by 10.180.10.138 with SMTP id i10mr19663049wib.44.1386685132681; Tue, 10 Dec 2013 06:18:52 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id nb16sm5556779wic.0.2013.12.10.06.18.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Dec 2013 06:18:50 -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 v3 10/10] xen/arm: grant-table: Support read-only mapping Date: Tue, 10 Dec 2013 14:18:22 +0000 Message-Id: <1386685102-563-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386685102-563-1-git-send-email-julien.grall@linaro.org> References: <1386685102-563-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.41 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 2a2c769..da1676f 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1295,19 +1295,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