Repository navigation
remove nomem, add fences - #699
Conversation
Declare asm memory effects and retain existing compiler fences. Add Release before and Acquire after BASEPRI writes, and Acquire after BASEPRI_MAX, to work around rust-lang/rust#144351.
The host can access memory through the argument pointer. Remove nomem so those accesses are visible to the compiler.
Remove nomem from the CONTROL write and ISB, and from bootstrap. Memory accesses must use the intended execution context, and the bootstrap destination can read the initialized stack.
Cortex-M33 TRM B6.6 permits memory-mapped coprocessor state accessed through loads and stores.
|
cc #698 |
|
#698 puts a fence on both sides of the But otherwise this seems more complete so I'll close mine. |
ACK. I don't expect any harm from the added fence. But then again, I see these fences around memory clobbering |
|
And your case specifically (read CPSR) should not hit that compiler bug. |
|
We discussed on Zulip and seem to prefer more fences rather than fewer, given the insidious nature of the failure mode. |
|
I probably wont be able to work on this for the next couple days. My suggestion would be to merge and then add the changes you want afterwards. Or edit/hijack. |
|
Thanks for letting us know. I'll merge this now and we can have a second PR with the additional fences around interrupt enable/disable if we want, before the new release. |
This PR applies the changes proposed in #697