qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/3] linux-user: Call tcg_flush_jmp_cache() before re-using t


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 0/3] linux-user: Call tcg_flush_jmp_cache() before re-using threads
Date: Thu, 9 Jan 2025 11:59:06 +0100
User-agent: Mozilla Thunderbird

Hi Ilya,

ping? :)

On 2/1/25 19:25, Philippe Mathieu-Daudé wrote:
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(-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]