-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP15 barrier instructions should be emitted before the exclusives loops (arm) #60605
Comments
In case anyone will have this issues as well ... Rust installation workaroundForce installer to use
NOTE: This workaround allows you to install Rust toolchain only, but it doesn't fix the issue. Compile the example below, run it and you'll see. Example which reproduces this problem
Compile with |
Very nicely investigated issue.
Fixing this in our fork involves knowing what the fix should look like. I imagine the easiest and fastest approach will be to wait for LLVM to get a patch from one of the ARM’s engineers and then include that patch in our fork. |
Agree. Will ping Will again to get the LLVM bug # (if exists) and the patch which will fix this. |
Did report it in the LLVM's Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41856 |
It occurs to me that even once this bug is fixed, making every compare-and-swap (or at least every one using those semantics) trap to the kernel is going to be rather slow. The non-deprecated equivalent of the CP15 barrier is the But I am curious why rustup is picking |
@comex the short answer is cross compilation (in quotes).
Our customers have dozens of different devices - RPi Zero, RPi 1, RPi 3, ... These device are ARMv6, v7, ... Part of our infrastructure is a service called builder. You can push to a special git origin and your service is going to be build on our builder. Building on RPi Zero / via QEMU is slow. Thus our build servers have ARMv8 CPUs. We're using tricks like personality, setarch, ability to run 32-bit user space on 64-bit kernel, docker, ... Which basically solves couple of issues like:
It's like ...
We solved our problem by setting |
Faced the same on ARMv8 platform with 64-bit kernel but 32-bit userland when enforcing EDIT: Ah nope, this solves "downloading" cargo etc ( @zrzka echo 'abi.cp15_barrier=2' > /etc/sysctl.d/99-cp15_barrier.conf
sysctl -p /etc/sysctl.d/99-cp15_barrier.conf Since the LLVM Bugzilla has been archived, for completeness I'm linking the auto-generated/migrated GitHub issue here: llvm/llvm-project#41201 |
Symptoms
Environment
CP15_BARRIER_EMULATION=y
abi.cp15_barrier
set to1
(emulate)arm-unknown-linux-gnueabihf
toolchainCP15 barrier instructions
armv7
abi.cp15_barrier
is set to2
(HW exec) -> there's no issueabi.cp15_barrier
is set to1
(emulate) -> there's this issueIssue description
parking_lot
author:ARM engineer (Will Deacon) response on this:
Solution
Will's third point:
And:
I asked for the LLVM bug # to track it, but still no response.
Way forward
Second way can prolong fix by weeks, months, ...? Not sure how fast is the LLVM itself developed & how fast is the Rust's fork syncing. This is the main reason I did report it here as well.
No fix
People aren't / won't be able to use Rust on Linux with
CP15_BARRIER_EMULATION=y
&abi.cp15_barrier=1
(emulation, default value) &arm-unknown-linux-gnueabihf
toolchain.The text was updated successfully, but these errors were encountered: