[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c4a8275-236d-67b6-07f9-5e46f66396c0@intel.com>
Date: Fri, 28 Jan 2022 14:54:26 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: ira.weiny@...el.com, Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Dan Williams <dan.j.williams@...el.com>
Cc: Fenghua Yu <fenghua.yu@...el.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V8 06/44] mm/pkeys: Add Kconfig options for PKS
On 1/27/22 09:54, ira.weiny@...el.com wrote:
> From: Ira Weiny <ira.weiny@...el.com>
>
> Protection Key Supervisor, PKS, is a feature used by kernel code only.
> As such if no kernel users are configured the PKS code is unnecessary
> overhead.
>
> Define a Kconfig structure which allows kernel code to detect PKS
> support by an architecture and then subsequently enable that support
> within the architecture.
>
> ARCH_HAS_SUPERVISOR_PKEYS indicates to kernel consumers that an
> architecture supports pkeys. PKS users can then select
> ARCH_ENABLE_SUPERVISOR_PKEYS to turn on the support within the
> architecture.
>
> If ARCH_ENABLE_SUPERVISOR_PKEYS is not selected architectures avoid the
> PKS overhead.
>
> ARCH_ENABLE_SUPERVISOR_PKEYS remains off until the first kernel use case
> sets it.
This is heavy on the "what" and weak on the "why".
Why isn't this an x86-specific Kconfig? Why do we need two Kconfigs?
Good old user pkeys only has one:
config ARCH_HAS_PKEYS
bool
and it's in arch-generic code because there are ppc and x86
implementations *and* the pkey support touches generic code.
This might become evident later in the series, but it's clear as mud as
it stands.
Powered by blists - more mailing lists