diff mbox series

[SRU,Xenial,5/6] UBUNTU: SAUCE: x86/pti: Evaluate X86_BUG_CPU_MELTDOWN when pti=auto

Message ID 20180530113817.14784-6-juergh@canonical.com
State New
Headers show
Series Fixups for CVE-2018-3639 (x86) | expand

Commit Message

Juerg Haefliger May 30, 2018, 11:38 a.m. UTC
CVE-2018-3639 (x86)

Commit f93e1bcdb1dd ("x86/pti: Do not enable PTI on CPUs which are not
vulnerable to Meltdown") introduced a smarter detection of CPUs that
are not affected by Meltdown. Make use of that when pti=auto which also
matches Linus' tree.

While at it, remove the unused variable 'enable'.

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
---
 arch/x86/mm/kaiser.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c
index 7a72e32e4806..5a2d27a880e9 100644
--- a/arch/x86/mm/kaiser.c
+++ b/arch/x86/mm/kaiser.c
@@ -278,7 +278,6 @@  static void __init kaiser_init_all_pgds(void)
 
 void __init kaiser_check_boottime_disable(void)
 {
-	bool enable = true;
 	char arg[5];
 	int ret;
 
@@ -301,13 +300,11 @@  void __init kaiser_check_boottime_disable(void)
 		goto disable;
 
 skip:
-	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+	if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
 		goto disable;
 
 enable:
-	if (enable)
-		setup_force_cpu_cap(X86_FEATURE_KAISER);
-
+	setup_force_cpu_cap(X86_FEATURE_KAISER);
 	return;
 
 disable: