forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0125-x86-microcode-echo-2-reload-to-force-load-ucode.patch
69 lines (56 loc) · 2.01 KB
/
0125-x86-microcode-echo-2-reload-to-force-load-ucode.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ashok Raj <[email protected]>
Date: Sat, 20 Jul 2019 14:14:47 +0000
Subject: [PATCH] x86/microcode: echo 2 > reload to force load ucode.
If you want to force a ucode load even if the version
doesn't change try this
To just do a normal upgrade where new rev > current rev
Signed-off-by: Ashok Raj <[email protected]>
---
arch/x86/kernel/cpu/microcode/core.c | 8 +++++++-
arch/x86/kernel/cpu/microcode/intel.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index fae61bd63ecf..1951b34e45d8 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -618,18 +618,23 @@ static ssize_t reload_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
+ extern bool force_ucode_load;
enum ucode_state tmp_ret = UCODE_OK;
int bsp = boot_cpu_data.cpu_index;
unsigned long val;
+ bool orig_cmd_line = force_ucode_load;
ssize_t ret = 0;
ret = kstrtoul(buf, 0, &val);
if (ret)
return ret;
- if (val != 1)
+ if (!val || val > 2)
return size;
+ if (val == 2)
+ force_ucode_load = true;
+
get_online_cpus();
ret = check_online_cpus();
@@ -645,6 +650,7 @@ static ssize_t reload_store(struct device *dev,
mutex_unlock(µcode_mutex);
put:
+ force_ucode_load = orig_cmd_line;
put_online_cpus();
if (ret == 0)
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index faaa56c05a64..2d2dca21b258 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -39,7 +39,7 @@
#include <asm/msr.h>
static const char ucode_path[] = "kernel/x86/microcode/GenuineIntel.bin";
-static bool force_ucode_load = false;
+bool force_ucode_load = false;
/* Current microcode patch used in early patching on the APs. */
static struct microcode_intel *intel_ucode_patch;
--
https://clearlinux.org