[PATCH v2 1/2] cpu:Remove the print when the CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY Kconfig option is disabled.

shechenglong posted 2 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v2 1/2] cpu:Remove the print when the CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY Kconfig option is disabled.
Posted by shechenglong 3 months, 1 week ago
Following the pattern established with other Spectre mitigations,
do not prints a message when the CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY
Kconfig option is disabled.

Link: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20250918064907.1832-1-shechenglong@xfusion.com/
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: shechenglong <shechenglong@xfusion.com>
---
 arch/arm64/kernel/proton-pack.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index f9a32dfde006..d833b7c1bba8 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -1042,8 +1042,6 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)

        if (arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE) {
                /* No point mitigating Spectre-BHB alone. */
-       } else if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY)) {
-               pr_info_once("spectre-bhb mitigation disabled by compile time option\n");
        } else if (cpu_mitigations_off() || __nospectre_bhb) {
                pr_info_once("spectre-bhb mitigation disabled by command line option\n");
        } else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {
--
2.33.0
Re: [PATCH v2 1/2] cpu:Remove the print when the CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY Kconfig option is disabled.
Posted by Will Deacon 3 months, 1 week ago
On Wed, Oct 29, 2025 at 11:45:53AM +0800, shechenglong wrote:
> Following the pattern established with other Spectre mitigations,
> do not prints a message when the CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY
> Kconfig option is disabled.
> 
> Link: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20250918064907.1832-1-shechenglong@xfusion.com/
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: shechenglong <shechenglong@xfusion.com>
> ---
>  arch/arm64/kernel/proton-pack.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
> index f9a32dfde006..d833b7c1bba8 100644
> --- a/arch/arm64/kernel/proton-pack.c
> +++ b/arch/arm64/kernel/proton-pack.c
> @@ -1042,8 +1042,6 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)
> 
>         if (arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE) {
>                 /* No point mitigating Spectre-BHB alone. */
> -       } else if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY)) {
> -               pr_info_once("spectre-bhb mitigation disabled by compile time option\n");
>         } else if (cpu_mitigations_off() || __nospectre_bhb) {
>                 pr_info_once("spectre-bhb mitigation disabled by command line option\n");
>         } else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {

I'm not able to apply this -- I think you've somehow converted some tabs
to spaces in the whitespace.

Please can you fix that and send a v3?

Will