From patchwork Mon Oct 2 17:31:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 114632 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp924604qgn; Mon, 2 Oct 2017 10:34:07 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBpGVCs1GlTa8WCIEPj4nvdoVYuVd/pZhVylzKcFvfl4bybCsCdpdZ9O92uLHupBUQUhlj5 X-Received: by 10.36.90.19 with SMTP id v19mr10988864ita.30.1506965647847; Mon, 02 Oct 2017 10:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506965647; cv=none; d=google.com; s=arc-20160816; b=QHuLqu5vGVNBkZpwLxX8Ao7fFX3wjav30BPdfslv6AzgGDFOb7VWqE8w0LEaGr9c33 wkPQQIWhn5uP0wxIFR+vPGSt8n0sSZxEBQhNNBC3kBpNn+U2jfiY1vFLnP4tZamdrTgt swQL8x92Mfz9YcdLwh+pIdSLQTnsByPsOTGHZHIZC7nWnKLXtaIcsrNiN5u+LXszP980 P115JoverRbQ+CdQVgLrj9yZOVLnmVVfKFgUcqSU62eBJNMD2RlqK/jJZ5h/jd4mMUsl 1S1sdT7/IMyp7qFxmVLIp5NfJs004yDJkIiuR68a2LqpOyEfXTx6XCTdVEbFTMZdrlY3 jfaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=VnVSUpTaaQ48OTw4OlsPcxkwpuYf59x8V3ESA/WBXV0=; b=fto/nF0uNCfwDQwUeuzSD1BzTZfyy5/69o1vNQFQGrSzbijzLJKrlEy2ZrmA2AuOJm FB5OzEKrgpqFVSqBKItRpwxIpcz1XeAAoBCe8TMP0/1WPr4M8397l2zz0PInxs8cidkK ftPxuKJcb+6Trze11jJhO2sU1gbm/DfzCckdxIPr67E9zGiZx2GVVMDB2zYR6xQ9+EbB kVwlvL+dvphQrGeUC++UINFQOF0CQrj5fdc6+jjxVAiNN34BKvYBoouql23pKmwcmayf 1NO3w57J4iv8S+rW5W3GXelK8+mtRNVW7HlPBKZX5zc86a1DYeUaQ5khFL/LPgaqKWIY 4Y7g== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i14si9409885ioo.368.2017.10.02.10.34.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 10:34:07 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz4Zf-0003gU-1S; Mon, 02 Oct 2017 17:32:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz4Zd-0003eS-Ct for xen-devel@lists.xen.org; Mon, 02 Oct 2017 17:32:09 +0000 Received: from [85.158.143.35] by server-5.bemta-6.messagelabs.com id 48/69-03454-81872D95; Mon, 02 Oct 2017 17:32:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRWlGSWpSXmKPExsVysyfVTVe84lK kwalL3BZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b3zz+YC3rYK24tvMzWwNjK2sXIxSEksJlR YtHTXiYI5zSjxNR5XSxdjJwcbAKaEnc+f2ICsUUEpCWufb7MCGIzC0RKHP7wgx3EFhYIk9g35 yiYzSKgKvHhVQuYzStgIXHs/BmwORIC8hK72i6ygticApYSt58cYgaxhYBqTr+ewTSBkXsBI8 MqRo3i1KKy1CJdQ2O9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYxADzMAwQ7GL8s CDjFKcjApifJ651+KFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBe70MKCdYlJqeWpGWmQMMNZi0 BAePkgjvPZA0b3FBYm5xZjpE6hSjMceNh9f/MHF03Lz7h0mIJS8/L1VKnHcPSKkASGlGaR7cI FgMXGKUlRLmZQQ6TYinILUoN7MEVf4VozgHo5Iw70GQKTyZeSVw+14BncIEdMqcrgsgp5QkIq SkGhgjZ8kFNcnmZx1pS7LefkCfc/vU67U+Jx2c7zw5vC+6PGM//7dCtmyWvv3bNn25meT99LF x9+ndku8PRr5YJ5ugFuYldyKJ/XLU6cbJjD4tv5b53T3PvcFmpeNr9ifcU468UFZ1azq9aYbU kj0BujYMd9kq9p6WkDzdziobH9zuHlIZ/+KrxUslluKMREMt5qLiRADFJIV4fAIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1506965526!77678403!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42344 invoked from network); 2 Oct 2017 17:32:07 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-5.tower-21.messagelabs.com with SMTP; 2 Oct 2017 17:32:07 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C6121596; Mon, 2 Oct 2017 10:32:06 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 910353F483; Mon, 2 Oct 2017 10:32:05 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Oct 2017 18:31:49 +0100 Message-Id: <20171002173150.5404-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171002173150.5404-1-julien.grall@arm.com> References: <20171002173150.5404-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v3 8/9] xen/arm: mm: Handle permission flags when adding a new mapping X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" Currently, all the new mappings will be read-write non-executable. Allow the caller to use other permissions. Signed-off-by: Julien Grall --- Changes in v2: - Switch the runtime check to a BUG_ON() --- xen/arch/arm/mm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 117f05a1d6..57afedf0be 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1022,6 +1022,9 @@ static int create_xen_entries(enum xenmap_operation op, if ( op == RESERVE ) break; pte = mfn_to_xen_entry(mfn, PAGE_AI_MASK(flags)); + pte.pt.ro = PAGE_RO_MASK(flags); + pte.pt.xn = PAGE_XN_MASK(flags); + BUG_ON(!pte.pt.ro && !pte.pt.xn); pte.pt.table = 1; write_pte(entry, pte); break;