From patchwork Thu Jul 28 14:20:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 72962 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp880654qga; Thu, 28 Jul 2016 07:24:52 -0700 (PDT) X-Received: by 10.107.131.170 with SMTP id n42mr38975489ioi.126.1469715892371; Thu, 28 Jul 2016 07:24:52 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s4si13341091ios.152.2016.07.28.07.24.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 07:24:52 -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 1bSmB2-0007Ml-QL; Thu, 28 Jul 2016 14:20:44 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSmB1-0007DM-S9 for xen-devel@lists.xen.org; Thu, 28 Jul 2016 14:20:43 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id EC/0E-17152-BB41A975; Thu, 28 Jul 2016 14:20:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTXe3yKx wg8U3mC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy5t4+wFLzmqZjaktHAuJyri5GLQ0hgE6PE vG0XWSGc04wS2x+9Zuxi5ORgE9CUuPP5ExOILSIgLXHt82VGkCJmgXZGibX9vcwgCWGBEIkdi z+DNbAIqEo8mvgDLM4r4CJxaf0jMFtCQE7i5LHJrCA2J1D8Xtt3MFtIwFni9N3t7BMYuRcwMq xi1ChOLSpLLdI1NNVLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAj0MAMQ7GBcs93 zEKMkB5OSKG9Y6MxwIb6k/JTKjMTijPii0pzU4kOMMhwcShK8bsKzwoUEi1LTUyvSMnOAoQaT luDgURLhjQRJ8xYXJOYWZ6ZDpE4xKkqJ8+aCJARAEhmleXBtsPC+xCgrJczLCHSIEE9BalFuZ gmq/CtGcQ5GJWHejSBTeDLzSuCmvwJazAS0uDh2BsjikkSElFQD4969Npq/b2sxqq8z3NGvMO ey/8YPH36ZZcvPLXn7auuud0ev7NLX+nb33Bup+0812Xq3Lzq33O++s9nC3Sd22HoL5zt/WbZ ztpHZubTUK60n2vbGe/y5yVvmFLExeH4W1z5RJqPNedJ+p7PeTOHgK3mU7rJELE43nM9BsGVS 4Mvg/ikLn2ZunazEUpyRaKjFXFScCACmluhUagIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1469715635!26646407!6 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 45222 invoked from network); 28 Jul 2016 14:20:42 -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:42 -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 BC708BBC; Thu, 28 Jul 2016 07:21:59 -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 8C81F3F21A; Thu, 28 Jul 2016 07:20:41 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 28 Jul 2016 15:20:17 +0100 Message-Id: <1469715620-4670-13-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 12/15] xen/arm: p2m: Inline p2m_load_VTTBR into p2m_restore_state 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" p2m_restore_state is the last caller of p2m_load_VTTBR and already check if the vCPU does not belong to the idle domain. Note that it is likely possible to remove some isb in the function p2m_restore_state, however this is not the purpose of this patch. So the numerous isb have been left. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/p2m.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 7ee0171..6a9767c 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -105,19 +105,6 @@ void dump_p2m_lookup(struct domain *d, paddr_t addr) P2M_ROOT_LEVEL, P2M_ROOT_PAGES); } -static void p2m_load_VTTBR(struct domain *d) -{ - struct p2m_domain *p2m = &d->arch.p2m; - - if ( is_idle_domain(d) ) - return; - - ASSERT(p2m->vttbr); - - WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2); - isb(); /* Ensure update is visible */ -} - void p2m_save_state(struct vcpu *p) { p->arch.sctlr = READ_SYSREG(SCTLR_EL1); @@ -126,6 +113,7 @@ void p2m_save_state(struct vcpu *p) void p2m_restore_state(struct vcpu *n) { register_t hcr; + struct p2m_domain *p2m = &n->domain->arch.p2m; if ( is_idle_vcpu(n) ) return; @@ -134,7 +122,7 @@ void p2m_restore_state(struct vcpu *n) WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2); isb(); - p2m_load_VTTBR(n->domain); + WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2); isb(); if ( is_32bit_domain(n->domain) )