diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-05-22 11:02:46 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-05-22 11:02:58 -0700 |
commit | 04ef582ace91cad765d056cc95624478e0421144 (patch) | |
tree | ce513249defa49cae554a37f0f532d696a6e788a /opcodes/i386-opc.h | |
parent | 25f94347373b1b6f4bfc79eeb38e79d383195779 (diff) | |
download | gdb-04ef582ace91cad765d056cc95624478e0421144.zip gdb-04ef582ace91cad765d056cc95624478e0421144.tar.gz gdb-04ef582ace91cad765d056cc95624478e0421144.tar.bz2 |
x86: Add NOTRACK prefix support
For register indirect branches, NOTRACK prefix (0x3e), which is also
the DS segment register prefix, can be used to ignore the CET indirect
branch track.
gas/
* config/tc-i386.c (REX_PREFIX): Changed to 7.
(NOTRACK_PREFIX): New.
(MAX_PREFIXES): Changed to 8.
(_i386_insn): Add notrack_prefix.
(PREFIX_GROUP): Add PREFIX_DS.
(add_prefix): Return PREFIX_DS for DS_PREFIX_OPCODE.
(md_assemble): Check if NOTRACK prefix is supported.
(parse_insn): Set notrack_prefix and issue an error for
other prefixes after NOTRACK prefix.
* testsuite/gas/i386/i386.exp: Run tests for NOTRACK prefix.
* testsuite/gas/i386/notrack-intel.d: New file.
* testsuite/gas/i386/notrack.d: Likewise.
* testsuite/gas/i386/notrack.s: Likewise.
* testsuite/gas/i386/notrackbad.l: Likewise.
* testsuite/gas/i386/notrackbad.s: Likewise.
* testsuite/gas/i386/x86-64-notrack-intel.d: Likewise.
* testsuite/gas/i386/x86-64-notrack.d: Likewise.
* testsuite/gas/i386/x86-64-notrack.s: Likewise.
* testsuite/gas/i386/x86-64-notrackbad.l: Likewise.
* testsuite/gas/i386/x86-64-notrackbad.s: Likewise.
include/
* include/opcode/i386.h (NOTRACK_PREFIX_OPCODE): New.
opcodes/
* i386-dis.c (NOTRACK_Fixup): New.
(NOTRACK): Likewise.
(NOTRACK_PREFIX): Likewise.
(last_active_prefix): Likewise.
(reg_table): Use NOTRACK on indirect call and jmp.
(ckprefix): Set last_active_prefix.
(prefix_name): Return "notrack" for NOTRACK_PREFIX.
* i386-gen.c (opcode_modifiers): Add NoTrackPrefixOk.
* i386-opc.h (NoTrackPrefixOk): New.
(i386_opcode_modifier): Add notrackprefixok.
* i386-opc.tbl: Add NoTrackPrefixOk to indirect call and jmp.
Add notrack.
* i386-tbl.h: Regenerated.
Diffstat (limited to 'opcodes/i386-opc.h')
-rw-r--r-- | opcodes/i386-opc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h index d1a6a45..ccc774a 100644 --- a/opcodes/i386-opc.h +++ b/opcodes/i386-opc.h @@ -407,6 +407,8 @@ enum IsString, /* quick test if branch instruction is MPX supported */ BNDPrefixOk, + /* quick test if NOTRACK prefix is supported */ + NoTrackPrefixOk, /* quick test for lockable instructions */ IsLockable, /* fake an extra reg operand for clr, imul and special register @@ -622,6 +624,7 @@ typedef struct i386_opcode_modifier unsigned int fwait:1; unsigned int isstring:1; unsigned int bndprefixok:1; + unsigned int notrackprefixok:1; unsigned int islockable:1; unsigned int regkludge:1; unsigned int firstxmm0:1; |