Skip to content

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets#155453

Open
japaric wants to merge 1 commit intorust-lang:mainfrom
ferrocene:a53-linux-fix-errata
Open

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets#155453
japaric wants to merge 1 commit intorust-lang:mainfrom
ferrocene:a53-linux-fix-errata

Conversation

@japaric
Copy link
Copy Markdown
Contributor

@japaric japaric commented Apr 17, 2026

as it's done for other AArch64 targets

although the linker (GCC) may be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied

for example, the Arm GNU toolchain does not enable the errata mitigation by default (checked version: 13.3.Rel1)

see #118095 for background information

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 17, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 72 candidates
  • Random selection from 18 candidates

@rustbot

This comment has been minimized.

@japaric japaric force-pushed the a53-linux-fix-errata branch from 9bafb16 to a88c30d Compare April 17, 2026 16:55
Copy link
Copy Markdown
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me

View changes since this review

@wesleywiser
Copy link
Copy Markdown
Member

@rustbot ping arm

Objections to merging this?

@rustbot rustbot added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Apr 17, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

Hey ARM Group! This issue has been identified as a good "ARM candidate".
In case it's useful, here are some instructions for tackling these sorts of
issues. Maybe take a look?
Thanks! <3

cc @adamgemmell @davidtwco @hug-dev @Jamesbarford @joaopaulocarreiro @lqd @raw-bin @Stammark

Xylakant pushed a commit to ferrocene/ferrocene that referenced this pull request Apr 17, 2026
as it's done for other AArch64 targets

although the linker (GCC) _may_ be configured to apply the fix by default it's
preferred to have rustc pass the flag to the linker to ensure the mitigation is
always applied

for example, the Arm GNU toolchain does _not_ enable the errata mitigation
by default (checked version: 13.3.Rel1)

see issue 118095 for background information

cherry-picked from upstream, see rust-lang/rust#155453 for details

re-enable the tests for this fix
@adamgemmell
Copy link
Copy Markdown
Contributor

I'm happy with this, I think everything in Jacob's comment on the none target still applies. How would the user override this if they want to?

as it's done for other AArch64 targets

although the linker (GCC) _may_ be configured to apply the fix by default it's
preferred to have rustc pass the flag to the linker to ensure the mitigation is
always applied

for example, the Arm GNU toolchain does _not_ enable the errata mitigation
by default (checked version: 13.3.Rel1)

see issue 118095 for background information
@japaric japaric force-pushed the a53-linux-fix-errata branch from a88c30d to 221687a Compare April 28, 2026 13:31
@japaric
Copy link
Copy Markdown
Contributor Author

japaric commented Apr 28, 2026

How would the user override this if they want to?

they can pass -mno-fix-cortex-a53-843419 to the linker driver (GCC) to opt-out of the silicon errata fix. that'd be passing -C link-arg=-mno-fix-cortex-a53-843419 to the binary-producing rustc invocation

however, according to my testing there seems to be priority issue with this change. -Wl,--fix-cortex-a53-843419 has higher priority than -mno-fix-cortex-a53-843419 so the fix is applied regardless of the -mno flag.

--no-fix-cortex-a53-843419 is not a valid flag (as of GNU LD 2.42) so -Wl,--no-fix-cortex-a53-843419 is not an option to opt out of the fix.

what that all means is that, to let the user opt out of the errata fix, we should use -mfix-cortex-a53-843419 in the target spec instead of the -Wl version. I have updated the commit to do that just now.

@adamgemmell
Copy link
Copy Markdown
Contributor

Sounds good, thank you!

@wesleywiser
Copy link
Copy Markdown
Member

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

📌 Commit 221687a has been approved by wesleywiser

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…wesleywiser

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets

as it's done for other AArch64 targets

although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied

for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1)

see rust-lang#118095 for background information
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…wesleywiser

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets

as it's done for other AArch64 targets

although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied

for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1)

see rust-lang#118095 for background information
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #154149 (resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities)
 - #155189 (simd_reduce_min/max: remove float support)
 - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets)
 - #155562 (Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`)
 - #155608 (rustc_middle: Implement the `partial_cmp` operation for `DefId`s)
 - #155721 (When archive format is wrong produce an error instead of ICE)
 - #155794 (privacy: share effective visibility initialization)
 - #155832 (c-variadic: more precise compatibility check in const-eval)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155958 (ci(free-disk-space): remove more tools and fix warnings)
 - #155966 (miri subtree update)
 - #155711 (bump curl-sys and openssl-sys to support OpenSSL 4.0.x)
 - #155831 (Add `AcceptContext::expect_key_value`)
 - #155877 (Avoid misleading return-type note for foreign `Fn` callees)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
 - #155967 (Fix `doc_cfg` feature for extern items)
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
#155976 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

This pull request was unapproved.

This PR was contained in a rollup (#155976), which was unapproved.

View changes since this unapproval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants