arm64: errata: Rework Spectre BHB mitigations to not assume "safe"
Status from this message: Applied to arm64 (for-next/spectre-bhb-assume-vulnerable), thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest5 patches 8 repliesApplied
- v33 patches 3 repliesSuperseded
- v26 patches 9 repliesSuperseded
Changes in v4 from the cover letter
- Re-added QCOM_KRYO_4XX_GOLD k24 patch after Qualcomm confirmed.
- Add MIDR_BRAHMA_B53 as safe.
- Get rid of spectre_bhb_firmware_mitigated_list.
- Re-added KRYO 2XX/3XX/4XX silver patch after Qualcomm confirmed.
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | arm64: errata: Add QCOM_KRYO_4XX_GOLD to the spectre_bhb_k24_listarch/ | +1 | 1 reply | |
| 2/5 | arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHBarch/ arch/ | +102 | 4 replies | |
| 3/5 | arm64: errata: Add KRYO 2XX/3XX/4XX silver cores to Spectre BHB safe listarch/ | +3 | 1 reply | |
| 4/5 | arm64: cputype: Add MIDR_CORTEX_A76AEarch/ | +2 | 0 replies | |
| 5/5 | arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() listsarch/ | +14 | 1 reply |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Julius Werner | James Morse | Trilok Soni |
|---|---|---|---|
| 1/5 | A-b | ||
| 2/5 | R-b | ||
| 3/5 | A-b | ||
| 4/5 | |||
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v4 0/5] arm64: errata: Rework Spectre BHB mitigations to not assume "safe"
Recently I realized that a device with some Qualcomm Kryo 4xx cores reported in lscpu that it was _not_ vulnerable to Spectre BHB. This seemed unlikely to me.
I wrote up a patch series to attempt (with a lot of guesswork) to add Qualcomm cores to the tables governing how the Spectre BHB mitigation worked.
In response to that patch, Will suggested that I flip the mitigation on its head and assume things are vulnerable until we find that they're not [1]. This patch series _attempts_ to accomplish that.
In case it's not obvious, v2 of this patch series was pretty different than v1 because it flips the logic on its head. Some of the patches carried over, though.
v3 is yet more different, avoiding the guesses (and thus dropping some patches) and also incorporating feedback from Julius in response to v2.
v4 addresses minor feedback plus re-adds Qualcomm cores since I managed to find a contact at Qualcomm to provide confirmation.
As a last caveat, I'll note that I am certainly no expert on Spectre. Mostly I ended up here running lscpu on a device and noticing that it thought that it wasn't affected by Spectre v2 when I thought it was.
Link to prev versions:
v1: https://lore.kernel.org/r/[email protected]/
v2: https://lore.kernel.org/r/[email protected]
v3: https://lore.kernel.org/r/[email protected]
[1] https://lore.kernel.org/r/20241211213410.GB17486@willie-the-truck
Changes in v4:
- Re-added QCOM_KRYO_4XX_GOLD k24 patch after Qualcomm confirmed.
- Add MIDR_BRAHMA_B53 as safe.
- Get rid of spectre_bhb_firmware_mitigated_list.
- Re-added KRYO 2XX/3XX/4XX silver patch after Qualcomm confirmed.
Changes in v3:
- Removed QCOM_KRYO_4XX_GOLD k24 patch.
- Don't guess the mitigation; just report unknown cores as vulnerable.
- Restructure the code since is_spectre_bhb_affected() defaults to true
- Removed KRYO 2XX/3XX/4XX silver patch.
- arm64: cputype: Add MIDR_CORTEX_A76AE
- arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() lists
Changes in v2:
- Slight change to wording and notes of KRYO_4XX_GOLD patch
- arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB
- arm64: errata: Add KRYO 2XX/3XX/4XX silver cores to Spectre BHB safe list
Douglas Anderson (5):
arm64: errata: Add QCOM_KRYO_4XX_GOLD to the spectre_bhb_k24_list
arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre
BHB
arm64: errata: Add KRYO 2XX/3XX/4XX silver cores to Spectre BHB safe
list
arm64: cputype: Add MIDR_CORTEX_A76AE
arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected()
lists
arch/arm64/include/asm/cputype.h | 2 + arch/arm64/include/asm/spectre.h | 1 - arch/arm64/kernel/proton-pack.c | 218 +++++++++++++++++-------------- 3 files changed, 120 insertions(+), 101 deletions(-)
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog