summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/microcode/internal.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2023-10-17 23:24:16 +0200
committerBorislav Petkov (AMD) <bp@alien8.de>2023-10-24 15:05:55 +0200
commit9407bda845dd19756e276d4f3abc15a20777ba45 (patch)
tree6bde9bdf4bacb4aedc78fbca49dad5dd0ed184e7 /arch/x86/kernel/cpu/microcode/internal.h
parent8f849ff63bcbc77670da03cb8f2b78b06257f455 (diff)
x86/microcode: Prepare for minimal revision check
Applying microcode late can be fatal for the running kernel when the update changes functionality which is in use already in a non-compatible way, e.g. by removing a CPUID bit. There is no way for admins which do not have access to the vendors deep technical support to decide whether late loading of such a microcode is safe or not. Intel has added a new field to the microcode header which tells the minimal microcode revision which is required to be active in the CPU in order to be safe. Provide infrastructure for handling this in the core code and a command line switch which allows to enforce it. If the update is considered safe the kernel is not tainted and the annoying warning message not emitted. If it's enforced and the currently loaded microcode revision is not safe for late loading then the load is aborted. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231017211724.079611170@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/internal.h')
-rw-r--r--arch/x86/kernel/cpu/microcode/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/microcode/internal.h b/arch/x86/kernel/cpu/microcode/internal.h
index 1a396fc65d4e..f8047b12329a 100644
--- a/arch/x86/kernel/cpu/microcode/internal.h
+++ b/arch/x86/kernel/cpu/microcode/internal.h
@@ -13,6 +13,7 @@ struct device;
enum ucode_state {
UCODE_OK = 0,
UCODE_NEW,
+ UCODE_NEW_SAFE,
UCODE_UPDATED,
UCODE_NFOUND,
UCODE_ERROR,
@@ -88,6 +89,7 @@ static inline unsigned int x86_cpuid_family(void)
}
extern bool dis_ucode_ldr;
+extern bool force_minrev;
#ifdef CONFIG_CPU_SUP_AMD
void load_ucode_amd_bsp(unsigned int family);