]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86: Add STIBP feature enumeration
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 29 Dec 2017 19:11:17 +0000 (14:11 -0500)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:19:54 +0000 (10:19 -0800)
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 <dwmw@amazon.co.uk>
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/include/asm/cpufeature.h
arch/x86/kernel/cpu/scattered.c

index 8066d416688efc4803938b83a4eb0ca5a5424814..cd6b45162058b6610bfa94aae5bb47f115d72ee0 100644 (file)
 #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 */
 
index cb5b927a0470d6e08ac347325b149de92d2c4197..a903a94900c5a55cbaaa4ee70b6bbe69639f9729 100644 (file)
@@ -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 },