From d40e8e726e67ba518869ffd6adec4fae7c0bb35c Mon Sep 17 00:00:00 2001
From: Andy Whitcroft <apw@canonical.com>
Date: Tue, 30 Jan 2018 14:46:27 +0000
Subject: [PATCH 101/131] UBUNTU: SAUCE: claim mitigation via observable
 speculation barrier

CVE-2017-5753 (Spectre v1 Intel)

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 arch/x86/kernel/cpu/bugs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index ba5122a3edf5..a896651724d1 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -278,11 +278,19 @@ ssize_t cpu_show_meltdown(struct device *dev,
 	return sprintf(buf, "Vulnerable\n");
 }
 
+#ifndef osb
+#define osb_is_enabled 	(0)
+#endif
+#ifndef osb_is_enabled
+#define osb_is_enabled	(1)
+#endif
 ssize_t cpu_show_spectre_v1(struct device *dev,
 			    struct device_attribute *attr, char *buf)
 {
 	if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
 		return sprintf(buf, "Not affected\n");
+	if (osb_is_enabled)
+		return sprintf(buf, "Mitigation: OSB (observable speculation barrier, Intel v6)\n");
 	return sprintf(buf, "Vulnerable\n");
 }
 
-- 
2.15.1

