From: Konrad Rzeszutek Wilk Date: Fri, 29 Dec 2017 19:11:17 +0000 (-0500) Subject: x86: Add STIBP feature enumeration X-Git-Tag: v4.1.12-124.31.3~1418 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e709ccb70be290853364ecd1c28674f8dc8cfab2;p=users%2Fjedix%2Flinux-maple.git x86: Add STIBP feature enumeration Enumerate single thread indirect branch predictors (STIBP) feature. It provides means to prevent indirect branch predictions from being controlled by sibling HW thread. Orabug: 27344012 CVE: CVE-2017-5715 Signed-off-by: David Woodhouse Signed-off-by: Tim Chen Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: John Haxby Signed-off-by: Kirtikar Kashyap --- diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 8066d416688e..cd6b45162058 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -197,6 +197,7 @@ #define X86_FEATURE_HWP_PKG_REQ ( 7*32+14) /* Intel HWP_PKG_REQ */ #define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */ #define X86_FEATURE_SPEC_CTRL ( 7*32+19) /* Control Speculation Control */ +#define X86_FEATURE_STIPB ( 7*32+20) /* Single Thread Indirect Branch Predictors */ #define X86_FEATURE_IA32_ARCH_CAPS ( 7*32+21) /* Control Speculation Control */ #define X86_FEATURE_IBRS_ATT ( 7*32+22) /* IBRS all the time */ diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index cb5b927a0470..a903a94900c5 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -48,6 +48,7 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c) { X86_FEATURE_CPB, CR_EDX, 9, 0x80000007, 0 }, { X86_FEATURE_PROC_FEEDBACK, CR_EDX,11, 0x80000007, 0 }, { X86_FEATURE_SPEC_CTRL, CR_EDX,26, 0x00000007, 0 }, + { X86_FEATURE_STIPB, CR_EDX,27, 0x00000007, 0 }, { X86_FEATURE_IA32_ARCH_CAPS, CR_EDX,29, 0x00000007, 0 }, { X86_FEATURE_NPT, CR_EDX, 0, 0x8000000a, 0 }, { X86_FEATURE_LBRV, CR_EDX, 1, 0x8000000a, 0 },