* [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
@ 2025-11-17 5:12 Jonathan Marek
2025-11-23 17:50 ` Jonathan Marek
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jonathan Marek @ 2025-11-17 5:12 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Catalin Marinas, Will Deacon, James Morse, Douglas Anderson,
Trilok Soni, shechenglong, Kuninori Morimoto, Shameer Kolothum,
open list
The "drop print" commit removed the whole branch and not just the print.
For some ARM64 cpus, this leads to hard lockup when
CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not enabled.
Fixes: 62e72463ca71 ("arm64: proton-pack: Drop print when !CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY")
---
arch/arm64/kernel/proton-pack.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index c7d70d04c164c..80a580e019c50 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -1032,6 +1032,8 @@ 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)) {
+ /* Do nothing */
} else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {
state = SPECTRE_MITIGATED;
set_bit(BHB_HW, &system_bhb_mitigations);
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
2025-11-17 5:12 [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY Jonathan Marek
@ 2025-11-23 17:50 ` Jonathan Marek
2025-11-24 14:41 ` Will Deacon
2025-11-27 1:08 ` Vladimir Zapolskiy
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Marek @ 2025-11-23 17:50 UTC (permalink / raw)
To: Will Deacon
Cc: linux-arm-kernel, Catalin Marinas, James Morse, Douglas Anderson,
Trilok Soni, shechenglong, Kuninori Morimoto, Shameer Kolothum,
open list
Can you pick this up? Its an urgent fix..
And looks like I forgot it, you can add:
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
On 11/17/25 12:12 AM, Jonathan Marek wrote:
> The "drop print" commit removed the whole branch and not just the print.
> For some ARM64 cpus, this leads to hard lockup when
> CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not enabled.
>
> Fixes: 62e72463ca71 ("arm64: proton-pack: Drop print when !CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY")
> ---
> arch/arm64/kernel/proton-pack.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
> index c7d70d04c164c..80a580e019c50 100644
> --- a/arch/arm64/kernel/proton-pack.c
> +++ b/arch/arm64/kernel/proton-pack.c
> @@ -1032,6 +1032,8 @@ 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)) {
> + /* Do nothing */
> } else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {
> state = SPECTRE_MITIGATED;
> set_bit(BHB_HW, &system_bhb_mitigations);
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
2025-11-17 5:12 [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY Jonathan Marek
2025-11-23 17:50 ` Jonathan Marek
@ 2025-11-24 14:41 ` Will Deacon
2025-11-27 1:08 ` Vladimir Zapolskiy
2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2025-11-24 14:41 UTC (permalink / raw)
To: linux-arm-kernel, Jonathan Marek
Cc: catalin.marinas, kernel-team, Will Deacon, James Morse,
Douglas Anderson, Trilok Soni, shechenglong, Kuninori Morimoto,
Shameer Kolothum, linux-kernel
On Mon, 17 Nov 2025 00:12:08 -0500, Jonathan Marek wrote:
> The "drop print" commit removed the whole branch and not just the print.
> For some ARM64 cpus, this leads to hard lockup when
> CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not enabled.
>
>
Applied (with your SoB) to arm64 (for-next/fixes), thanks!
[1/1] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
https://git.kernel.org/arm64/c/165eb13e485c
I'd be inclined to remove CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY
entirely (i.e. make it unconditional) given the number of CPUs
affected and the dynamic controls we already have for the mitigation.
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
2025-11-17 5:12 [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY Jonathan Marek
2025-11-23 17:50 ` Jonathan Marek
2025-11-24 14:41 ` Will Deacon
@ 2025-11-27 1:08 ` Vladimir Zapolskiy
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2025-11-27 1:08 UTC (permalink / raw)
To: Jonathan Marek, Will Deacon
Cc: Catalin Marinas, James Morse, Douglas Anderson, Trilok Soni,
shechenglong, Kuninori Morimoto, Shameer Kolothum,
linux-arm-kernel, open list
On 11/17/25 07:12, Jonathan Marek wrote:
> The "drop print" commit removed the whole branch and not just the print.
> For some ARM64 cpus, this leads to hard lockup when
> CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not enabled.
>
> Fixes: 62e72463ca71 ("arm64: proton-pack: Drop print when !CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY")
> ---
> arch/arm64/kernel/proton-pack.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
> index c7d70d04c164c..80a580e019c50 100644
> --- a/arch/arm64/kernel/proton-pack.c
> +++ b/arch/arm64/kernel/proton-pack.c
> @@ -1032,6 +1032,8 @@ 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)) {
> + /* Do nothing */
> } else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {
> state = SPECTRE_MITIGATED;
> set_bit(BHB_HW, &system_bhb_mitigations);
If CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is unset, the fix is needed
to boot Linux on Lantronix SM8450-HDK and SM8550-HDK boards, which are
otherwise broken since v6.18-rc6.
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Tested-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
--
Best wishes,
Vladimir
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-27 1:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 5:12 [PATCH] arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY Jonathan Marek
2025-11-23 17:50 ` Jonathan Marek
2025-11-24 14:41 ` Will Deacon
2025-11-27 1:08 ` Vladimir Zapolskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®