Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/mm/pkeys: Fix mismerge of protection keys CPUID bits

Kirill Shutemov pointed this out to me.

The tip tree currently has commit:

dfb4a70f2 [x86/cpufeature, x86/mm/pkeys: Add protection keys related CPUID definitions]

whioch added support for two new CPUID bits: X86_FEATURE_PKU and
X86_FEATURE_OSPKE. But, those bits were mis-merged and put in
cpufeature.h instead of cpufeatures.h.

This didn't cause any breakage *except* it keeps the "ospke" and
"pku" bits from showing up in cpuinfo.

Now cpuinfo has the two new flags:

flags : ... pku ospke

BTW, is it really wise to have cpufeature.h and cpufeatures.h?
It seems like they can only cause confusion and mahem with tab
completion.

Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160310221213.06F9DB53@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Dave Hansen and committed by
Ingo Molnar
0d47638f 49cd53bf

+4 -4
-4
arch/x86/include/asm/cpufeature.h
··· 94 94 (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ 95 95 x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability)) 96 96 97 - /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */ 98 - #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */ 99 - #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */ 100 - 101 97 /* 102 98 * This macro is for detection of features which need kernel 103 99 * infrastructure to be used. It may *not* directly test the CPU
+4
arch/x86/include/asm/cpufeatures.h
··· 270 270 #define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */ 271 271 #define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */ 272 272 273 + /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */ 274 + #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */ 275 + #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */ 276 + 273 277 /* 274 278 * BUG word(s) 275 279 */