-
Notifications
You must be signed in to change notification settings - Fork 109
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
Use const operand for ARM syscall implementation #565
base: master
Are you sure you want to change the base?
Conversation
170b56c
to
79530b5
Compare
Note that this requires an update of the Rust version. @jrvanwhy (and others) are any significant implications for downstream users)? |
I discussed this with Lawrence, it sounds like there would be minimal impact (i.e. they would add Longer term, we may want to have a stricter MSRV policy, but this PR isn't an issue. |
Are the CI failures related to this change? |
Yes, they seem to fail on this branch, but not on master. I am not familiar with the test environment, so I don't know why they fail. |
The error message makes it looks like the toolchain is catching something that would be UB -- a panic unwinding across the syscall boundary. However, Regardless, the CI failure is almost certainly due to the toolchain update. I don't have time to debug further for at least a few more days, sadly. |
It seems the mechanism we use to catch unwinding upcalls is unreliable: rust-lang/rust#123231. I'm still reading through the thread; I don't have time to finish reading it (much less understand it) tonight. I suspect that this is defined behavior, but an abort is definitely not how we want this to be handled. If so, then the unit test failure is correct: our code is not handling an unwinding upcall in the manner it is supposed to. On another note, |
I've done some more reading. The good news: this is not and never was UB. Further, catching the unwind wasn't necessary for safety anyway -- code that tries to unwind across an The bad news: That behavior is not spec'd yet, so we can't rely on it. In that respect, the unit test failure is correct: our code does not reliably work. The only proper fix I see is to require the caller to inject a For this PR, lets just delete the |
`asm_const` feature has been stabilized in Rust 1.82. Using const operands for inline assembly eliminates a lot of the duplicated code in the ARM syscall implementation. This commit has been tested by running a simple application that periodically blinks and writes a message on Raspberry Pi Pico.
79530b5
to
7576183
Compare
I commented out the test explaining why it was removed and that it should be readded when Rust is updated to 1.84. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, CI is still failing. This time it appears to just be due to new lints.
Do you think I should create a separate PR to fix the lint checks? |
IMO same PR in a standalone commit would be fine. Alternatively you could do a standalone PR for the Rust update which would include removing the test and the lint fixes, and this PR could just be the asm_const change and nothing else. |
asm_const
feature has been stabilized in Rust 1.82. Using const operands for inline assembly eliminates a lot of the duplicated code in the ARM syscall implementation.This commit has been tested by running a simple application that periodically blinks and writes a message on Raspberry Pi Pico.