From patchwork Thu Jul 28 14:20:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 72965 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp880752qga; Thu, 28 Jul 2016 07:25:05 -0700 (PDT) X-Received: by 10.107.135.142 with SMTP id r14mr42853059ioi.133.1469715901742; Thu, 28 Jul 2016 07:25:01 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q6si28301700itb.45.2016.07.28.07.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 07:25:01 -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 1bSmB5-0007Qr-9y; Thu, 28 Jul 2016 14:20:47 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSmB4-0007JT-Hs for xen-devel@lists.xen.org; Thu, 28 Jul 2016 14:20:46 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id D3/40-01945-EB41A975; Thu, 28 Jul 2016 14:20:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRWlGSWpSXmKPExsVysyfVTXevyKx wg21ndCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oytW4+wFXzlqtj/dAVLA+M+ji5GLg4hgU2M Evde7meBcE4zSix4sZy1i5GTg01AU+LO509MILaIgLTEtc+XGUGKmAXaGSXW9vcygySEBQIld n3oBCtiEVCVuLungR3E5hVwkbjbuoANxJYQkJM4eWwy2FBOoPi9tu9gtpCAs8Tpu9vZJzByL2 BkWMWoUZxaVJZapGtoqpdUlJmeUZKbmJmja2hgrJebWlycmJ6ak5hUrJecn7uJEehjBiDYwbh mu+chRkkOJiVR3rDQmeFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHjdhGeFCwkWpaanVqRl5gCD DSYtwcGjJMIbCZLmLS5IzC3OTIdInWJUlBLnzQVJCIAkMkrz4NpgAX6JUVZKmJcR6BAhnoLUo tzMElT5V4ziHIxKwrwbQabwZOaVwE1/BbSYCWhxcewMkMUliQgpqQZG1/ka/GovJ1VvW79Y5+ L8H6eYogNMvc7Z6t7rN+9fo1+dFfrsg/vny9EOLJ88tppebbog9fSoUu7ph2UeJhYqnHavXp5 hLWrYOGnep4aw6d3vFwinOtzj0wq+911iVYEzS3j1lGtMItcsdtef589PFVO3zzt/OsrIxSLi 5uz3vxPlWzz4PhopsRRnJBpqMRcVJwIAW2vwkmsCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1469715635!26646407!8 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46014 invoked from network); 28 Jul 2016 14:20:45 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-11.tower-31.messagelabs.com with SMTP; 28 Jul 2016 14:20:45 -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 6B2E4BF1; Thu, 28 Jul 2016 07:22:02 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3AEC43F21A; Thu, 28 Jul 2016 07:20:44 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 28 Jul 2016 15:20:19 +0100 Message-Id: <1469715620-4670-15-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469715620-4670-1-git-send-email-julien.grall@arm.com> References: <1469715620-4670-1-git-send-email-julien.grall@arm.com> Cc: proskurin@sec.in.tum.de, Julien Grall , sstabellini@kernel.org, steve.capper@arm.com, wei.chen@linaro.org Subject: [Xen-devel] [PATCH v2 14/15] xen/arm: p2m: Replace flush_tlb_domain by p2m_flush_tlb 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" The function to flush the TLBs for a given p2m does not need to know about the domain. So pass directly the p2m in parameter. At the same time rename the function to p2m_flush_tlb to match the parameter change. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/p2m.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index bda9b97..97a3a2b 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -137,9 +137,8 @@ void p2m_restore_state(struct vcpu *n) isb(); } -static void flush_tlb_domain(struct domain *d) +static void p2m_flush_tlb(struct p2m_domain *p2m) { - struct p2m_domain *p2m = &d->arch.p2m; unsigned long flags = 0; uint64_t ovttbr; @@ -1157,7 +1156,7 @@ static int apply_p2m_changes(struct domain *d, out: if ( flush ) { - flush_tlb_domain(d); + p2m_flush_tlb(&d->arch.p2m); ret = iommu_iotlb_flush(d, gfn_x(sgfn), nr); if ( !rc ) rc = ret; @@ -1302,7 +1301,7 @@ static int p2m_alloc_table(struct domain *d) * Make sure that all TLBs corresponding to the new VMID are flushed * before using it */ - flush_tlb_domain(d); + p2m_flush_tlb(p2m); return 0; }