From patchwork Mon Dec 16 17:37:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22539 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 465AC23FC6 for ; Mon, 16 Dec 2013 17:37:56 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at1sf18839023iec.7 for ; Mon, 16 Dec 2013 09:37:55 -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=WsMA+1QOrfTwzeYqxF8KPWazuTs5nNPhEeIi35qJKkRsEdLaubxuxkjXpRt+E0UX7d mXCnDlKIW5b0vQiGF1OyugQCy4orQxcr+7uoXm6h/CMN91HJLRBSyOZ4ItOfU8tMNYh3 B0Zo3EWuKu10U8Dh/mOAnkJuEV9B/bgOUygomsB364UJpakq4EyKIt6+yNg6oKVtV/Sg Up74i9z5Uj60vCHxakHju1/8+Ei7kYquXlrp6fGrSykNNOf7aCnIvGpKsvoixGeqverG kGLWphNG6r47dpGK7gY9KE+rxioqCwiKxq6imeIW9G2LrYqWSyFMa47bwb8up2gk8qsW lHeg== X-Gm-Message-State: ALoCoQk0Pnhu4LgJDUlf+5jDGRCw6rZq9/rlCmR9AfpQMsfRqD6ieRXJGWITHo4JslMqqlcae5GJ X-Received: by 10.182.95.68 with SMTP id di4mr6846941obb.4.1387215475869; Mon, 16 Dec 2013 09:37:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.102 with SMTP id o6ls2175092qek.28.gmail; Mon, 16 Dec 2013 09:37:55 -0800 (PST) X-Received: by 10.220.103.141 with SMTP id k13mr93639vco.25.1387215475714; Mon, 16 Dec 2013 09:37:55 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id s5si4151779vev.117.2013.12.16.09.37.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 09:37:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so3563043veb.31 for ; Mon, 16 Dec 2013 09:37:55 -0800 (PST) X-Received: by 10.52.0.174 with SMTP id 14mr46270vdf.86.1387215475651; Mon, 16 Dec 2013 09:37:55 -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 u4csp6138vcz; Mon, 16 Dec 2013 09:37:55 -0800 (PST) X-Received: by 10.14.114.71 with SMTP id b47mr18385475eeh.26.1387215474537; Mon, 16 Dec 2013 09:37:54 -0800 (PST) Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by mx.google.com with ESMTPS id m44si1400466eeo.37.2013.12.16.09.37.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 09:37:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.177 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.177; Received: by mail-ea0-f177.google.com with SMTP id n15so2377106ead.22 for ; Mon, 16 Dec 2013 09:37:54 -0800 (PST) X-Received: by 10.14.119.1 with SMTP id m1mr18231011eeh.39.1387215473921; Mon, 16 Dec 2013 09:37:53 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id e3sm44674680eeg.11.2013.12.16.09.37.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2013 09:37:52 -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 v5 10/10] xen/arm: grant-table: Support read-only mapping Date: Mon, 16 Dec 2013 17:37:32 +0000 Message-Id: <1387215452-10951-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> References: <1387215452-10951-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.172 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