lkml.org 
[lkml]   [2019]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 12/22] x86/fpu: Only write PKRU if it is different from current
From
Date
On 2/21/19 3:50 AM, Sebastian Andrzej Siewior wrote:
> @@ -111,6 +111,12 @@ static inline void __write_pkru(u32 pkru)
> {
> u32 ecx = 0, edx = 0;
>
> + /*
> + * WRPKRU is relatively expensive compared to RDPKRU.
> + * Avoid WRPKRU when it would not change the value.
> + */
> + if (pkru == __read_pkru())
> + return;
> /*
> * "wrpkru" instruction. Loads contents in EAX to PKRU,
> * requires that ecx = edx = 0.

Could we do this in write_pkru() instead? I tried to keep the __
versions of read and write as simple and symmetric as possible.

\
 
 \ /
  Last update: 2019-02-25 19:09    [W:0.139 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site