diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2020-07-31 22:38:05 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2020-08-01 00:15:57 +0300 |
commit | a0fc1436f1f4f84e93144480bf30e0c958d135b6 (patch) | |
tree | 3b2aef37c8000b3ae4a6f205f35c6e0c4dbf53f0 /arch/xtensa/kernel/asm-offsets.c | |
parent | 6d65d3769d1910379e1cfa61ebf387efc6bfb22c (diff) | |
download | linux-a0fc1436f1f4f84e93144480bf30e0c958d135b6.tar.xz |
xtensa: add missing exclusive access state management
The result of the s32ex opcode is recorded in the ATOMCTL special
register and must be retrieved with the getex opcode. Context switch
between s32ex and getex may trash the ATOMCTL register and result in
duplicate update or missing update of the atomic variable.
Add atomctl8 field to the struct thread_info and use getex to swap
ATOMCTL bit 8 as a part of context switch.
Clear exclusive access monitor on kernel entry.
Cc: stable@vger.kernel.org
Fixes: f7c34874f04a ("xtensa: add exclusive atomics support")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/asm-offsets.c')
-rw-r--r-- | arch/xtensa/kernel/asm-offsets.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c index 33a257b33723..dc5c83cad9be 100644 --- a/arch/xtensa/kernel/asm-offsets.c +++ b/arch/xtensa/kernel/asm-offsets.c @@ -93,6 +93,9 @@ int main(void) DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra)); DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp)); DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable)); +#if XCHAL_HAVE_EXCLUSIVE + DEFINE(THREAD_ATOMCTL8, offsetof (struct thread_info, atomctl8)); +#endif #if XTENSA_HAVE_COPROCESSORS DEFINE(THREAD_XTREGS_CP0, offsetof(struct thread_info, xtregs_cp.cp0)); DEFINE(THREAD_XTREGS_CP1, offsetof(struct thread_info, xtregs_cp.cp1)); |