From nobody Tue Apr 7 19:54:15 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E950036493E; Fri, 27 Feb 2026 17:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772215038; cv=none; b=Ee8XEmjoxbDlKHNJf7C4esbhcrHqT/XKZwTy7IoRq6txX1F32RvrrrDJV6Me1vHHhjNhpFdGBl+d1UmW5v2zeOYECKHamqTPHGmavZ6IKDUvYcpPu9z5powcAEoB7v8u+EKEQuE91ScvNXRfZzid3Raf4GDGZ0H8yfFT5D9vNSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772215038; c=relaxed/simple; bh=eS/259s5DMIynGSurv+u0jrg82ixJNHzuIvHfDQvzfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PLiFvYgLxKPAj/xSn5GRZC6r5azuxkN1hKJl2obaA4lGLKEfrMDcTRZzAZMR6UVBRm/emJVvQL2DN1PA6W4bSHgwnMrvuxFYhuFeE4GkXG/gF9mn4NCYMNGJtifAl/Snh7u6C+25m0oP48ApkpMDnlyDks+gFOhbnxUVDOKhwhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 14A131516; Fri, 27 Feb 2026 09:57:11 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F40283F73B; Fri, 27 Feb 2026 09:57:12 -0800 (PST) From: Kevin Brodsky To: linux-hardening@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Andrew Morton , Andy Lutomirski , Catalin Marinas , Dave Hansen , David Hildenbrand , Ira Weiny , Jann Horn , Jeff Xu , Joey Gouly , Kees Cook , Linus Walleij , Lorenzo Stoakes , Marc Zyngier , Mark Brown , Matthew Wilcox , Maxwell Bland , "Mike Rapoport (IBM)" , Peter Zijlstra , Pierre Langlois , Quentin Perret , Rick Edgecombe , Ryan Roberts , Thomas Gleixner , Vlastimil Babka , Will Deacon , Yang Shi , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, x86@kernel.org Subject: [PATCH v6 20/30] arm64: cpufeature: Add helper to directly probe CPU for POE support Date: Fri, 27 Feb 2026 17:55:08 +0000 Message-ID: <20260227175518.3728055-21-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260227175518.3728055-1-kevin.brodsky@arm.com> References: <20260227175518.3728055-1-kevin.brodsky@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In order to support the kpkeys_hardened_pgtables feature, we will need to decide how to allocate early page tables, before boot CPU features have been detected. To that end, add a new helper to check that the boot CPU supports POE (meaning POE will eventually be enabled). Signed-off-by: Kevin Brodsky --- arch/arm64/include/asm/cpufeature.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/c= pufeature.h index 4de51f8d92cb..8722e9e62702 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -1078,6 +1078,18 @@ static inline bool cpu_has_lpa2(void) #endif } =20 +static inline bool cpu_has_poe(void) +{ + u64 mmfr3; + + if (!IS_ENABLED(CONFIG_ARM64_POE)) + return false; + + mmfr3 =3D read_sysreg_s(SYS_ID_AA64MMFR3_EL1); + return cpuid_feature_extract_unsigned_field(mmfr3, + ID_AA64MMFR3_EL1_S1POE_SHIFT); +} + #endif /* __ASSEMBLER__ */ =20 #endif --=20 2.51.2