From patchwork Wed Jul 20 16:10:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 72443 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp66438qga; Wed, 20 Jul 2016 09:14:11 -0700 (PDT) X-Received: by 10.36.33.197 with SMTP id e188mr43781458ita.42.1469031249629; Wed, 20 Jul 2016 09:14:09 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g28si2544149ioi.148.2016.07.20.09.14.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 09:14:09 -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 1bPu6B-0007um-AP; Wed, 20 Jul 2016 16:11:51 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPu68-0007nP-M2 for xen-devel@lists.xen.org; Wed, 20 Jul 2016 16:11:49 +0000 Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id 40/DB-03469-2C2AF875; Wed, 20 Jul 2016 16:11:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTffQov5 wg4l/WSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyZz3azFexlrdgx/y1zA+Meli5GLg4hgU2M EndubIZyTjNKHPu6nbGLkZODTUBT4s7nT0wgtoiAtMS1z5cZQYqYBdoZJZZv/McCkhAWCJP41 bWIHcRmEVCV+Li4m62LkYODV8BV4s3iQJCwhICcxMljk1lBbE6g8PmTP8HmCwm4SGx6+415Ai P3AkaGVYwaxalFZalFuoZGeklFmekZJbmJmTm6hoYmermpxcWJ6ak5iUnFesn5uZsYgR5mAII djGenOR9ilORgUhLlVRXtDRfiS8pPqcxILM6ILyrNSS0+xCjDwaEkwbt4YX+4kGBRanpqRVpm DjDUYNISHDxKIry/QNK8xQWJucWZ6RCpU4y6HAt+3F7LJMSSl5+XKiXOuw2kSACkKKM0D24EL OwvMcpKCfMyAh0lxFOQWpSbWYIq/4pRnINRSZj3MMgUnsy8ErhNr4COYAI6Yo4A2BEliQgpqQ bGyq6Chby3L3Kc8d3I4XYwijXUxU77j/6skwwvV4lxp1i6PLkiHjh5k6VL28nWsqJ1LLO7JSp M1eafej7/yrqWS+/iS2wbLbyynqU8Wtk83c38X+gGvmPsL48q965gt7XhjnvVsd9HY78HS3Ji 7robuzfd6Ple37b2zNpIvzlNr9MFzz3Pu/pTiaU4I9FQi7moOBEA195U+3YCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1469031105!55040193!1 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 46677 invoked from network); 20 Jul 2016 16:11:45 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-10.tower-27.messagelabs.com with SMTP; 20 Jul 2016 16:11: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 E1924BFD; Wed, 20 Jul 2016 09:12:55 -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 41CA63F387; Wed, 20 Jul 2016 09:11:44 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 20 Jul 2016 17:10:59 +0100 Message-Id: <1469031064-23344-18-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469031064-23344-1-git-send-email-julien.grall@arm.com> References: <1469031064-23344-1-git-send-email-julien.grall@arm.com> Cc: proskurin@sec.in.tum.de, Julien Grall , sstabellini@kernel.org, wei.chen@linaro.org, steve.capper@arm.com Subject: [Xen-devel] [PATCH 17/22] xen/arm: p2m: Don't need to restore the state for an idle vCPU. 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 p2m_restore_state could be called with an idle vCPU in arguments (when called by construct_dom0). However, we will never return to EL0/EL1 in this case, so it is not necessary to restore the p2m registers. Signed-off-by: Julien Grall --- xen/arch/arm/p2m.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index c52081a..d1b6009 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -127,6 +127,9 @@ void p2m_restore_state(struct vcpu *n) { register_t hcr; + if ( is_idle_vcpu(n) ) + return; + hcr = READ_SYSREG(HCR_EL2); WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2); isb();