From df245d31a0254da71d97bd54ed1ebc748b96c73f Mon Sep 17 00:00:00 2001
From: Tim Chen <tim.c.chen@linux.intel.com>
Date: Wed, 27 Sep 2017 12:09:14 -0700
Subject: [PATCH 02/22] x86/feature: Report presence of IBPB and IBRS control

CVE-2017-5715 (Spectre v2 Intel)

Report presence of IBPB and IBRS.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 arch/x86/kernel/cpu/intel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index dfa90a3a5145..f1d94c73625a 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -627,6 +627,11 @@ static void init_intel(struct cpuinfo_x86 *c)
 	init_intel_energy_perf(c);
 
 	init_intel_misc_features(c);
+
+	if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
+                printk_once(KERN_INFO "FEATURE SPEC_CTRL Present\n");
+        else
+                printk_once(KERN_INFO "FEATURE SPEC_CTRL Not Present\n");
 }
 
 #ifdef CONFIG_X86_32
-- 
2.15.1

