aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/x86/pkey-helpers.h
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2016-07-29 09:30:23 -0700
committerThomas Gleixner <tglx@linutronix.de>2016-09-09 13:02:28 +0200
commit76de993727d22eb29c716abacfae9d9444bb7897 (patch)
tree833ed2b879ede37c085f62ecd0a9e23bee5bfddd /tools/testing/selftests/x86/pkey-helpers.h
parentx86/pkeys: Default to a restrictive init PKRU (diff)
downloadwireguard-linux-76de993727d22eb29c716abacfae9d9444bb7897.tar.xz
wireguard-linux-76de993727d22eb29c716abacfae9d9444bb7897.zip
x86/pkeys: Allow configuration of init_pkru
As discussed in the previous patch, there is a reliability benefit to allowing an init value for the Protection Keys Rights User register (PKRU) which differs from what the XSAVE hardware provides. But, having PKRU be 0 (its init value) provides some nonzero amount of optimization potential to the hardware. It can, for instance, skip writes to the XSAVE buffer when it knows that PKRU is in its init state. The cost of losing this optimization is approximately 100 cycles per context switch for a workload which lightly using XSAVE state (something not using AVX much). The overhead comes from a combinaation of actually manipulating PKRU and the overhead of pullin in an extra cacheline. This overhead is not huge, but it's also not something that I think we should unconditionally inflict on everyone. So, make it configurable both at boot-time and from debugfs. Changes to the debugfs value affect all processes created after the write to debugfs. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: linux-arch@vger.kernel.org Cc: Dave Hansen <dave@sr71.net> Cc: mgorman@techsingularity.net Cc: arnd@arndb.de Cc: linux-api@vger.kernel.org Cc: linux-mm@kvack.org Cc: luto@kernel.org Cc: akpm@linux-foundation.org Cc: torvalds@linux-foundation.org Link: http://lkml.kernel.org/r/20160729163023.407672D2@viggo.jf.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'tools/testing/selftests/x86/pkey-helpers.h')
0 files changed, 0 insertions, 0 deletions