linux/arch
Dave Hansen d4b05923f5 x86/pkeys: Make protection keys an "eager" feature
Our XSAVE features are divided into two categories: those that
generate FPU exceptions, and those that do not.  MPX and pkeys do
not generate FPU exceptions and thus can not be used lazily.  We
disable them when lazy mode is forced on.

We have a pair of masks to collect these two sets of features, but
XFEATURE_MASK_PKRU was added to the wrong mask: XFEATURE_MASK_LAZY.
Fix it by moving the feature to XFEATURE_MASK_EAGER.

Note: this only causes problem if you boot with lazy FPU mode
(eagerfpu=off) which is *not* the default.  It also only affects
hardware which is not currently publicly available.  It looks like
eager mode is going away, but we still need this patch applied
to any kernel that has protection keys and lazy mode, which is 4.6
through 4.8 at this point, and 4.9 if the lazy removal isn't sent
to Linus for 4.9.

Fixes: c8df400984 ("x86/fpu, x86/mm/pkeys: Add PKRU xsave fields and data structures")
Signed-off-by: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20161007162342.28A49813@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-10-08 12:26:44 +02:00
..
alpha alpha: fix copy_from_user() 2016-09-09 19:34:32 -04:00
arc ARC: [plat*] enables MODULE* 2016-09-30 14:59:48 -07:00
arm Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
arm64 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
avr32 avr32: fix 'undefined reference to `___copy_from_user' 2016-09-18 07:26:26 -07:00
blackfin Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
c6x dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
cris cris: buggered copy_from_user/copy_to_user/clear_user 2016-09-13 17:49:38 -04:00
frv frv: fix clear_user() 2016-09-13 17:49:39 -04:00
h8300 h8300: Add missing include file to asm/io.h 2016-08-13 08:53:56 -07:00
hexagon hexagon: fix strncpy_from_user() error return 2016-09-13 17:49:39 -04:00
ia64 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
m32r m32r: fix __get_user() 2016-09-13 17:50:16 -04:00
m68k m68k updates for 4.8 2016-10-03 17:59:24 -07:00
metag metag: copy_from_user() should zero the destination on access_ok() failure 2016-09-13 17:49:40 -04:00
microblaze Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
mips Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
mn10300 mn10300: copy_from_user() should zero on access_ok() failure... 2016-09-13 17:49:42 -04:00
nios2 nios2: fix __get_user() 2016-09-13 17:49:43 -04:00
openrisc openrisc: fix the fix of copy_from_user() 2016-09-18 07:26:42 -07:00
parisc Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
powerpc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
s390 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
score score: fix copy_from_user() and friends 2016-09-13 17:50:14 -04:00
sh Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
sparc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
tile Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
um um/ptrace: Fix the syscall number update after a ptrace 2016-09-07 09:25:04 -07:00
unicore32 unicore32: mm: Add missing parameter to arch_vma_access_permitted 2016-08-13 08:53:18 -07:00
x86 x86/pkeys: Make protection keys an "eager" feature 2016-10-08 12:26:44 +02:00
xtensa dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
.gitignore
Kconfig Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00