From patchwork Thu Nov 23 18:32:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119539 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1173164edl; Thu, 23 Nov 2017 10:34:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMYibn2KQ1aHqnvvh/lyRZ4mfEUXqpqAevFIoXvJwvfneWd+pB8pWBfujIwpYRtVupDBXXZL X-Received: by 10.36.8.136 with SMTP id 130mr13064565itc.18.1511462064754; Thu, 23 Nov 2017 10:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511462064; cv=none; d=google.com; s=arc-20160816; b=U3gkrRBLMNAqSem45C+IB0xpTi6tfmg86ibf2totyekN6CHGhVWffnAZeUGIGNuM9g jZCn61p9QZpU1qOKvjrCuhnASTTgY0qRCoYuv3v6xNK14sgbNOM69kxuhfrWLOb3kSVV dQRsl0HrMZvo3UAcbtArX3+Vqy582yta+IbMS29bxzU9twxXQhSLqWcPk7PGWvWe2RBF Yy4yRt5OnOfpmAqgwuYVLhgTt+dAN7PccM4RJSLTcq41UOZs0dD+1LOfq1S0E7+5eH1F 9YIGcOkbyZWh+s6eWl3FtXSDuqLeYVsjJAsg3aSqx8/lsWnXaeC2q8szxrxRtIfQFYYt XZQg== 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:dkim-signature:arc-authentication-results; bh=Duiw9XlLNa4Nuw0iVkR5oGC2mCz2u79bNwxpSONgTy4=; b=UlyZfJuyNyON1MuCBt8xaTw6aIQSjQFyOm5cQl6xi8360f7YVuJEz0WIwUcsmrGNJz sI+WmmJsW9pzd/TkO+nlT7KlV2aTekJW4GKQNt/RfnAHoxvpQVxnXKUBdbGtQGxGRza3 9yGfdX3LDgCYFcC3Vtec32uHdCG5PbGkc/3x2W+ezX2Rd0VhXijWjDfgaQBplWcMP9wj tS5yk8wSKZdD2w/wV+AypLqmm2tr7/E1Fev4+6LqKWCxUK+I95T2rPQdArSjYUXUj/PN V/AKCPV76qlpyhas+t3iv8vFZF4OeHU5GUvydw+nnDjYsNFQ9FuUb2dUU0rHWPU1nUH8 k0KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q0Zqd82e; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id m82si6689419itg.119.2017.11.23.10.34.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:34:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q0Zqd82e; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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 1eHwIW-0005Kj-Qy; Thu, 23 Nov 2017 18:32:28 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHwIV-0005IQ-9J for xen-devel@lists.xen.org; Thu, 23 Nov 2017 18:32:27 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id F4/79-16578-A34171A5; Thu, 23 Nov 2017 18:32:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRWlGSWpSXmKPExsXiVRvkomspIh5 lsPavpcWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvHp4F7mgsWSFRNPzmNsYLwg3MXIySEkMJFR Yu0nrS5GLg4WgXnMEgc39rCDJCQE+lklHj+Vh7DzJA7s2sIMYadJrFi4ggnCLpfovTmLsYuRA 2iQmsSaN1Egc4QE+pgk3sxvZQOJswnoSKybUQtSLiIgLXHt82VGEJtZIF7i8dTrbCC2sECkxK xdZ8BsFgFViTOLL4CdwCtgK3H46h2otfISu9ousoLYnEDxowc+MEOstZH4/FlxAqPgAkaGVYz qxalFZalFupZ6SUWZ6RkluYmZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiBgcYABDsY724KOMQo ycGkJMor80ssSogvKT+lMiOxOCO+qDQntfgQowwHh5IEr6+weJSQYFFqempFWmYOMORh0hIcP EoivGkgad7igsTc4sx0iNQpRkuOfXtu/WHieDbzdQMzx7SrrU3MQix5+XmpUuK8niANAiANGa V5cONgcXmJUVZKmJcR6EAhnoLUotzMElT5V4ziHIxKwhBreTLzSuC2vgI6iAnooJ/HhUEOKkl ESEk1MEq+2CAQkJ9adpQh+1RLS2/4bR2BQsPzbv/Zaw2WbXS+WTJB/Wtl9f2Xp6W2XSyyeJtT XnX/uoSa4J+I56vN7V/2VXdMeHYma21R6u3QADW3DU/u7Np87NZD+ds3kjkdV16t/p2Sq5jpp LbOa94rwfVX31ZEfOyKqP305qN608XyiOZ7c784uSmxFGckGmoxFxUnAgCR/JytxgIAAA== X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1511461945!117588512!1 X-Originating-IP: [74.125.82.68] 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 11775 invoked from network); 23 Nov 2017 18:32:25 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-3.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 23 Nov 2017 18:32:25 -0000 Received: by mail-wm0-f68.google.com with SMTP id u83so18573112wmb.5 for ; Thu, 23 Nov 2017 10:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VOhnq4hr2RAsU8IGX5a9VAFVlDtgFmfUZHGYfGQWn08=; b=Q0Zqd82eIwZa6mrYMqtl7OvEEA/nbP9htbtn72cluIdLNk9++XbH558K8eYXJ5cUxx +0Ri99EgwgDFwcD0MkQnruazFM5TyPzhi95MlsMBMYI3vd5GMGgySfh9Jr0nMn9iuILl j5fFOS0aymhN1q4cjw5zMQa7hpe9AjhKFIREI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VOhnq4hr2RAsU8IGX5a9VAFVlDtgFmfUZHGYfGQWn08=; b=CuB6IdotkuWL17UXM2QcJqoVwnoL0h42tgs1+eAnLbUwcNLUged/3Z5w0h72Lck7VY idssGdm2Sqnqs1rakk3Gp0ZPwvRMmubpOfH3s5oGp0q9HiiM26J4Yh08C7r564ti5fx7 iDxk1Ucp4BdV/+TNpbN6y1fGKwBReyFjjOpHD2JxclkFql1pfonocPqZiPVSMKRBRsvf X7POaH0ZvKW8VVNQ/B5MUIstnzAjr//BuBSJ+7BF75za+ZU4Eo9RBZL/Sevb39UHoWUa qtKNMPpQ/XpCVsR8rsX+a+ooABqcMmBTKgbYYQtBUAyEkR4tsPK/IcvccmP7nOaI3/8K JMBQ== X-Gm-Message-State: AJaThX5Yp0u81zGGuV2bJIs+paWNo3CHZ4SzIIxEZXr6ihSSZ8PcC97c HQNZLwnMrY6bF7JqvIapm/NdOT9Udag= X-Received: by 10.28.69.136 with SMTP id l8mr7715044wmi.19.1511461945386; Thu, 23 Nov 2017 10:32:25 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id n32sm41412950wrb.62.2017.11.23.10.32.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:32:24 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 23 Nov 2017 18:32:05 +0000 Message-Id: <20171123183210.12045-12-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171123183210.12045-1-julien.grall@linaro.org> References: <20171123183210.12045-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH for-next 11/16] xen/arm: p2m: Rename p2m_flush_tlb and p2m_flush_tlb_sync X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" Rename p2m_flush_tlb and p2m_flush_tlb_sync to respectively p2m_tlb_flush and p2m_force_tlb_flush_sync. At first glance, inverting 'flush' and 'tlb' might seem pointless but would be helpful in the future in order to get more easily some code ported from x86 P2M or even to shared with. For p2m_flush_tlb_sync, the 'force' was added because the TLBs are flush unconditionally. A follow-up patch will add an helper to flush TLBs only in certain cases. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/p2m.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 417609ede2..d466a5bc43 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -52,7 +52,7 @@ static const paddr_t level_masks[] = static const uint8_t level_orders[] = { ZEROETH_ORDER, FIRST_ORDER, SECOND_ORDER, THIRD_ORDER }; -static void p2m_flush_tlb(struct p2m_domain *p2m); +static void p2m_tlb_flush(struct p2m_domain *p2m); /* Unlock the flush and do a P2M TLB flush if necessary */ void p2m_write_unlock(struct p2m_domain *p2m) @@ -65,7 +65,7 @@ void p2m_write_unlock(struct p2m_domain *p2m) * to avoid someone else modify the P2M before the TLB * invalidation has completed. */ - p2m_flush_tlb(p2m); + p2m_tlb_flush(p2m); } write_unlock(&p2m->lock); @@ -138,7 +138,7 @@ void p2m_restore_state(struct vcpu *n) *last_vcpu_ran = n->vcpu_id; } -static void p2m_flush_tlb(struct p2m_domain *p2m) +static void p2m_tlb_flush(struct p2m_domain *p2m) { unsigned long flags = 0; uint64_t ovttbr; @@ -170,11 +170,11 @@ static void p2m_flush_tlb(struct p2m_domain *p2m) * * Must be called with the p2m lock held. */ -static void p2m_flush_tlb_sync(struct p2m_domain *p2m) +static void p2m_force_tlb_flush_sync(struct p2m_domain *p2m) { ASSERT(p2m_is_write_locked(p2m)); - p2m_flush_tlb(p2m); + p2m_tlb_flush(p2m); p2m->need_flush = false; } @@ -675,7 +675,7 @@ static void p2m_free_entry(struct p2m_domain *p2m, * flush? */ if ( p2m->need_flush ) - p2m_flush_tlb_sync(p2m); + p2m_force_tlb_flush_sync(p2m); mfn = _mfn(entry.p2m.base); ASSERT(mfn_valid(mfn)); @@ -864,7 +864,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m, * For more details see (D4.7.1 in ARM DDI 0487A.j). */ p2m_remove_pte(entry, p2m->clean_pte); - p2m_flush_tlb_sync(p2m); + p2m_force_tlb_flush_sync(p2m); p2m_write_pte(entry, split_pte, p2m->clean_pte); @@ -940,7 +940,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m, { if ( likely(!p2m->mem_access_enabled) || P2M_CLEAR_PERM(pte) != P2M_CLEAR_PERM(orig_pte) ) - p2m_flush_tlb_sync(p2m); + p2m_force_tlb_flush_sync(p2m); else p2m->need_flush = true; } @@ -1144,7 +1144,7 @@ static int p2m_alloc_table(struct domain *d) * Make sure that all TLBs corresponding to the new VMID are flushed * before using it */ - p2m_flush_tlb(p2m); + p2m_tlb_flush(p2m); return 0; }