]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB
authorDouglas Anderson <dianders@chromium.org>
Tue, 7 Jan 2025 20:05:59 +0000 (12:05 -0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 14 Mar 2025 17:58:25 +0000 (17:58 +0000)
commite403e8538359d8580cbee1976ff71813e947101e
treedc2450a240b1c9432dd8f6cc35ae215952dcec60
parented1ce841245d8febe3badf51c57e81c3619d0a1d
arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB

The code for detecting CPUs that are vulnerable to Spectre BHB was
based on a hardcoded list of CPU IDs that were known to be affected.
Unfortunately, the list mostly only contained the IDs of standard ARM
cores. The IDs for many cores that are minor variants of the standard
ARM cores (like many Qualcomm Kyro CPUs) weren't listed. This led the
code to assume that those variants were not affected.

Flip the code on its head and instead assume that a core is vulnerable
if it doesn't have CSV2_3 but is unrecognized as being safe. This
involves creating a "Spectre BHB safe" list.

As of right now, the only CPU IDs added to the "Spectre BHB safe" list
are ARM Cortex A35, A53, A55, A510, and A520. This list was created by
looking for cores that weren't listed in ARM's list [1] as per review
feedback on v2 of this patch [2]. Additionally Brahma A53 is added as
per mailing list feedback [3].

NOTE: this patch will not actually _mitigate_ anyone, it will simply
cause them to report themselves as vulnerable. If any cores in the
system are reported as vulnerable but not mitigated then the whole
system will be reported as vulnerable though the system will attempt
to mitigate with the information it has about the known cores.

[1] https://developer.arm.com/Arm%20Security%20Center/Spectre-BHB
[2] https://lore.kernel.org/r/20241219175128.GA25477@willie-the-truck
[3] https://lore.kernel.org/r/18dbd7d1-a46c-4112-a425-320c99f67a8d@broadcom.com

Fixes: 558c303c9734 ("arm64: Mitigate spectre style branch history side channels")
Cc: stable@vger.kernel.org
Reviewed-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250107120555.v4.2.I2040fa004dafe196243f67ebcc647cbedbb516e6@changeid
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/spectre.h
arch/arm64/kernel/proton-pack.c