Message ID | 20250321125737.72839-3-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | tcg: Move TCG_GUEST_DEFAULT_MO -> TCGCPUOps::guest_default_memory_order | expand |
On 21/03/25, Philippe Mathieu-Daudé wrote: > Now that TCG_GUEST_DEFAULT_MO is always defined, > simplify the tcg_req_mo() macro. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > accel/tcg/internal-target.h | 9 +-------- > accel/tcg/tcg-all.c | 3 --- > 2 files changed, 1 insertion(+), 11 deletions(-) > > diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h > index 2cdf11c905e..1cb35dba99e 100644 > --- a/accel/tcg/internal-target.h > +++ b/accel/tcg/internal-target.h > @@ -50,17 +50,10 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); > * memory ordering vs the host memory ordering. A non-zero > * result indicates that some barrier is required. > * > - * If TCG_GUEST_DEFAULT_MO is not defined, assume that the > - * guest requires strict ordering. > - * > * This is a macro so that it's constant even without optimization. > */ > -#ifdef TCG_GUEST_DEFAULT_MO > -# define tcg_req_mo(type) \ > +#define tcg_req_mo(type) \ > ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) > -#else > -# define tcg_req_mo(type) ((type) & ~TCG_TARGET_DEFAULT_MO) > -#endif > > /** > * cpu_req_mo: > diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c > index c1a30b01219..cb632cc8cc7 100644 > --- a/accel/tcg/tcg-all.c > +++ b/accel/tcg/tcg-all.c > @@ -77,9 +77,6 @@ static bool default_mttcg_enabled(void) > return false; > } > #ifdef TARGET_SUPPORTS_MTTCG > -# ifndef TCG_GUEST_DEFAULT_MO > -# error "TARGET_SUPPORTS_MTTCG without TCG_GUEST_DEFAULT_MO" > -# endif > return true; > #else > return false; > -- > 2.47.1 > Reviewed-by: Anton Johansson <anjo@rev.ng>
On 3/21/25 05:57, Philippe Mathieu-Daudé wrote: > Now that TCG_GUEST_DEFAULT_MO is always defined, > simplify the tcg_req_mo() macro. > > Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org> > --- > accel/tcg/internal-target.h | 9 +-------- > accel/tcg/tcg-all.c | 3 --- > 2 files changed, 1 insertion(+), 11 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On 3/21/25 05:57, Philippe Mathieu-Daudé wrote: > Now that TCG_GUEST_DEFAULT_MO is always defined, > simplify the tcg_req_mo() macro. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > accel/tcg/internal-target.h | 9 +-------- > accel/tcg/tcg-all.c | 3 --- > 2 files changed, 1 insertion(+), 11 deletions(-) > > diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h > index 2cdf11c905e..1cb35dba99e 100644 > --- a/accel/tcg/internal-target.h > +++ b/accel/tcg/internal-target.h > @@ -50,17 +50,10 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); > * memory ordering vs the host memory ordering. A non-zero > * result indicates that some barrier is required. > * > - * If TCG_GUEST_DEFAULT_MO is not defined, assume that the > - * guest requires strict ordering. > - * > * This is a macro so that it's constant even without optimization. > */ > -#ifdef TCG_GUEST_DEFAULT_MO > -# define tcg_req_mo(type) \ > +#define tcg_req_mo(type) \ > ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) > -#else > -# define tcg_req_mo(type) ((type) & ~TCG_TARGET_DEFAULT_MO) > -#endif > > /** > * cpu_req_mo: > diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c > index c1a30b01219..cb632cc8cc7 100644 > --- a/accel/tcg/tcg-all.c > +++ b/accel/tcg/tcg-all.c > @@ -77,9 +77,6 @@ static bool default_mttcg_enabled(void) > return false; > } > #ifdef TARGET_SUPPORTS_MTTCG > -# ifndef TCG_GUEST_DEFAULT_MO > -# error "TARGET_SUPPORTS_MTTCG without TCG_GUEST_DEFAULT_MO" > -# endif > return true; > #else > return false; Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 2cdf11c905e..1cb35dba99e 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -50,17 +50,10 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); * memory ordering vs the host memory ordering. A non-zero * result indicates that some barrier is required. * - * If TCG_GUEST_DEFAULT_MO is not defined, assume that the - * guest requires strict ordering. - * * This is a macro so that it's constant even without optimization. */ -#ifdef TCG_GUEST_DEFAULT_MO -# define tcg_req_mo(type) \ +#define tcg_req_mo(type) \ ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) -#else -# define tcg_req_mo(type) ((type) & ~TCG_TARGET_DEFAULT_MO) -#endif /** * cpu_req_mo: diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index c1a30b01219..cb632cc8cc7 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -77,9 +77,6 @@ static bool default_mttcg_enabled(void) return false; } #ifdef TARGET_SUPPORTS_MTTCG -# ifndef TCG_GUEST_DEFAULT_MO -# error "TARGET_SUPPORTS_MTTCG without TCG_GUEST_DEFAULT_MO" -# endif return true; #else return false;
Now that TCG_GUEST_DEFAULT_MO is always defined, simplify the tcg_req_mo() macro. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- accel/tcg/internal-target.h | 9 +-------- accel/tcg/tcg-all.c | 3 --- 2 files changed, 1 insertion(+), 11 deletions(-)