On Tue, 25 Apr 2023 at 20:33, Richard Henderson
<[email protected]> wrote:
>
> Like cpu_in_exclusive_context, but also true if
> there is no other cpu against which we could race.
>
> Use it in tb_flush as a direct replacement.
> Use it in cpu_loop_exit_atomic to ensure that there
> is no loop against cpu_exec_step_atomic.
>
> Reviewed-by: Alex Bennée <[email protected]>
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
>  accel/tcg/internal.h        | 5 +++++
>  accel/tcg/cpu-exec-common.c | 3 +++
>  accel/tcg/tb-maint.c        | 2 +-
>  3 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
> index 96f198b28b..8250ecbf74 100644
> --- a/accel/tcg/internal.h
> +++ b/accel/tcg/internal.h
> @@ -64,6 +64,11 @@ static inline target_ulong log_pc(CPUState *cpu, const 
> TranslationBlock *tb)
>      }
>  }
>
> +static inline bool cpu_in_serial_context(CPUState *cs)
> +{
> +    return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
> +}

Can we have a doc comment that defines the semantics, please?
Otherwise
Reviewed-by: Peter Maydell <[email protected]>

thanks
-- PMM

Reply via email to