Re: [PATCH V8 26/44] x86/fault: Print PKS MSR on fault

From: Dave Hansen
Date: Fri Feb 18 2022 - 15:28:28 EST


On 2/18/22 09:28, Edgecombe, Rick P wrote:
> On Thu, 2022-02-17 at 22:01 -0800, Ira Weiny wrote:
>> Are you suggesting the PKRU should be printed instead or in addition
>> to the
>> PKS?
> Well I was just thinking that PKRS should only be printed if it's an
> access via a supervisor pte.

That's not *wrong* per se, but it's not what we do for PKU:

if (cpu_feature_enabled(X86_FEATURE_OSPKE))
printk("%sPKRU: %08x\n", log_lvl, read_pkru());

If the feature is enabled, we print the register. We don't try to be
fancy and decide if it's relevant to the oops. Why don't you just stick
PKRS on the same line as PKRU whenever it's supported?