aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorPranith Kumar <bobby.prani@gmail.com>2016-07-14 16:20:26 -0400
committerRichard Henderson <rth@twiddle.net>2016-09-16 08:12:12 -0700
commitcc19e497a047193db5083425957d7292c8dd3226 (patch)
tree234c7c1c888a156807742dba58c163c92bb6ffc1 /target-i386
parentce1bd93f94e8d4b7117744e49652d2f907bed99f (diff)
downloadqemu-cc19e497a047193db5083425957d7292c8dd3226.zip
qemu-cc19e497a047193db5083425957d7292c8dd3226.tar.gz
qemu-cc19e497a047193db5083425957d7292c8dd3226.tar.bz2
target-i386: Generate fences for x86
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Message-Id: <20160714202026.9727-15-bobby.prani@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/translate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index fa2ac48..9447557 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -8012,13 +8012,21 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|| (prefixes & PREFIX_LOCK)) {
goto illegal_op;
}
+ tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC);
break;
case 0xe8 ... 0xef: /* lfence */
+ if (!(s->cpuid_features & CPUID_SSE)
+ || (prefixes & PREFIX_LOCK)) {
+ goto illegal_op;
+ }
+ tcg_gen_mb(TCG_MO_LD_LD | TCG_BAR_SC);
+ break;
case 0xf0 ... 0xf7: /* mfence */
if (!(s->cpuid_features & CPUID_SSE2)
|| (prefixes & PREFIX_LOCK)) {
goto illegal_op;
}
+ tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
break;
default: