From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNn83-0000FJ-Jj for qemu-devel@nongnu.org; Thu, 14 Jul 2016 16:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNn81-0001eN-P5 for qemu-devel@nongnu.org; Thu, 14 Jul 2016 16:21:02 -0400 Received: from mail-yw0-x241.google.com ([2607:f8b0:4002:c05::241]:34724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNn81-0001eF-L5 for qemu-devel@nongnu.org; Thu, 14 Jul 2016 16:21:01 -0400 Received: by mail-yw0-x241.google.com with SMTP id l125so5543004ywb.1 for ; Thu, 14 Jul 2016 13:21:01 -0700 (PDT) From: Pranith Kumar Date: Thu, 14 Jul 2016 16:20:26 -0400 Message-Id: <20160714202026.9727-15-bobby.prani@gmail.com> In-Reply-To: <20160714202026.9727-1-bobby.prani@gmail.com> References: <20160714202026.9727-1-bobby.prani@gmail.com> Subject: [Qemu-devel] [PATCH v4 14/14] target-i386: Generate fences for x86 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , "open list:All patches CC here" Cc: alex.bennee@linaro.org, serge.fdrv@gmail.com, peter.maydell@linaro.org Signed-off-by: Pranith Kumar --- target-i386/translate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 7dea18b..ebeb6f0 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: -- 2.9.0