cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.12k stars 605 forks source link

aarch64: tweak context switching code in sched.S to use CLREX to clear the access record #1192

Open wkozaczuk opened 2 years ago

wkozaczuk commented 2 years ago

We might need to enhance our context switch login in sched.S to properly handle pathological scenarios involving LDREX/STREX instructions and how the exclusive-access flag is handled especially on SMP systems.

For a good explanation see this stack overflow - https://stackoverflow.com/questions/51162344/when-is-clrex-actually-needed-on-arm-cortex-m7/51169716#51169716. From this discussion it is not clear if that is required on modern ARM64 hardware.