Clear the exclusive monitor in the vector stub
The patch adds CLREX (or a dummy STREX) to the vector stub and removes
it from the __switch_to function. This allows the atomic_set to be a
simple STR instruction.
Linux currently clears the exclusive monitor at every context switch,
allowing threads to use plain STR for atomic store
operations. However, this is not enough for atomic operations in
signal handler. The patch fixes this case as well.
Note that for the SMP case, plain STR clears the state of the global
exclusive monitor. The effect of an STR on the local exclusive monitor
is implementation defined and therefore a CLREX is needed at exception
taking.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Showing
Please register or sign in to comment