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 28D65C433F5 for ; Sun, 9 Jan 2022 13:09:20 +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=R/6KrajnD6JxR0DbvYvS2F65cb3Mn++X6N33ze1a/Wc=; b=mHrucrGmekpzb+ JHQ1ICgXgynOsfeceQ13myga0aRMMCi7zKcZVzb7Bb+ibFfQQR5oJVduqMSiMCkR/tuZvXarosSVW ycywRdjuBmQf9O+4Ep5sy3Rj8iJFy7L7L5Jg9eKkwcFamtrt/1ugTzfwkzy0AKc2QaN4vEF0XMNDo Xagx5tqrbUrPSigZ3RTlFenWPiy6NbbiZVKiOQy+hR682E2f1M1wGdJUtqkymyu9b95EH1KIRlXdM PnobRgycrz87Z+2RfOQoTIStRu0kVwFnj/lltN+UNAmF0QgJXJFyyxAEcTCxAUjRsufdfPxVlM+fK jeH7YYk9oaw6c7nfKonw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6XvR-007qVY-Df; Sun, 09 Jan 2022 13:07:57 +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 1n6XvK-007qUh-T9 for linux-arm-kernel@lists.infradead.org; Sun, 09 Jan 2022 13:07:54 +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 451AC60EEC; Sun, 9 Jan 2022 13:07:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2769EC36AED; Sun, 9 Jan 2022 13:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1641733669; bh=Q0NgM//5V1y957MIzzCyo9ZSojnXHk06TQdjHp9Ivrg=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=jwH2+XI4Rta8mJyZ4pScnAOTmzizKg4JXrcH3qxb1MweM/zYy0w3SJAuSpBAVGwSr soIN5YJVxzkvUnfffamr4eeO6qHEacHy6dPa4Rj3TBvCz9o8yelQkJVsEjZqgYc1ry za92xq8vFB8R/d/CkX5XS8h63ometHlzE8eoSOD8= Subject: Patch "arm64: reduce el2_setup branching" 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-4-nathan@kernel.org> Message-ID: <1641733658226222@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_050751_059776_5602C73C X-CRM114-Status: GOOD ( 17.61 ) 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: reduce el2_setup branching 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-reduce-el2_setup-branching.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:33 -0700 Subject: arm64: reduce el2_setup branching 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-4-nathan@kernel.org> From: Mark Rutland commit 3ad47d055aa88d9f4189253f5b5c485f4c4626b2 upstream. The early el2_setup code is a little convoluted, with two branches where one would do. This makes the code more painful to read than is necessary. We can remove a branch and simplify the logic by moving the early return in the booted-at-EL1 case earlier in the function. This separates it from all the setup logic that only makes sense for EL2. 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 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -489,13 +489,8 @@ ENTRY(el2_setup) msr SPsel, #1 // We want to use SP_EL{1,2} mrs x0, CurrentEL cmp x0, #CurrentEL_EL2 - b.ne 1f - mrs x0, sctlr_el2 -CPU_BE( orr x0, x0, #(1 << 25) ) // Set the EE bit for EL2 -CPU_LE( bic x0, x0, #(1 << 25) ) // Clear the EE bit for EL2 - msr sctlr_el2, x0 - b 2f -1: mrs x0, sctlr_el1 + b.eq 1f + mrs x0, sctlr_el1 CPU_BE( orr x0, x0, #(3 << 24) ) // Set the EE and E0E bits for EL1 CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1 msr sctlr_el1, x0 @@ -503,7 +498,11 @@ CPU_LE( bic x0, x0, #(3 << 24) ) // Clea isb ret -2: +1: mrs x0, sctlr_el2 +CPU_BE( orr x0, x0, #(1 << 25) ) // Set the EE bit for EL2 +CPU_LE( bic x0, x0, #(1 << 25) ) // Clear the EE bit for EL2 + msr sctlr_el2, x0 + #ifdef CONFIG_ARM64_VHE /* * Check for VHE being present. For the rest of the EL2 setup, 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