Re: [PATCH V8 07/44] x86/pkeys: Add PKS CPU feature bit

From: Dave Hansen
Date: Fri Jan 28 2022 - 18:05:51 EST


On 1/27/22 09:54, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> Protection Keys for Supervisor pages (PKS) enables fast, hardware thread
> specific, manipulation of permission restrictions on supervisor page

Nit: should be "hardware-thread-specific".

> mappings. It uses the same mechanism of Protection Keys as those on
> User mappings but applies that mechanism to supervisor mappings using a
> supervisor specific MSR.

"supervisor-specific"

Memory Protection Keys (pkeys) provides a mechanism for
enforcing page-based protections, but without requiring
modification of the page tables when an application changes
protection domains.

The kernel currently supports the pkeys for userspace (PKU)
architecture. That architecture has been extended to
additionally support supervisor mappings. The supervisor
support is referred to as PKS.

I probably wouldn't mention the MSR unless you want to say:

The main difference between PKU and PKS is that PKS does not
introduce any new instructions to write to its register. The
register is exposed as a normal MSR and is accessed with the
normal MSR instructions.


> The CPU indicates support for PKS in bit 31 of the ECX register after a
> cpuid instruction.

I'd just remove this sentence. We don't need to rehash each tiny morsel
of the architecture in a commit message.