From patchwork Tue Dec 17 16:27:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22607 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD28323FC6 for ; Tue, 17 Dec 2013 16:29:03 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at1sf23175937iec.7 for ; Tue, 17 Dec 2013 08:29:03 -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=YJOR+/20vK6ApN2/CI578unctBPWauvihTVslzW7q30=; b=jCOWtTzGwseqOd+cf5JHFdC9ZLEqunF8nYLyUxS7ScVn6YZUUbLfknKaiU0duD8Rqi CdwJBPTzhzZz6/BTdy9MsxtNLrndUZbJbyVwtcDJ1uJLGRVf6D5HtB0HeyBbRfeR9usM CYFikV+SnfLWM93+I/rUD7PxVmxpn3x6dWrBff+YJQqpEaODc/K8npDrng0RudnFY8aq bRghlKVpBNf44MOxHET+XBQ6clvZm6QiqsXfW/JWRwrOUhpDqfDfsCqgqQD9r1q5Xpd9 EKA2MYIcoPPQBCHNP4JDTXPfSFf6BVpzNfknQ4kLxY0gvWsRx8EoQsyAc0jDeKhyfuIH Bpuw== X-Gm-Message-State: ALoCoQn6sl9DIO99id5NjnGo6YXuMoudKX5LNu7+yGjNPxZJ8LNZQQcCwoMf8Znln7vYr5X5BgqT X-Received: by 10.50.12.68 with SMTP id w4mr1636536igb.0.1387297743444; Tue, 17 Dec 2013 08:29:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.163 with SMTP id z3ls2558161qej.1.gmail; Tue, 17 Dec 2013 08:29:03 -0800 (PST) X-Received: by 10.58.75.164 with SMTP id d4mr1000369vew.53.1387297743346; Tue, 17 Dec 2013 08:29:03 -0800 (PST) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id tw7si3574860vcb.3.2013.12.17.08.29.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 08:29:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.54 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.54; Received: by mail-vb0-f54.google.com with SMTP id g10so4211217vbg.41 for ; Tue, 17 Dec 2013 08:29:03 -0800 (PST) X-Received: by 10.58.216.133 with SMTP id oq5mr8622vec.80.1387297743270; Tue, 17 Dec 2013 08:29:03 -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 u4csp79614vcz; Tue, 17 Dec 2013 08:29:02 -0800 (PST) X-Received: by 10.14.9.131 with SMTP id 3mr24040029eet.45.1387297741923; Tue, 17 Dec 2013 08:29:01 -0800 (PST) Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by mx.google.com with ESMTPS id m49si5847558eeg.94.2013.12.17.08.29.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 08:29:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.172 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.172; Received: by mail-ea0-f172.google.com with SMTP id q10so2534715ead.31 for ; Tue, 17 Dec 2013 08:29:01 -0800 (PST) X-Received: by 10.15.44.4 with SMTP id y4mr23692929eev.71.1387297741495; Tue, 17 Dec 2013 08:29:01 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id e3sm54411471eeg.11.2013.12.17.08.28.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2013 08:28:56 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, Julien Grall Subject: [PATCH v6 10/10] xen/arm: grant-table: Support read-only mapping Date: Tue, 17 Dec 2013 16:27:58 +0000 Message-Id: <1387297678-17762-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387297678-17762-1-git-send-email-julien.grall@linaro.org> References: <1387297678-17762-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.54 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 6829822..b1d3c60 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1307,19 +1307,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