Deleted Added
full compact
23a24
> * Copyright (c) 2012, Joyent, Inc. All rights reserved.
35c36
< * $FreeBSD: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c 262542 2014-02-27 01:04:35Z markj $
---
> * $FreeBSD: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c 270186 2014-08-19 23:15:47Z grehan $
106a108
> MG9, /* register or memory in group 9 (prefix optional) */
110c112
< SWAPGS,
---
> SWAPGS_RDTSCP,
116a119
> RM_66r, /* RM, but with a required 0x66 prefix */
231c234,237
< VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */
---
> VEX_RMX, /* VEX VEX.vvvv, mod_rm -> mod_reg */
> VMx, /* vmcall/vmlaunch/vmresume/vmxoff */
> VMxo, /* VMx instruction with optional prefix */
> SVM /* AMD SVM instructions */
499,500c505,506
< /* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6),
< /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS),
---
> /* [0] */ TNSZ("sgdt",VMx,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",SVM,6),
> /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS_RDTSCP),
531c537
< * Decode table for 0x0FC7 opcode
---
> * Decode table for 0x0FC7 opcode (group 9)
537c543
< /* [4] */ INVALID, INVALID, INVALID, INVALID,
---
> /* [4] */ INVALID, INVALID, TNS("vmptrld",MG9), TNS("vmptrst",MG9),
539a546,548
> /*
> * Decode table for 0x0FC7 opcode (group 9) mode 3
> */
540a550,555
> const instable_t dis_op0FC7m3[8] = {
>
> /* [0] */ INVALID, INVALID, INVALID, INVALID,
> /* [4] */ INVALID, INVALID, TNS("rdrand",MG9), INVALID,
> };
>
541a557,576
> * Decode table for 0x0FC7 opcode with 0x66 prefix
> */
>
> const instable_t dis_op660FC7[8] = {
>
> /* [0] */ INVALID, INVALID, INVALID, INVALID,
> /* [4] */ INVALID, INVALID, TNS("vmclear",M), INVALID,
> };
>
> /*
> * Decode table for 0x0FC7 opcode with 0xF3 prefix
> */
>
> const instable_t dis_opF30FC7[8] = {
>
> /* [0] */ INVALID, INVALID, INVALID, INVALID,
> /* [4] */ INVALID, INVALID, TNS("vmxon",M), INVALID,
> };
>
> /*
1150c1185
< /* [80] */ INVALID, INVALID, INVALID, INVALID,
---
> /* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID,
1196c1231
< /* [10] */ INVALID, INVALID, INVALID, INVALID,
---
> /* [10] */ INVALID, INVALID, INVALID, TNSZ("vcvtph2ps",VEX_MX,16),
1362c1397
< /* [1C] */ INVALID, INVALID, INVALID, INVALID,
---
> /* [1C] */ INVALID, TNSZ("vcvtps2ph",VEX_RX,16), INVALID, INVALID,
1449c1484
< /* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw),
---
> /* [1C] */ INVALID, INVALID, INVALID, TS("nop",Mw),
1478c1513
< /* [78] */ TNS("INVALID",XMMO), TNS("INVALID",XMMO), INVALID, INVALID,
---
> /* [78] */ TNSy("vmread",RM), TNSy("vmwrite",MR), INVALID, INVALID,
1862c1897
< /* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM),
---
> /* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM),
1867c1902
< /* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM),
---
> /* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM),
1869c1904
< /* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM),
---
> /* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM),
2907a2943
> case RM_66r:
3056a3093,3145
> case MG9:
> /*
> * More horribleness: the group 9 (0xF0 0xC7) instructions are
> * allowed an optional prefix of 0x66 or 0xF3. This is similar
> * to the SIMD business described above, but with a different
> * addressing mode (and an indirect table), so we deal with it
> * separately (if similarly).
> *
> * Intel further complicated this with the release of Ivy Bridge
> * where they overloaded these instructions based on the ModR/M
> * bytes. The VMX instructions have a mode of 0 since they are
> * memory instructions but rdrand instructions have a mode of
> * 0b11 (REG_ONLY) because they only operate on registers. While
> * there are different prefix formats, for now it is sufficient
> * to use a single different table.
> */
>
> /*
> * Calculate our offset in dis_op0FC7 (the group 9 table)
> */
> if ((uintptr_t)dp - (uintptr_t)dis_op0FC7 > sizeof (dis_op0FC7))
> goto error;
>
> off = ((uintptr_t)dp - (uintptr_t)dis_op0FC7) /
> sizeof (instable_t);
>
> /*
> * If we have a mode of 0b11 then we have to rewrite this.
> */
> dtrace_get_modrm(x, &mode, &reg, &r_m);
> if (mode == REG_ONLY) {
> dp = (instable_t *)&dis_op0FC7m3[off];
> break;
> }
>
> /*
> * Rewrite if this instruction used one of the magic prefixes.
> */
> if (rep_prefix) {
> if (rep_prefix == 0xf3)
> dp = (instable_t *)&dis_opF30FC7[off];
> else
> goto error;
> rep_prefix = 0;
> } else if (opnd_size_prefix) {
> dp = (instable_t *)&dis_op660FC7[off];
> opnd_size_prefix = 0;
> if (opnd_size == SIZE16)
> opnd_size = SIZE32;
> }
> break;
>
>
3437c3526
< case SWAPGS:
---
> case SWAPGS_RDTSCP:
3443a3533,3538
> } else if (mode == 3 && r_m == 1) {
> #ifdef DIS_TEXT
> (void) strncpy(x->d86_mnem, "rdtscp", OPLEN);
> #endif
> NOMEM;
> break;
3444a3540
>
3453a3550
> case MG9:
3461a3559,3628
> case VMx:
> if (mode == 3) {
> #ifdef DIS_TEXT
> char *vminstr;
>
> switch (r_m) {
> case 1:
> vminstr = "vmcall";
> break;
> case 2:
> vminstr = "vmlaunch";
> break;
> case 3:
> vminstr = "vmresume";
> break;
> case 4:
> vminstr = "vmxoff";
> break;
> default:
> goto error;
> }
>
> (void) strncpy(x->d86_mnem, vminstr, OPLEN);
> #else
> if (r_m < 1 || r_m > 4)
> goto error;
> #endif
>
> NOMEM;
> break;
> }
> /*FALLTHROUGH*/
> case SVM:
> if (mode == 3) {
> #ifdef DIS_TEXT
> char *vinstr;
>
> switch (r_m) {
> case 0:
> vinstr = "vmrun";
> break;
> case 1:
> vinstr = "vmmcall";
> break;
> case 2:
> vinstr = "vmload";
> break;
> case 3:
> vinstr = "vmsave";
> break;
> case 4:
> vinstr = "stgi";
> break;
> case 5:
> vinstr = "clgi";
> break;
> case 6:
> vinstr = "skinit";
> break;
> case 7:
> vinstr = "invlpga";
> break;
> }
>
> (void) strncpy(x->d86_mnem, vinstr, OPLEN);
> #endif
> NOMEM;
> break;
> }
> /*FALLTHROUGH*/
3599a3767
> case RM_66r:
4303c4471,4472
< (dp == &dis_opAVX0F[0x5][0xA])) {
---
> (dp == &dis_opAVX0F[0x5][0xA]) ||
> (dp == &dis_opAVX660F38[0x13])) {
4388c4557,4559
< if (dp == &dis_opAVX660F3A[0x19]) { /* vextractf128 */
---
> /* vextractf128 || vcvtps2ph */
> if (dp == &dis_opAVX660F3A[0x19] ||
> dp == &dis_opAVX660F3A[0x1d]) {