accel/tcg: Take mmap_lock in load_atomic*_or_exit
commit2c8412d469707124c6f471822aff2e2cab395907
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 16 Jul 2023 16:54:16 +0000 (16 16:54 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 23 Jul 2023 16:57:10 +0000 (23 17:57 +0100)
tree30373a4755be4842e9949c959aefb39f7893a77a
parentf1ce0b80283e19d5e65a5c2b0b4de6d92ca7f527
accel/tcg: Take mmap_lock in load_atomic*_or_exit

For user-only, the probe for page writability may race with another
thread's mprotect.  Take the mmap_lock around the operation.  This
is still faster than the start/end_exclusive fallback.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/ldst_atomicity.c.inc