diff options
| -rw-r--r-- | arch/x86/include/asm/cpufeature.h | 1 | ||||
| -rw-r--r-- | arch/x86/include/asm/special_insns.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 5f1296872aed..bc507d7640f8 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -221,6 +221,7 @@ | |||
| 221 | #define X86_FEATURE_RDSEED (9*32+18) /* The RDSEED instruction */ | 221 | #define X86_FEATURE_RDSEED (9*32+18) /* The RDSEED instruction */ |
| 222 | #define X86_FEATURE_ADX (9*32+19) /* The ADCX and ADOX instructions */ | 222 | #define X86_FEATURE_ADX (9*32+19) /* The ADCX and ADOX instructions */ |
| 223 | #define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */ | 223 | #define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */ |
| 224 | #define X86_FEATURE_CLFLUSHOPT (9*32+23) /* CLFLUSHOPT instruction */ | ||
| 224 | #define X86_FEATURE_AVX512PF (9*32+26) /* AVX-512 Prefetch */ | 225 | #define X86_FEATURE_AVX512PF (9*32+26) /* AVX-512 Prefetch */ |
| 225 | #define X86_FEATURE_AVX512ER (9*32+27) /* AVX-512 Exponential and Reciprocal */ | 226 | #define X86_FEATURE_AVX512ER (9*32+27) /* AVX-512 Exponential and Reciprocal */ |
| 226 | #define X86_FEATURE_AVX512CD (9*32+28) /* AVX-512 Conflict Detection */ | 227 | #define X86_FEATURE_AVX512CD (9*32+28) /* AVX-512 Conflict Detection */ |
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 645cad2c95ff..e820c080a4e9 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h | |||
| @@ -191,6 +191,14 @@ static inline void clflush(volatile void *__p) | |||
| 191 | asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p)); | 191 | asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p)); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | static inline void clflushopt(volatile void *__p) | ||
| 195 | { | ||
| 196 | alternative_io(".byte " __stringify(NOP_DS_PREFIX) "; clflush %P0", | ||
| 197 | ".byte 0x66; clflush %P0", | ||
| 198 | X86_FEATURE_CLFLUSHOPT, | ||
| 199 | "+m" (*(volatile char __force *)__p)); | ||
| 200 | } | ||
| 201 | |||
| 194 | #define nop() asm volatile ("nop") | 202 | #define nop() asm volatile ("nop") |
| 195 | 203 | ||
| 196 | 204 | ||
