linux-user: Call tcg_flush_jmp_cache() before re-using threads
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | linux-user: Only include 'exec/tb-flush.h' header when necessarylinux-user/ linux-user/ linux-user/ | +2 | 2 replies | |
| 2/3 | accel/tcg: Factor out common tcg_exec_reset() helperaccel/ accel/ accel/ | +9 | 2 replies | |
| 3/3 | accel/tcg: Implement cpu_exec_reset_hold() on user emulationaccel/ accel/ | +5 | 3 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Ilya Leoshkevich | Pierrick Bouvier |
|---|---|---|
| 1/3 | R-b | R-b |
| 2/3 | R-b | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] linux-user: Call tcg_flush_jmp_cache() before re-using threads
Fix a bug reported by Ilya in:
https://lore.kernel.org/qemu-devel/uuuk6a2vo24yrrqrchjxaeko3utqshrdu6txcnqziokpg7dkom@4l4kd3dqh6jc/
Commit bb6cf6f0168 ("accel/tcg: Factor tcg_cpu_reset_hold() out") wanted to restrict tlb_flush() to system emulation, but inadvertently also restricted tcg_flush_jmp_cache(), which was before called on user emulation via:
Realize -> Reset -> cpu_common_reset_hold()
Since threads (vCPUs) use a common CPUJumpCache, when many threads are created / joined, they eventually end re-using a CPUJumpCache entry, which was cleared when the first vCPU was allocated (via Realize) but then stayed dirty.
Have cpu_exec_reset_hold() call the common tcg_exec_reset() helper on user emulation, eventually calling tcg_flush_jmp_cache().
Philippe Mathieu-Daudé (3):
linux-user: Only include 'exec/tb-flush.h' header when necessary accel/tcg: Factor out common tcg_exec_reset() helper accel/tcg: Implement cpu_exec_reset_hold() on user emulation
accel/tcg/internal-common.h | 1 + linux-user/user-internals.h | 1 - accel/tcg/cpu-exec-common.c | 6 ++++++ accel/tcg/tcg-accel-ops.c | 4 ++-- accel/tcg/user-exec-stub.c | 4 ---- accel/tcg/user-exec.c | 5 +++++ linux-user/mmap.c | 1 + linux-user/syscall.c | 1 + 8 files changed, 16 insertions(+), 7 deletions(-)
Signature · 1 line
2.47.1