mirror of https://gitee.com/openkylin/qemu.git
target-i386: tcg: Handle clflushopt/clwb/pcommit instructions
A small update to TCG code so it can handle the new clflushopt/clwb/pcommit instructions. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJWPg/OAAoJECgHk2+YTcWmo3IP/3A/8XV4vMRmqzV844jGuk+q NkvmYY0BDFJ+IEHnJ8YDUYn1LyWboHTYFamoGELLbBNe5dz1ixbD1Mpoev/rxnMD jQL/ziWKup2SGgAJACFxMcH+AQV+NrsGNpFxjeRG8FtFTzImLI8I+lRgprk6bgbP kouBt4mjpva2KCBF9s1fHSqRlUsZ6c/Kfd8LBQpDVXDDwCtAXaEj2Rze3pjgCw73 px2dt16PYZaF2eJnkROqM7tZA1TswvjsZyif2kCUZ0sfsFjh0JesP15QH8439ETG h7Z2PSfC+xCZTc+WPXxALgfoU9Z5KSmyBOkErp9LkDBGHcEHBJXaGhJFMf1Gtlxn S8pnUWD+4S1S74X3d1Xi7qDKs6s/qVL19A1PLJZPvP3n1iuiHJLsjGN8Iu2YLb4H Aaoh4FJFfPHOSw7SNUlhlfm+5HCrOXelXYzLJe1hMYlJuGepJkSpzObd/6ZJFOBN MXBadasoKAv2wD1N9KC8FjXjJpg4gT6s3nNghK1tYHiJopdqONYNFUkXEISWL76f T2uXNasBRt4zPxBwUuuB/kF9ytLY0enRqfBjR4MU8y9hkN3/aML22IdLPdA8L9OY WLZPmTUdXMZ90+lKseoWG28oNw7NTrQeWN7XGA6jD3aVJG62rfwT0O1sGSqF0Bxn wv8g0+tD4BteP/9KpZPQ =xPO9 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging target-i386: tcg: Handle clflushopt/clwb/pcommit instructions A small update to TCG code so it can handle the new clflushopt/clwb/pcommit instructions. # gpg: Signature made Sat 07 Nov 2015 14:50:54 GMT using RSA key ID 984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" * remotes/ehabkost/tags/x86-pull-request: target-i386: Add clflushopt/clwb/pcommit to TCG_7_0_EBX_FEATURES target-i386: tcg: Check right CPUID bits for clflushopt/pcommit target-i386: tcg: Accept clwb instruction Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
b3a9e57d92
|
@ -345,7 +345,9 @@ static const char *cpuid_6_feature_name[] = {
|
|||
#define TCG_SVM_FEATURES 0
|
||||
#define TCG_KVM_FEATURES 0
|
||||
#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
|
||||
CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
|
||||
CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX | \
|
||||
CPUID_7_0_EBX_PCOMMIT | CPUID_7_0_EBX_CLFLUSHOPT | \
|
||||
CPUID_7_0_EBX_CLWB)
|
||||
/* missing:
|
||||
CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
|
||||
CPUID_7_0_EBX_ERMS, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
|
||||
|
|
|
@ -7716,20 +7716,43 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
|||
}
|
||||
break;
|
||||
case 5: /* lfence */
|
||||
case 6: /* mfence */
|
||||
if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE2))
|
||||
goto illegal_op;
|
||||
break;
|
||||
case 7: /* sfence / clflush */
|
||||
if ((modrm & 0xc7) == 0xc0) {
|
||||
/* sfence */
|
||||
/* XXX: also check for cpuid_ext2_features & CPUID_EXT2_EMMX */
|
||||
if (!(s->cpuid_features & CPUID_SSE))
|
||||
case 6: /* mfence/clwb */
|
||||
if (s->prefix & PREFIX_DATA) {
|
||||
/* clwb */
|
||||
if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_CLWB))
|
||||
goto illegal_op;
|
||||
gen_nop_modrm(env, s, modrm);
|
||||
} else {
|
||||
/* clflush */
|
||||
if (!(s->cpuid_features & CPUID_CLFLUSH))
|
||||
/* mfence */
|
||||
if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE2))
|
||||
goto illegal_op;
|
||||
}
|
||||
break;
|
||||
case 7: /* sfence / clflush / clflushopt / pcommit */
|
||||
if ((modrm & 0xc7) == 0xc0) {
|
||||
if (s->prefix & PREFIX_DATA) {
|
||||
/* pcommit */
|
||||
if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_PCOMMIT))
|
||||
goto illegal_op;
|
||||
} else {
|
||||
/* sfence */
|
||||
/* XXX: also check for cpuid_ext2_features & CPUID_EXT2_EMMX */
|
||||
if (!(s->cpuid_features & CPUID_SSE))
|
||||
goto illegal_op;
|
||||
}
|
||||
} else {
|
||||
if (s->prefix & PREFIX_DATA) {
|
||||
/* clflushopt */
|
||||
if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_CLFLUSHOPT))
|
||||
goto illegal_op;
|
||||
} else {
|
||||
/* clflush */
|
||||
if (!(s->cpuid_features & CPUID_CLFLUSH))
|
||||
goto illegal_op;
|
||||
}
|
||||
gen_lea_modrm(env, s, modrm);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue