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

From: Ira Weiny
Date: Fri Feb 18 2022 - 15:54:17 EST


On Fri, Feb 18, 2022 at 12:20:58PM -0800, Dave Hansen wrote:
> 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?

Ah good point. I'll do that.

Thanks,
Ira