[PATCH v4 0/3] linux-user/sh4: fix race in atomic variables

Richard Henderson posted 3 patches 2 days, 20 hours ago
include/exec/translation-block.h |  1 +
target/sh4/cpu.h                 |  6 ++--
accel/tcg/cpu-exec.c             |  4 ++-
target/sh4/translate.c           | 48 +++++++++++++++-----------------
4 files changed, 28 insertions(+), 31 deletions(-)
[PATCH v4 0/3] linux-user/sh4: fix race in atomic variables
Posted by Richard Henderson 2 days, 20 hours ago
Fix the race detailed in patch 2 in a more generic fashion.

Squash the silly loop that was part of the problem by suppressing
interrupts within cpu_exec_step_atomic.


r~


Richard Henderson (3):
  accel/tcg: Set CF_NOIRQ during cpu_exec_step_atomic
  target/sh4: Replace TB_FLAG_GUSA_EXCLUSIVE with CF_STEP_ATOMIC
  target/sh4: Drop use_exit_tb

 include/exec/translation-block.h |  1 +
 target/sh4/cpu.h                 |  6 ++--
 accel/tcg/cpu-exec.c             |  4 ++-
 target/sh4/translate.c           | 48 +++++++++++++++-----------------
 4 files changed, 28 insertions(+), 31 deletions(-)

-- 
2.53.0
Re: [PATCH v4 0/3] linux-user/sh4: fix race in atomic variables
Posted by Mikulas Patocka 1 day, 20 hours ago

On Wed, 23 Sep 2026, Richard Henderson wrote:

> Fix the race detailed in patch 2 in a more generic fashion.
> 
> Squash the silly loop that was part of the problem by suppressing
> interrupts within cpu_exec_step_atomic.
> 
> 
> r~
> 
> 
> Richard Henderson (3):
>   accel/tcg: Set CF_NOIRQ during cpu_exec_step_atomic
>   target/sh4: Replace TB_FLAG_GUSA_EXCLUSIVE with CF_STEP_ATOMIC
>   target/sh4: Drop use_exit_tb
> 
>  include/exec/translation-block.h |  1 +
>  target/sh4/cpu.h                 |  6 ++--
>  accel/tcg/cpu-exec.c             |  4 ++-
>  target/sh4/translate.c           | 48 +++++++++++++++-----------------
>  4 files changed, 28 insertions(+), 31 deletions(-)
> 
> -- 
> 2.53.0

Thanks, I tested the patches and it works.

Tested-by: Mikulas Patocka <mpatocka@redhat.com>

Mikulas