From ad2a4edd7687b61d454aa73b20817a8a5bfcfbd9 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Sat, 4 May 2019 22:45:45 -0400 Subject: [PATCH] target/i386: check CF_PARALLEL instead of parallel_cpus Thereby decoupling the resulting translated code from the current state of the system. Backports commit b5e3b4c2aca8eb5a9cfeedfb273af623f17c3731 from qemu --- qemu/target/i386/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/target/i386/translate.c b/qemu/target/i386/translate.c index b8904675..8209a5bf 100644 --- a/qemu/target/i386/translate.c +++ b/qemu/target/i386/translate.c @@ -5866,7 +5866,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) goto illegal_op; gen_lea_modrm(env, s, modrm); - if ((s->prefix & PREFIX_LOCK) && tcg_ctx->uc->parallel_cpus) { + if ((s->prefix & PREFIX_LOCK) && (tb_cflags(s->base.tb) & CF_PARALLEL)) { gen_helper_cmpxchg16b(tcg_ctx, cpu_env, s->A0); } else { gen_helper_cmpxchg16b_unlocked(tcg_ctx, cpu_env, s->A0); @@ -5877,7 +5877,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!(s->cpuid_features & CPUID_CX8)) goto illegal_op; gen_lea_modrm(env, s, modrm); - if ((s->prefix & PREFIX_LOCK) && tcg_ctx->uc->parallel_cpus) { + if ((s->prefix & PREFIX_LOCK) && (tb_cflags(s->base.tb) & CF_PARALLEL)) { gen_helper_cmpxchg8b(tcg_ctx, cpu_env, s->A0); } else { gen_helper_cmpxchg8b_unlocked(tcg_ctx, cpu_env, s->A0);