target-i386: Generate fences for x86

Backports commit cc19e497a047193db5083425957d7292c8dd3226 from qemu
This commit is contained in:
Pranith Kumar 2018-02-26 03:28:28 -05:00 committed by Lioncash
parent 32b7cee81e
commit 533e083495
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -8724,6 +8724,7 @@ case 0x101:
|| (prefixes & PREFIX_LOCK)) { || (prefixes & PREFIX_LOCK)) {
goto illegal_op; goto illegal_op;
} }
tcg_gen_mb(tcg_ctx, TCG_MO_ST_ST | TCG_BAR_SC);
break; break;
case 0xe8: case 0xe8:
case 0xe9: case 0xe9:
@ -8733,6 +8734,12 @@ case 0x101:
case 0xed: case 0xed:
case 0xee: case 0xee:
case 0xef: /* lfence */ case 0xef: /* lfence */
if (!(s->cpuid_features & CPUID_SSE)
|| (prefixes & PREFIX_LOCK)) {
goto illegal_op;
}
tcg_gen_mb(tcg_ctx, TCG_MO_LD_LD | TCG_BAR_SC);
break;
case 0xf0: case 0xf0:
case 0xf1: case 0xf1:
case 0xf2: case 0xf2:
@ -8745,6 +8752,7 @@ case 0x101:
|| (prefixes & PREFIX_LOCK)) { || (prefixes & PREFIX_LOCK)) {
goto illegal_op; goto illegal_op;
} }
tcg_gen_mb(tcg_ctx, TCG_MO_ALL | TCG_BAR_SC);
break; break;
default: default: