diff options
Diffstat (limited to 'arch/x86/include/asm/cpufeature.h')
| -rw-r--r-- | arch/x86/include/asm/cpufeature.h | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 91f3e087cf21..71cc3800712c 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -125,7 +125,7 @@  #define X86_FEATURE_OSXSAVE	(4*32+27) /* "" XSAVE enabled in the OS */  #define X86_FEATURE_AVX		(4*32+28) /* Advanced Vector Extensions */  #define X86_FEATURE_F16C	(4*32+29) /* 16-bit fp conversions */ -#define X86_FEATURE_RDRND	(4*32+30) /* The RDRAND instruction */ +#define X86_FEATURE_RDRAND	(4*32+30) /* The RDRAND instruction */  #define X86_FEATURE_HYPERVISOR	(4*32+31) /* Running on a hypervisor */  /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ @@ -195,6 +195,8 @@  /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */  #define X86_FEATURE_FSGSBASE	(9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/ +#define X86_FEATURE_SMEP	(9*32+ 7) /* Supervisor Mode Execution Protection */ +#define X86_FEATURE_ERMS	(9*32+ 9) /* Enhanced REP MOVSB/STOSB */  #if defined(__KERNEL__) && !defined(__ASSEMBLY__) @@ -207,8 +209,7 @@ extern const char * const x86_power_flags[32];  #define test_cpu_cap(c, bit)						\  	 test_bit(bit, (unsigned long *)((c)->x86_capability)) -#define cpu_has(c, bit)							\ -	(__builtin_constant_p(bit) &&					\ +#define REQUIRED_MASK_BIT_SET(bit)					\  	 ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0)) ||	\  	   (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1)) ||	\  	   (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2)) ||	\ @@ -218,10 +219,16 @@ extern const char * const x86_power_flags[32];  	   (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) ||	\  	   (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) ||	\  	   (((bit)>>5)==8 && (1UL<<((bit)&31) & REQUIRED_MASK8)) ||	\ -	   (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) )	\ -	  ? 1 :								\ +	   (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) + +#define cpu_has(c, bit)							\ +	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :	\  	 test_cpu_cap(c, bit)) +#define this_cpu_has(bit)						\ +	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : 	\ +	 x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability)) +  #define boot_cpu_has(bit)	cpu_has(&boot_cpu_data, bit)  #define set_cpu_cap(c, bit)	set_bit(bit, (unsigned long *)((c)->x86_capability)) |