Re: [PATCH V8 03/44] x86/pkeys: Create pkeys_common.h

Dave Hansen
2022-01-28T22:44:18Z

On 1/27/22 09:54, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> Protection Keys User (PKU) and Protection Keys Supervisor (PKS) work in
> similar fashions and can share common defines. Specifically PKS and PKU
> each have:
>
> 1. A single control register
> 2. The same number of keys
> 3. The same number of bits in the register per key
> 4. Access and Write disable in the same bit locations
>
> Given the above, share all the macros that synthesize and manipulate
> register values between the two features. Share these defines by moving
> them into a new header, change their names to reflect the common use,
> and include the header where needed.

I'd probably include *one* more sentence to prime the reader for the
pattern they are about to see. Perhaps:

This mostly takes the form of converting names from the PKU-
specific "PKRU" to the U/S-agnostic "PKR".

> Also while editing the code remove the use of 'we' from comments being
> touched.
>
> NOTE the checkpatch errors are ignored for the init_pkru_value to
> align the values in the code.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Either way, this looks fine:

Acked-by: Dave Hansen <dave.hansen@linux.intel.com>