From d26cd66b45df34eccc68058f03c95abb27a0c03e Mon Sep 17 00:00:00 2001 From: leoliu-oc Date: Fri, 29 Mar 2024 11:00:16 +0800 Subject: [PATCH] x86/mce: Set bios_cmci_threshold for CMCI threshold zhaoxin inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9CLFC CVE: NA ----------------- In the Linux kernel, the CMCI threshold is set to 1 by default. This patch prevents Linux from overwriting the CMCI threshold set by the bios. With this patch, the CMCI threshold can be set through the BIOS, which can also avoid CMCI storms, on Zhaoxin/Centaur CPUs. Signed-off-by: leoliu-oc --- arch/x86/kernel/cpu/mce/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 211f83fbcb1b..0e6a004311b9 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1946,6 +1946,7 @@ static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) if (cfg->monarch_timeout < 0) cfg->monarch_timeout = USEC_PER_SEC; } + mca_cfg.bios_cmci_threshold = 1; } if (cfg->monarch_timeout < 0) -- Gitee