diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 08:32:38 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 08:32:51 -0700 |
commit | 2234eee61c42ad3f4d17894236873e04b633e969 (patch) | |
tree | 2448caa5f0815f1bf07b5314e6315f32e24d13fb /opcodes | |
parent | c2f7640243bdab93cafb3bf516e17a72fcc2f051 (diff) | |
download | fsf-binutils-gdb-2234eee61c42ad3f4d17894236873e04b633e969.zip fsf-binutils-gdb-2234eee61c42ad3f4d17894236873e04b633e969.tar.gz fsf-binutils-gdb-2234eee61c42ad3f4d17894236873e04b633e969.tar.bz2 |
x86: CET v2.0: Update incssp and setssbsy
Update x86 assembler and disassembler for CET v2.0:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf
1. incsspd and incsspq are changed to take a register opeand with a
different opcode.
2. setssbsy is changed to take no opeand with a different opcode.
gas/
* testsuite/gas/i386/cet-intel.d: Updated.
* testsuite/gas/i386/cet.d: Likewise.
* testsuite/gas/i386/x86-64-cet-intel.d: Likewise.
* testsuite/gas/i386/x86-64-cet.d: Likewise.
* testsuite/gas/i386/cet.s: Update incsspd and setssbsy tests.
* testsuite/gas/i386/x86-64-cet.s: Likewise.
opcodes/
* i386-dis.c (RM_0FAE_REG_5): Removed.
(PREFIX_MOD_3_0F01_REG_5_RM_1): Likewise.
(PREFIX_MOD_3_0F01_REG_5_RM_0): New.
(PREFIX_MOD_3_0FAE_REG_5): Likewise.
(prefix_table): Remove PREFIX_MOD_3_0F01_REG_5_RM_1. Add
PREFIX_MOD_3_0F01_REG_5_RM_0.
(prefix_table): Update PREFIX_MOD_0_0FAE_REG_5. Add
PREFIX_MOD_3_0FAE_REG_5.
(mod_table): Update MOD_0FAE_REG_5.
(rm_table): Update RM_0F01_REG_5. Remove RM_0FAE_REG_5.
* i386-opc.tbl: Update incsspd, incsspq and setssbsy.
* i386-tbl.h: Regenerated.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 15 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 23 | ||||
-rw-r--r-- | opcodes/i386-opc.tbl | 6 | ||||
-rw-r--r-- | opcodes/i386-tbl.h | 22 |
4 files changed, 41 insertions, 25 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 3ffafa1..b2e7729 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,20 @@ 2017-06-21 H.J. Lu <hongjiu.lu@intel.com> + * i386-dis.c (RM_0FAE_REG_5): Removed. + (PREFIX_MOD_3_0F01_REG_5_RM_1): Likewise. + (PREFIX_MOD_3_0F01_REG_5_RM_0): New. + (PREFIX_MOD_3_0FAE_REG_5): Likewise. + (prefix_table): Remove PREFIX_MOD_3_0F01_REG_5_RM_1. Add + PREFIX_MOD_3_0F01_REG_5_RM_0. + (prefix_table): Update PREFIX_MOD_0_0FAE_REG_5. Add + PREFIX_MOD_3_0FAE_REG_5. + (mod_table): Update MOD_0FAE_REG_5. + (rm_table): Update RM_0F01_REG_5. Remove RM_0FAE_REG_5. + * i386-opc.tbl: Update incsspd, incsspq and setssbsy. + * i386-tbl.h: Regenerated. + +2017-06-21 H.J. Lu <hongjiu.lu@intel.com> + * i386-dis.c (prefix_table): Replace savessp with saveprevssp. * i386-opc.tbl: Likewise. * i386-tbl.h: Regenerated. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 58d4c06..612e06f 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -940,7 +940,6 @@ enum RM_0F01_REG_5, RM_0F01_REG_7, RM_0F1E_MOD_3_REG_7, - RM_0FAE_REG_5, RM_0FAE_REG_6, RM_0FAE_REG_7 }; @@ -949,7 +948,7 @@ enum { PREFIX_90 = 0, PREFIX_MOD_0_0F01_REG_5, - PREFIX_MOD_3_0F01_REG_5_RM_1, + PREFIX_MOD_3_0F01_REG_5_RM_0, PREFIX_MOD_3_0F01_REG_5_RM_2, PREFIX_0F10, PREFIX_0F11, @@ -997,6 +996,7 @@ enum PREFIX_MOD_0_0FAE_REG_4, PREFIX_MOD_3_0FAE_REG_4, PREFIX_MOD_0_0FAE_REG_5, + PREFIX_MOD_3_0FAE_REG_5, PREFIX_0FAE_REG_6, PREFIX_0FAE_REG_7, PREFIX_0FB8, @@ -3789,10 +3789,10 @@ static const struct dis386 prefix_table[][4] = { { "rstorssp", { Mq }, PREFIX_OPCODE }, }, - /* PREFIX_MOD_3_0F01_REG_5_RM_1 */ + /* PREFIX_MOD_3_0F01_REG_5_RM_0 */ { { Bad_Opcode }, - { "incsspK", { Skip_MODRM }, PREFIX_OPCODE }, + { "setssbsy", { Skip_MODRM }, PREFIX_OPCODE }, }, /* PREFIX_MOD_3_0F01_REG_5_RM_2 */ @@ -4134,7 +4134,12 @@ static const struct dis386 prefix_table[][4] = { /* PREFIX_MOD_0_0FAE_REG_5 */ { { "xrstor", { FXSAVE }, PREFIX_OPCODE }, - { "setssbsy", { Mq }, PREFIX_OPCODE }, + }, + + /* PREFIX_MOD_3_0FAE_REG_5 */ + { + { "lfence", { Skip_MODRM }, 0 }, + { "incsspK", { Rdq }, PREFIX_OPCODE }, }, /* PREFIX_0FAE_REG_6 */ @@ -11657,7 +11662,7 @@ static const struct dis386 mod_table[][2] = { { /* MOD_0FAE_REG_5 */ { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) }, - { RM_TABLE (RM_0FAE_REG_5) }, + { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_5) }, }, { /* MOD_0FAE_REG_6 */ @@ -12233,8 +12238,8 @@ static const struct dis386 rm_table[][8] = { }, { /* RM_0F01_REG_5 */ + { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_0) }, { Bad_Opcode }, - { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_1) }, { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) }, { Bad_Opcode }, { Bad_Opcode }, @@ -12262,10 +12267,6 @@ static const struct dis386 rm_table[][8] = { { "nopQ", { Ev }, 0 }, }, { - /* RM_0FAE_REG_5 */ - { "lfence", { Skip_MODRM }, 0 }, - }, - { /* RM_0FAE_REG_6 */ { "mfence", { Skip_MODRM }, 0 }, }, diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index 47e1f66..924bb0a 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -6009,8 +6009,8 @@ ptwrite, 1, 0xf30fae, 0x4, 2, CpuPTWRITE, Modrm|CheckRegSize|No_bSuf|No_wSuf|No_ // CET instructions. -incsspd, 0, 0xf30f01e9, None, 3, CpuCET, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 } -incsspq, 0, 0xf30f01e9, None, 3, CpuCET|Cpu64, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64, { 0 } +incsspd, 1, 0xf30fae, 0x5, 2, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32 } +incsspq, 1, 0xf30fae, 0x5, 2, CpuCET|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64, { Reg64 } rdsspd, 1, 0xf30f1e, 0x1, 2, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32 } rdsspq, 1, 0xf30f1e, 0x1, 2, CpuCET|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64, { Reg64 } saveprevssp, 0, 0xf30f01ea, None, 3, CpuCET, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 } @@ -6019,7 +6019,7 @@ wrssd, 2, 0x0f38f6, None, 3, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No wrssq, 2, 0x0f38f6, None, 3, CpuCET|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64, { Reg64, Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S } wrussd, 2, 0x660f38f5, None, 3, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32, Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S } wrussq, 2, 0x660f38f5, None, 3, CpuCET|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64, { Reg64, Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S } -setssbsy, 1, 0xf30fae, 0x5, 2, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S } +setssbsy, 0, 0xf30f01e8, None, 3, CpuCET, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 } clrssbsy, 1, 0xf30fae, 0x6, 2, CpuCET, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S } endbr64, 0, 0xf30f1efa, None, 3, CpuCET, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 } endbr32, 0, 0xf30f1efb, None, 3, CpuCET, IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 } diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index 4bc3878..af583ce 100644 --- a/opcodes/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