tree: https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git release head: 1346f469e231ea4eb4ddc130f3e34a5a127a445e commit: 9c30af26b775133f5795280ab23eefdca0663f8f [27/30] x86: Add core HWP feature enabling support config: x86_64-randconfig-i0-201613 (attached as .config) reproduce: git checkout 9c30af26b775133f5795280ab23eefdca0663f8f # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/linux/linkage.h:4:0, from include/linux/kernel.h:6, from arch/x86/kernel/cpu/intel.c:1: arch/x86/kernel/cpu/intel.c: In function 'intel_hwp_disable': >> arch/x86/include/asm/disabled-features.h:38:25: warning: left shift count >= width of type [-Wshift-count-overflow] # define DISABLE_PKU (1<<(X86_FEATURE_PKU)) ^ include/linux/compiler.h:151:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/intel.c:421:2: note: in expansion of macro 'if' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ >> arch/x86/include/asm/disabled-features.h:64:26: note: in expansion of macro 'DISABLE_PKU' #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) ^ >> arch/x86/include/asm/cpufeature.h:87:43: note: in expansion of macro 'DISABLED_MASK16' (((bit)>>5)==14 && (1UL<<((bit)&31) & DISABLED_MASK16)) ) ^ >> arch/x86/include/asm/cpufeature.h:106:32: note: in expansion of macro 'DISABLED_MASK_BIT_SET' (__builtin_constant_p(bit) && DISABLED_MASK_BIT_SET(bit) ? 0 : static_cpu_has(bit)) ^ >> arch/x86/kernel/cpu/intel.c:421:7: note: in expansion of macro 'cpu_feature_enabled' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ arch/x86/include/asm/disabled-features.h:39:27: warning: left shift count >= width of type [-Wshift-count-overflow] # define DISABLE_OSPKE (1<<(X86_FEATURE_OSPKE)) ^ include/linux/compiler.h:151:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/intel.c:421:2: note: in expansion of macro 'if' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ >> arch/x86/include/asm/disabled-features.h:64:38: note: in expansion of macro 'DISABLE_OSPKE' #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) ^ >> arch/x86/include/asm/cpufeature.h:87:43: note: in expansion of macro 'DISABLED_MASK16' (((bit)>>5)==14 && (1UL<<((bit)&31) & DISABLED_MASK16)) ) ^ >> arch/x86/include/asm/cpufeature.h:106:32: note: in expansion of macro 'DISABLED_MASK_BIT_SET' (__builtin_constant_p(bit) && DISABLED_MASK_BIT_SET(bit) ? 0 : static_cpu_has(bit)) ^ >> arch/x86/kernel/cpu/intel.c:421:7: note: in expansion of macro 'cpu_feature_enabled' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ >> arch/x86/include/asm/disabled-features.h:38:25: warning: left shift count >= width of type [-Wshift-count-overflow] # define DISABLE_PKU (1<<(X86_FEATURE_PKU)) ^ include/linux/compiler.h:151:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/intel.c:421:2: note: in expansion of macro 'if' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ >> arch/x86/include/asm/disabled-features.h:64:26: note: in expansion of macro 'DISABLE_PKU' #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) ^ >> arch/x86/include/asm/cpufeature.h:87:43: note: in expansion of macro 'DISABLED_MASK16' (((bit)>>5)==14 && (1UL<<((bit)&31) & DISABLED_MASK16)) ) ^ >> arch/x86/include/asm/cpufeature.h:106:32: note: in expansion of macro 'DISABLED_MASK_BIT_SET' (__builtin_constant_p(bit) && DISABLED_MASK_BIT_SET(bit) ? 0 : static_cpu_has(bit)) ^ >> arch/x86/kernel/cpu/intel.c:421:7: note: in expansion of macro 'cpu_feature_enabled' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ arch/x86/include/asm/disabled-features.h:39:27: warning: left shift count >= width of type [-Wshift-count-overflow] # define DISABLE_OSPKE (1<<(X86_FEATURE_OSPKE)) ^ include/linux/compiler.h:151:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/intel.c:421:2: note: in expansion of macro 'if' if (!cpu_feature_enabled(X86_FEATURE_HWP)) ^ >> arch/x86/include/asm/disabled-features.h:64:38: note: in expansion of macro 'DISABLE_OSPKE' #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) ^ >> arch/x86/include/asm/cpufeature.h:87:43: note: in expansion of macro 'DISABLED_MASK16' (((bit)>>5)==14 && (1UL<<((bit)&31) & DISABLED_MASK16)) ) ^ vim +38 arch/x86/include/asm/disabled-features.h 9298b815 Dave Hansen 2014-09-11 32 # define DISABLE_K6_MTRR 0 9298b815 Dave Hansen 2014-09-11 33 # define DISABLE_CYRIX_ARR 0 9298b815 Dave Hansen 2014-09-11 34 # define DISABLE_CENTAUR_MCR 0 9298b815 Dave Hansen 2014-09-11 35 #endif /* CONFIG_X86_64 */ 9298b815 Dave Hansen 2014-09-11 36 dfb4a70f Dave Hansen 2016-02-12 37 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS dfb4a70f Dave Hansen 2016-02-12 @38 # define DISABLE_PKU (1<<(X86_FEATURE_PKU)) dfb4a70f Dave Hansen 2016-02-12 @39 # define DISABLE_OSPKE (1<<(X86_FEATURE_OSPKE)) dfb4a70f Dave Hansen 2016-02-12 40 #else dfb4a70f Dave Hansen 2016-02-12 41 # define DISABLE_PKU 0 dfb4a70f Dave Hansen 2016-02-12 42 # define DISABLE_OSPKE 0 dfb4a70f Dave Hansen 2016-02-12 43 #endif /* CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS */ dfb4a70f Dave Hansen 2016-02-12 44 381aa07a Dave Hansen 2014-09-11 45 /* 381aa07a Dave Hansen 2014-09-11 46 * Make sure to add features to the correct mask 381aa07a Dave Hansen 2014-09-11 47 */ 9298b815 Dave Hansen 2014-09-11 48 #define DISABLED_MASK0 (DISABLE_VME) 381aa07a Dave Hansen 2014-09-11 49 #define DISABLED_MASK1 0 381aa07a Dave Hansen 2014-09-11 50 #define DISABLED_MASK2 0 9298b815 Dave Hansen 2014-09-11 51 #define DISABLED_MASK3 (DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR) 381aa07a Dave Hansen 2014-09-11 52 #define DISABLED_MASK4 0 381aa07a Dave Hansen 2014-09-11 53 #define DISABLED_MASK5 0 381aa07a Dave Hansen 2014-09-11 54 #define DISABLED_MASK6 0 9c30af26 Len Brown 2015-11-05 55 #define DISABLED_MASK7 (DISABLE_HWP) 381aa07a Dave Hansen 2014-09-11 56 #define DISABLED_MASK8 0 95290cf1 Dave Hansen 2014-11-14 57 #define DISABLED_MASK9 (DISABLE_MPX) dfb4a70f Dave Hansen 2016-02-12 58 #define DISABLED_MASK10 0 dfb4a70f Dave Hansen 2016-02-12 59 #define DISABLED_MASK11 0 dfb4a70f Dave Hansen 2016-02-12 60 #define DISABLED_MASK12 0 dfb4a70f Dave Hansen 2016-02-12 61 #define DISABLED_MASK13 0 dfb4a70f Dave Hansen 2016-02-12 62 #define DISABLED_MASK14 0 dfb4a70f Dave Hansen 2016-02-12 63 #define DISABLED_MASK15 0 dfb4a70f Dave Hansen 2016-02-12 @64 #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) 381aa07a Dave Hansen 2014-09-11 65 381aa07a Dave Hansen 2014-09-11 66 #endif /* _ASM_X86_DISABLED_FEATURES_H */ :::::: The code at line 38 was first introduced by commit :::::: dfb4a70f20c5b3880da56ee4c9484bdb4e8f1e65 x86/cpufeature, x86/mm/pkeys: Add protection keys related CPUID definitions :::::: TO: Dave Hansen :::::: CC: Ingo Molnar --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation