
hulk inclusion category: performance bugzilla: https://gitee.com/openeuler/kernel/issues/I9O7V8 --------------------------- This reverts commit a35298b9398e7f5d2dac99928bfbd8397d38af04. Revert syscall performance degradation pre-patch. Signed-off-by: liwei <liwei728@huawei.com> --- arch/x86/Kconfig | 17 ++++++++++++++--- arch/x86/kernel/cpu/bugs.c | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a993a3716738..d7562807f538 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2633,16 +2633,27 @@ config MITIGATION_RFDS stored in floating point, vector and integer registers. See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst> -config MITIGATION_SPECTRE_BHI - bool "Mitigate Spectre-BHB (Branch History Injection)" +choice + prompt "Clear branch history" depends on CPU_SUP_INTEL - default y + default SPECTRE_BHI_ON help Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks where the branch history buffer is poisoned to speculatively steer indirect branches. See <file:Documentation/admin-guide/hw-vuln/spectre.rst> +config SPECTRE_BHI_ON + bool "on" + help + Equivalent to setting spectre_bhi=on command line parameter. +config SPECTRE_BHI_OFF + bool "off" + help + Equivalent to setting spectre_bhi=off command line parameter. + +endchoice + endif config ARCH_HAS_ADD_PAGES diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index c2dc9b7426ac..4c5e33b0130b 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1627,7 +1627,7 @@ enum bhi_mitigations { }; static enum bhi_mitigations bhi_mitigation __ro_after_init = - IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; + IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; static int __init spectre_bhi_parse_cmdline(char *str) { -- 2.25.1