summaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-06-21 08:28:30 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-06-21 08:28:43 -0700
commit9fef80d683d79934bacd3221f5252ce8c14ff5c0 (patch)
tree9d6a03c5bad5c175d3a2a5dd41034c45a6520956 /opcodes/i386-dis.c
parent7adc0a8174f1233f6d92edd0671c18c9870e64e7 (diff)
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/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index d461d08594..2e35e38e2b 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;