qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-8.1 v2 0/3] accel/tcg: Take mmap_lock in load_atomic*_or_exit
@ 2023-07-22 11:35 Richard Henderson
  2023-07-22 11:35 ` [PATCH v2 1/3] include/exec: Add WITH_MMAP_LOCK_GUARD Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Richard Henderson @ 2023-07-22 11:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

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.

Changes for v2:
  * Introduce WITH_MMAP_LOCK_GUARD, to simplify the changes.
  * Fix the probes for not-writable.
  * Handle load_atomic8_or_exit and load_atomic16_or_exit similarly.


r~


Richard Henderson (3):
  include/exec: Add WITH_MMAP_LOCK_GUARD
  accel/tcg: Fix sense of read-only probes in ldst_atomicity
  accel/tcg: Take mmap_lock in load_atomic*_or_exit

 include/exec/exec-all.h        | 10 ++++++++++
 bsd-user/mmap.c                |  1 +
 linux-user/mmap.c              |  1 +
 accel/tcg/ldst_atomicity.c.inc | 32 ++++++++++++++++++--------------
 4 files changed, 30 insertions(+), 14 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-23 15:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-22 11:35 [PATCH for-8.1 v2 0/3] accel/tcg: Take mmap_lock in load_atomic*_or_exit Richard Henderson
2023-07-22 11:35 ` [PATCH v2 1/3] include/exec: Add WITH_MMAP_LOCK_GUARD Richard Henderson
2023-07-23 14:18   ` Peter Maydell
2023-07-23 15:01     ` Richard Henderson
2023-07-22 11:35 ` [PATCH v2 2/3] accel/tcg: Fix sense of read-only probes in ldst_atomicity Richard Henderson
2023-07-23 14:20   ` Peter Maydell
2023-07-22 11:35 ` [PATCH v2 3/3] accel/tcg: Take mmap_lock in load_atomic*_or_exit Richard Henderson
2023-07-23 14:22   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).