From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C2C5241FC; Mon, 4 Dec 2023 18:46:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3EBAC433C8; Mon, 4 Dec 2023 18:46:42 +0000 (UTC) Date: Mon, 4 Dec 2023 18:46:40 +0000 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, broonie@kernel.org, dave.hansen@linux.intel.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH v3 03/25] arm64: cpufeature: add Permission Overlay Extension cpucap Message-ID: References: <20231124163510.1835740-1-joey.gouly@arm.com> <20231124163510.1835740-4-joey.gouly@arm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124163510.1835740-4-joey.gouly@arm.com> On Fri, Nov 24, 2023 at 04:34:48PM +0000, Joey Gouly wrote: > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2078,6 +2078,22 @@ config ARM64_EPAN > if the cpu does not implement the feature. > endmenu # "ARMv8.7 architectural features" > > +menu "ARMv8.9 architectural features" > +config ARM64_POE > + prompt "Permission Overlay Extension" > + def_bool y > + help > + The Permission Overlay Extension is used to implement Memory > + Protection Keys. Memory Protection Keys provides a mechanism for > + enforcing page-based protections, but without requiring modification > + of the page tables when an application changes protection domains. > + > + For details, see Documentation/core-api/protection-keys.rst > + > + If unsure, say y. > + > +endmenu # "ARMv8.9 architectural features" I agree with Mark, we typically leave the Kconfig option towards the end of the series. > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 646591c67e7a..00b6d516ed3f 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -2731,6 +2731,15 @@ static const struct arm64_cpu_capabilities arm64_features[] = { > .matches = has_cpuid_feature, > ARM64_CPUID_FIELDS(ID_AA64MMFR2_EL1, EVT, IMP) > }, > +#ifdef CONFIG_ARM64_POE > + { > + .desc = "Stage-1 Permission Overlay Extension (S1POE)", > + .capability = ARM64_HAS_S1POE, > + .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, > + .matches = has_cpuid_feature, > + ARM64_CPUID_FIELDS(ID_AA64MMFR3_EL1, S1POE, IMP) > + }, > +#endif Keeping the #ifdef here is ok, it won't be defined at this point. -- Catalin