lkml.org 
[lkml]   [2019]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/22] x86/fpu: Only write PKRU if it is different from current
On 2019-01-23 10:09:24 [-0800], Dave Hansen wrote:
> On 1/9/19 3:47 AM, Sebastian Andrzej Siewior wrote:
> > +static inline void __write_pkru(u32 pkru)
> > +{
> > + /*
> > + * Writting PKRU is expensive. Only write the PKRU value if it is
> > + * different from the current one.
> > + */
>
> I'd say:
>
> WRPKRU is relatively expensive compared to RDPKRU.
> Avoid WRPKRU when it would not change the value.
>
> In the grand scheme of things, WRPKRU is cheap. It's certainly not an
> "expensive instruction" compared to things like WBINVD.

Okay.

> > + if (pkru == __read_pkru())
> > + return;
> > + __write_pkru_insn(pkru);
> > +}
>
> Is there a case where we need __write_pkru_insn() directly? Why not
> just put the inline assembly in here?

There is no user of __write_pkru_insn(). I had one in the past I think.
Let me merge it for now.

Sebastian

\
 
 \ /
  Last update: 2019-02-07 12:28    [W:0.127 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site