From b48508a6c1bee8b5ccd5226cfc9a69f32fbf3efe Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 27 Feb 2018 22:27:49 -0500 Subject: [PATCH] tcg: Emit barriers with parallel_cpus Backports commit 91682118aa330aff7e8ef0cc685c32d101f49940 from qemu --- qemu/tcg/tcg-op.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/qemu/tcg/tcg-op.c b/qemu/tcg/tcg-op.c index fe083ef0..374a485e 100644 --- a/qemu/tcg/tcg-op.c +++ b/qemu/tcg/tcg-op.c @@ -149,17 +149,7 @@ void tcg_gen_op6(TCGContext *ctx, TCGOpcode opc, TCGArg a1, TCGArg a2, void tcg_gen_mb(TCGContext *ctx, TCGBar mb_type) { - bool emit_barriers = true; - -#ifndef CONFIG_USER_ONLY - /* TODO: When MTTCG is available for system mode, we will check - * the following condition and enable emit_barriers - * (qemu_tcg_mttcg_enabled() && smp_cpus > 1) - */ - emit_barriers = false; -#endif - - if (emit_barriers) { + if (ctx->uc->parallel_cpus) { tcg_gen_op1(ctx, INDEX_op_mb, mb_type); } }