diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 08:28:30 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 08:28:43 -0700 |
commit | 9fef80d683d79934bacd3221f5252ce8c14ff5c0 (patch) | |
tree | 9d6a03c5bad5c175d3a2a5dd41034c45a6520956 /opcodes | |
parent | 7adc0a8174f1233f6d92edd0671c18c9870e64e7 (diff) | |
download | gdb-9fef80d683d79934bacd3221f5252ce8c14ff5c0.zip gdb-9fef80d683d79934bacd3221f5252ce8c14ff5c0.tar.gz gdb-9fef80d683d79934bacd3221f5252ce8c14ff5c0.tar.bz2 |
x86: CET v2.0: Update NOTRACK prefix
Update NOTRACK prefix handling to support memory indirect branch for
CET v2.0:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf
gas/
* config/tc-i386.c (md_assemble): Update NOTRACK prefix check.
* testsuite/gas/i386/notrack-intel.d: Updated.
* testsuite/gas/i386/notrack.d: Likewise.
* testsuite/gas/i386/notrackbad.l: Likewise.
* testsuite/gas/i386/x86-64-notrack-intel.d: Likewise.
* testsuite/gas/i386/x86-64-notrack.d: Likewise.
* testsuite/gas/i386/x86-64-notrackbad.l: Likewise.
* testsuite/gas/i386/notrack.s: Add NOTRACK prefix tests with
memory indirect branch.
* testsuite/gas/i386/x86-64-notrack.s: Likewise.
* testsuite/gas/i386/notrackbad.s: Remove memory indirect branch
with NOTRACK prefix.
* testsuite/gas/i386/x86-64-notrackbad.s: Likewise.
opcodes/
* i386-dis.c (reg_table): Swap indirEv with NOTRACK on "call{&|}"
and "jmp{&|}".
(NOTRACK_Fixup): Support memory indirect branch with NOTRACK
prefix.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 7 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 14 |
2 files changed, 13 insertions, 8 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index b484e5b..671837f 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2017-06-21 H.J. Lu <hongjiu.lu@intel.com> + + * i386-dis.c (reg_table): Swap indirEv with NOTRACK on "call{&|}" + and "jmp{&|}". + (NOTRACK_Fixup): Support memory indirect branch with NOTRACK + prefix. + 2017-06-19 Nick Clifton <nickc@redhat.com> PR binutils/21614 diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index d461d08..2e35e38 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -3552,9 +3552,9 @@ static const struct dis386 reg_table[][8] = { { { "incQ", { Evh1 }, 0 }, { "decQ", { Evh1 }, 0 }, - { "call{&|}", { indirEv, NOTRACK, BND }, 0 }, + { "call{&|}", { NOTRACK, indirEv, BND }, 0 }, { MOD_TABLE (MOD_FF_REG_3) }, - { "jmp{&|}", { indirEv, NOTRACK, BND }, 0 }, + { "jmp{&|}", { NOTRACK, indirEv, BND }, 0 }, { MOD_TABLE (MOD_FF_REG_5) }, { "pushU", { stackEv }, 0 }, { Bad_Opcode }, @@ -16816,14 +16816,12 @@ static void NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED) { - if (modrm.mod == 3 - && active_seg_prefix == PREFIX_DS + if (active_seg_prefix == PREFIX_DS && (address_mode != mode_64bit || last_data_prefix < 0)) { - /* NOTRACK prefix is only valid on register indirect branch - instructions and it must be the last prefix before REX - prefix and opcode. NB: DATA prefix is unsupported for - Intel64. */ + /* NOTRACK prefix is only valid on indirect branch instructions + and it must be the last prefix before REX prefix and opcode. + NB: DATA prefix is unsupported for Intel64. */ if (last_active_prefix >= 0) { int notrack_prefix = last_active_prefix; |