Skip to content

Commit 17a7243

Browse files
hansendcZhengShunQian
authored andcommitted
x86/mm/pkeys: Fix mismerge of protection keys CPUID bits
commit 0d47638 upstream Kirill Shutemov pointed this out to me. The tip tree currently has commit: dfb4a70 [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 <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Acked-by: Borislav Petkov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Srivatsa S. Bhat <[email protected]> Reviewed-by: Matt Helsley (VMware) <[email protected]> Reviewed-by: Alexey Makhalov <[email protected]> Reviewed-by: Bo Gan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b42a4bf commit 17a7243

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/x86/include/asm/cpufeature.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
9494
(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
9595
x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability))
9696

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-
10197
/*
10298
* This macro is for detection of features which need kernel
10399
* infrastructure to be used. It may *not* directly test the CPU

arch/x86/include/asm/cpufeatures.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@
276276
#define X86_FEATURE_PAUSEFILTER (15*32+10) /* filtered pause intercept */
277277
#define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */
278278

279+
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */
280+
#define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
281+
#define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
282+
279283
/*
280284
* BUG word(s)
281285
*/

0 commit comments

Comments
 (0)