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: kvmarm@lists.linux.dev 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 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 13B66C4167B for ; Mon, 4 Dec 2023 18:47:15 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cC5RyRAz32cibxXhWky+RjIjaePKyra8KqqbVvsbEpg=; b=W5dZQyz6MRgDha dsbjue6k3Y3tKLs/DBsWPzpxnYqDEIyAJbEPTzgBVFQlCw5AyfuCsJ4sS6lMOWHeDkN1M5EcIbo49 MFwbhzTuP+5QBxGqZ1c4WQoFefdYLz/hBX+NKEEi+1U1k7BWxri4MSA4kapHkqI3uGZyK1+pnpIU2 zKQ8UUAxfVuggAZW5ioVFcJWHXHcvvsJrzHOpLY8+8C2Q1mwt2NFdUmzAGuChJyebyvuavfuxUnXg TYjeZ5z7wcuhgYaO047QuauctXFz+fx/M4MPYy8He00BBpo5RYNUS6Gjr7eODhNvlfAPm3gN2Ren4 Fp/NBV8bePx1sG9Lljug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rADxz-005M7H-38; Mon, 04 Dec 2023 18:46:52 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rADxx-005M5z-0B for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2023 18:46:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 9031ECE0FCE; 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231124163510.1835740-4-joey.gouly@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231204_104649_320136_48AE457B X-CRM114-Status: GOOD ( 15.80 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel