arm64: proton-pack: Add Spectre-BSE mitigation for Cortex-A7{2,3,5}
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | arm64: proton-pack: Move the loop and firmware enable sequences into helpersarch/ | +47 | 0 replies | |
| 2/3 | arm64: proton-pack: Add Spectre-BSE mitigation for Cortex-A7{2,3,5}arch/ arch/ | +114 | 0 replies | |
| 3/3 | arm64: proton-pack: Prefer WA1 for BHB on Cortex-A72 r0pXarch/ arch/ | +42 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] arm64: proton-pack: Add Spectre-BSE mitigation for Cortex-A7{2,3,5}
Hello!
Spectre-BSE is a variant of Spectre-BHB that abuses a power-saving mode on some older cores to dodge the BHB mitigation applied to the branch predictor.
Only A72r0 actually needs anything doing - this is basically a bug in the published BHB mitigation sequence that was published for A72r0. This series moves A72r0 to use the WA1 firmware call for mitigation, and adds the necessary reporting parts for user-space to discover which parts of BHB/BSE are mitigated or vulnerable.
WA1 is used instead of WA3 which was new for BHB because we can't rely on hypervisors not to use the 'local' workaround, and for Spectre-BSE we don't need to worry about discovery via. (Which is why WA3 exists - for cores not vulnerable to the issue mititaged by WA1).
Arm's description of this vulnerability can be found here:
https://developer.arm.com/Arm%20Security%20Center/Spectre-BSE
This series is based on arm64/for-next/core, and can be retrieved from:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/log/?h=spectre_bse/v1
Backports of this version can also be found under spectre_bse/backports of the above repo.
Because this vulnerability is hard to expoit, but the cost of mitigating it is high - the mitigation is disabled by default. (see the last patch). To enable the mitigation, a command-line argument is needed:
'spectre_bse'.
This series adds more things to the vulnerability reporting file:
| morse@adam:~$ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 | Mitigation: CSV2, BHB, but not BSE
or:
| Mitigation: CSV2, BHB, BSE
(KVM maintainers are on CC as this changes which mitigation KVM enables,
and there is some hypervisor reasoning in the last patch)
Thanks,
James Morse (3):
arm64: proton-pack: Move the loop and firmware enable sequences into
helpers
arm64: proton-pack: Add Spectre-BSE mitigation for Cortex-A7{2,3,5}
arm64: proton-pack: Prefer WA1 for BHB on Cortex-A72 r0pX
arch/arm64/include/asm/assembler.h | 4 +- arch/arm64/include/asm/spectre.h | 1 + arch/arm64/kernel/proton-pack.c | 230 +++++++++++++++++++++++------ 3 files changed, 191 insertions(+), 44 deletions(-)
Signature · 1 line
2.39.2