lkml.org 
[lkml]   [2018]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/7] x86/microcode: Recheck IBRS features on microcode reload
Date
On new microcode write, check whether IBRS
is present by rescanning scattered CPU features.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
arch/x86/kernel/cpu/microcode/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c4fa4a8..44b9355 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -40,6 +40,7 @@
#include <asm/processor.h>
#include <asm/cmdline.h>
#include <asm/setup.h>
+#include <asm/spec_ctrl.h>

#define DRIVER_VERSION "2.2"

@@ -444,6 +445,11 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,
if (ret > 0)
perf_check_microcode();

+ /* check spec_ctrl capabilities */
+ mutex_lock(&spec_ctrl_mutex);
+ init_scattered_cpuid_features(&boot_cpu_data);
+ mutex_unlock(&spec_ctrl_mutex);
+
mutex_unlock(&microcode_mutex);
put_online_cpus();

--
2.9.4
\
 
 \ /
  Last update: 2018-01-04 19:18    [W:0.539 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site