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

From: Dave Hansen
Date: Fri Jan 28 2022 - 17:44:18 EST


On 1/27/22 09:54, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> 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@xxxxxxxxx>

Either way, this looks fine:

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>