From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D38FC433EF for ; Sun, 9 Jan 2022 13:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:From:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=pR6Z2v3dY2kj+LPqYwMrJ87Kipoo8Wq+j3KvhG3S/nU=; b=jAuJZYjIfQaPj9 QGoZe23WZ3pFDnkEBBP3g/erV/EdP3xy6b8gyqA4lAimifI2u07nmrA23VRL/M3fERaJJdywT8U8+ qyOBkI+BEIL3ZML1qu4Fr4BJm16j9D1yRPWljM9d/gEZSAJ6+VamN9kahHf7dfCcaEMdCWPXqQGlE P0fXau52qsbEoiTpuFJt5ZcOf4iQIWPb67/rvUzogFEOwaEd05HtF2CjY/VYwuTr9KToh7WL9bjcl WstJ8N/+RSI4uueWMlxRIcjP5BpNdvXnWvui2P0/hqGoa+BfZ5nxILQ5PHRARZpSk5ssaMV+tp7v1 KE2Ht+0jJDQWIxY975jA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6XvI-007qUO-5L; Sun, 09 Jan 2022 13:07:48 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6XvC-007qTp-EK for linux-arm-kernel@lists.infradead.org; Sun, 09 Jan 2022 13:07:46 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C68CE60F2E; Sun, 9 Jan 2022 13:07:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7398C36AEB; Sun, 9 Jan 2022 13:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1641733661; bh=Mp1UIDE+AHNBJcUVhc8wQHDdUlejQjJxr5jRVWoSUNc=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=k6N4AP4bqYhdIQEXI7zEhZjsaKbY8Azou9HLYqeBGdXCAccYv+t7WPMjUM2feBQw9 JuFpH5GgTfXKRkD75pzjelelGu6jsuXUStUtQOEtEAhthN3XLZftSTccgtz0oaG3C0 VeTvIssbnDuQiKGnPWYeu71GLl3UYfDiFwdXdBgk= Subject: Patch "arm64: move !VHE work to end of el2_setup" has been added to the 4.9-stable tree To: catalin.marinas@arm.com, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, marc.zyngier@arm.com, mark.rutland@arm.com, maz@kernel.org, nathan@kernel.org, ndesaulniers@google.com, sashal@kernel.org, will.deacon@arm.com, will@kernel.org Cc: From: Date: Sun, 09 Jan 2022 14:07:38 +0100 In-Reply-To: <20220107194335.3090066-5-nathan@kernel.org> Message-ID: <1641733658197117@kroah.com> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220109_050742_606334_60F393BA X-CRM114-Status: GOOD ( 19.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a note to let you know that I've just added the patch titled arm64: move !VHE work to end of el2_setup to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm64-move-vhe-work-to-end-of-el2_setup.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Jan 9 01:56:51 PM CET 2022 From: Nathan Chancellor Date: Fri, 7 Jan 2022 12:43:34 -0700 Subject: arm64: move !VHE work to end of el2_setup To: Greg Kroah-Hartman , Sasha Levin , Catalin Marinas , Will Deacon Cc: Mark Rutland , Marc Zyngier , Nick Desaulniers , linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, llvm@lists.linux.dev Message-ID: <20220107194335.3090066-5-nathan@kernel.org> From: Mark Rutland commit d61c97a7773d0848b4bf5c4697855c7ce117362c upstream. We only need to initialise sctlr_el1 if we're installing an EL2 stub, so we may as well defer this until we're doing so. Similarly, we can defer intialising CPTR_EL2 until then, as we do not access any trapped functionality as part of el2_setup. This patch modified el2_setup accordingly, allowing us to remove a branch and simplify the code flow. Acked-by: Marc Zyngier Signed-off-by: Mark Rutland Cc: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/head.S | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -553,26 +553,6 @@ set_hcr: msr vpidr_el2, x0 msr vmpidr_el2, x1 - /* - * When VHE is not in use, early init of EL2 and EL1 needs to be - * done here. - * When VHE _is_ in use, EL1 will not be used in the host and - * requires no configuration, and all non-hyp-specific EL2 setup - * will be done via the _EL1 system register aliases in __cpu_setup. - */ - cbnz x2, 1f - - /* sctlr_el1 */ - mov x0, #0x0800 // Set/clear RES{1,0} bits -CPU_BE( movk x0, #0x33d0, lsl #16 ) // Set EE and E0E on BE systems -CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems - msr sctlr_el1, x0 - - /* Coprocessor traps. */ - mov x0, #0x33ff - msr cptr_el2, x0 // Disable copro. traps to EL2 -1: - #ifdef CONFIG_COMPAT msr hstr_el2, xzr // Disable CP15 traps to EL2 #endif @@ -598,6 +578,23 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // C ret install_el2_stub: + /* + * When VHE is not in use, early init of EL2 and EL1 needs to be + * done here. + * When VHE _is_ in use, EL1 will not be used in the host and + * requires no configuration, and all non-hyp-specific EL2 setup + * will be done via the _EL1 system register aliases in __cpu_setup. + */ + /* sctlr_el1 */ + mov x0, #0x0800 // Set/clear RES{1,0} bits +CPU_BE( movk x0, #0x33d0, lsl #16 ) // Set EE and E0E on BE systems +CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems + msr sctlr_el1, x0 + + /* Coprocessor traps. */ + mov x0, #0x33ff + msr cptr_el2, x0 // Disable copro. traps to EL2 + /* Hypervisor stub */ adrp x0, __hyp_stub_vectors add x0, x0, #:lo12:__hyp_stub_vectors Patches currently in stable-queue which might be from nathan@kernel.org are queue-4.9/arm64-sysreg-move-to-use-definitions-for-all-the-sctlr-bits.patch queue-4.9/bug-split-build_bug-stuff-out-into-linux-build_bug.h.patch queue-4.9/arm64-move-vhe-work-to-end-of-el2_setup.patch queue-4.9/arm64-remove-a-redundancy-in-sysreg.h.patch queue-4.9/arm64-reduce-el2_setup-branching.patch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel