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
This commit is contained in:
Emilio G. Cota 2018-03-13 15:10:39 -04:00 committed by Lioncash
parent 0bfa6bae59
commit 5c1dbf456b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -5946,7 +5946,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, cpu_A0);
} else {
gen_helper_cmpxchg16b_unlocked(tcg_ctx, cpu_env, cpu_A0);
@ -5957,7 +5957,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, cpu_A0);
} else {
gen_helper_cmpxchg8b_unlocked(tcg_ctx, cpu_env, cpu_A0);