lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 14/44] x86/pkeys: Introduce pks_write_pkrs()
On Fri, Jan 28, 2022 at 04:12:06PM -0800, Dave Hansen wrote:
> On 1/27/22 09:54, ira.weiny@intel.com wrote:
> > Writing to MSR's is inefficient. Even though the underlying
> > WRMSR(MSR_IA32_PKRS) is not serializing (see below), writing to the MSR
> > unnecessarily should be avoided. This is especially true when the value
> > of the PKS protections is unlikely to change from the default often.
>
> This probably needs some context.
>
> The most important pks_write_pkrs() user is in the scheduler, right?

This is also used during exceptions, twice. Those are probably more important.

>
> So, this is really about optimizing that scheduler code for the common
> case where, even when changing threads, the PKRS value does not change.
>
> Can you explain a bit why you expect that to be the common case?

Yes.

Ira

\
 
 \ /
  Last update: 2022-01-29 01:17    [W:0.100 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site