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 BE13CC61DD3 for ; Thu, 3 Sep 2026 05:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s15ArRWhYwwRxlZERGDJdbA8DisI2z+EevAmLakLImQ=; b=BAQKZWw2j/bxc+JxDBg9umfDEt AJ9WOVh67cnav0yYQ7XEP4iZVuDJqAgonh15HmqcePM+/Y6tTgdF7sL2yDY9DONGZAZFrKc8N7Z1v aG3T90cqi0GaLb002eAaiMGMH6DLOH3OXIOkDqcbSIGMXFNr9kVl8dTzWoCKkkTghS8xNeEvdruMw dzR9WtkpD586LniGLvv6cpeBLOGjnh6DT+LIbl7ev4RnpV0xBepsvWYZbTwj1i+AZ16sRD1wsSIHi P/SgN7hHzy7f3MHtZVFQdxjL/UfnogG8AseRWpBOQuDFtfvUpcdmkBhfHCJnvIB8UWhQS8BzQ9Dpf 17tqOgxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x20RE-0000000GR6J-0HP8; Thu, 03 Sep 2026 05:56:40 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x20RA-0000000GR5g-2xtY for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2026 05:56:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B4631596; Wed, 2 Sep 2026 22:56:29 -0700 (PDT) Received: from localhost (a079125.arm.com [10.164.21.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FDCE3F673; Wed, 2 Sep 2026 22:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1788414993; bh=DY/csfhtR5YKRxNjL+v1oA5BkKG7eZTRM1aibwpAHZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jy33b5SC5V6MzaplebERlNq+BFlc9TRUI4ImbVVvxIHngkHgnbxv0tzSSVfsfKXe3 im25pVnAOzQ05+j8tOYvftqbvXK5fe2BOtxDIf0L3t+U05xyFehzWRhUpXS4solPgf W74ItVMEC3SFf0Ed9IfLCQ/BgE1K1Fiix7t9JZPo= Date: Thu, 3 Sep 2026 11:26:29 +0530 From: Linu Cherian To: Kevin Brodsky Cc: linux-hardening@vger.kernel.org, Andrew Morton , Andy Lutomirski , Catalin Marinas , Dave Hansen , "David Hildenbrand (Arm)" , Jann Horn , Jeff Xu , Joey Gouly , Kees Cook , Linus Walleij , Marc Zyngier , Mark Brown , Matthew Wilcox , Maxwell Bland , "Mike Rapoport (IBM)" , Peter Zijlstra , Pierre Langlois , =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi , Quentin Perret , Rick Edgecombe , Ryan Roberts , Vlastimil Babka , Will Deacon , Yang Shi , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, x86@kernel.org, Ira Weiny , Lorenzo Stoakes , Thomas Gleixner Subject: Re: [PATCH RFC v9 08/25] arm64: Initialize POR_EL1 register on cpu_resume() Message-ID: References: <20260818-kpkeys-v9-0-743ad31b2c8f@arm.com> <20260818-kpkeys-v9-8-743ad31b2c8f@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260818-kpkeys-v9-8-743ad31b2c8f@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260902_225636_854008_6D363D3D X-CRM114-Status: GOOD ( 17.39 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Kevin, On Tue, Aug 18, 2026 at 03:08:50PM +0100, Kevin Brodsky wrote: > From: Yeoreum Yun > > The POR_EL1 register is reset to an unknown value after cpu_suspend(). > Since POR_EL1 always holds POR_EL1_INIT when entering cpu_suspend(), > initialize POR_EL1 with POR_EL1_INIT before cpu_do_resume(). > > Signed-off-by: Yeoreum Yun > Signed-off-by: Kevin Brodsky > --- > arch/arm64/kernel/sleep.S | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S > index f093cdf71be1..e0a6ad85cd24 100644 > --- a/arch/arm64/kernel/sleep.S > +++ b/arch/arm64/kernel/sleep.S > @@ -3,6 +3,7 @@ > #include > #include > #include > +#include > #include > > .text > @@ -134,6 +135,17 @@ SYM_FUNC_START(_cpu_resume) > /* load sp from context */ > ldr x2, [x0, #CPU_CTX_SP] > mov sp, x2 > + > +#ifdef CONFIG_ARM64_POE > +alternative_if_not ARM64_HAS_S1POE > + b .Lskip_por_set > +alternative_else_nop_endif > + mov_q x2, POR_EL1_INIT > + msr_s SYS_POR_EL1, x2 > + /* isb can be skipped since cpu_do_resume() will do it. */ > +.Lskip_por_set: > +#endif /* CONFIG_ARM64_POE */ Would it be better to move this under__cpu_setup ? -- Linu Cherian