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 /gas | |
parent | c2f7640243bdab93cafb3bf516e17a72fcc2f051 (diff) | |
download | gdb-2234eee61c42ad3f4d17894236873e04b633e969.zip gdb-2234eee61c42ad3f4d17894236873e04b633e969.tar.gz 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 'gas')
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/cet-intel.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/cet.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/cet.s | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-cet-intel.d | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-cet.d | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-cet.s | 12 |
7 files changed, 39 insertions, 30 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 855401d..16f0c4b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -4,6 +4,15 @@ * 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. + +2017-06-21 H.J. Lu <hongjiu.lu@intel.com> + + * 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: Replace savessp with saveprevssp. * testsuite/gas/i386/x86-64-cet.s: Likewise. diff --git a/gas/testsuite/gas/i386/cet-intel.d b/gas/testsuite/gas/i386/cet-intel.d index c16a963..79da878 100644 --- a/gas/testsuite/gas/i386/cet-intel.d +++ b/gas/testsuite/gas/i386/cet-intel.d @@ -8,23 +8,23 @@ Disassembly of section .text: 0+ <_start>: - +[a-f0-9]+: f3 0f 01 e9 incsspd + +[a-f0-9]+: f3 0f ae e9 incsspd ecx +[a-f0-9]+: f3 0f 1e c9 rdsspd ecx +[a-f0-9]+: f3 0f 01 ea saveprevssp +[a-f0-9]+: f3 0f 01 29 rstorssp QWORD PTR \[ecx\] +[a-f0-9]+: 0f 38 f6 04 02 wrssd \[edx\+eax\*1\],eax +[a-f0-9]+: 66 0f 38 f5 14 2f wrussd \[edi\+ebp\*1\],edx - +[a-f0-9]+: f3 0f ae 28 setssbsy QWORD PTR \[eax\] + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 0f ae 34 04 clrssbsy QWORD PTR \[esp\+eax\*1\] +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 - +[a-f0-9]+: f3 0f 01 e9 incsspd + +[a-f0-9]+: f3 0f ae e9 incsspd ecx +[a-f0-9]+: f3 0f 1e c9 rdsspd ecx +[a-f0-9]+: f3 0f 01 ea saveprevssp +[a-f0-9]+: f3 0f 01 2c 01 rstorssp QWORD PTR \[ecx\+eax\*1\] +[a-f0-9]+: 0f 38 f6 02 wrssd \[edx\],eax +[a-f0-9]+: 66 0f 38 f5 14 2f wrussd \[edi\+ebp\*1\],edx - +[a-f0-9]+: f3 0f ae 28 setssbsy QWORD PTR \[eax\] + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 0f ae 34 04 clrssbsy QWORD PTR \[esp\+eax\*1\] +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 diff --git a/gas/testsuite/gas/i386/cet.d b/gas/testsuite/gas/i386/cet.d index 449f04e..982d40e 100644 --- a/gas/testsuite/gas/i386/cet.d +++ b/gas/testsuite/gas/i386/cet.d @@ -6,23 +6,23 @@ Disassembly of section .text: 0+ <_start>: - +[a-f0-9]+: f3 0f 01 e9 incsspd + +[a-f0-9]+: f3 0f ae e9 incsspd %ecx +[a-f0-9]+: f3 0f 1e c9 rdsspd %ecx +[a-f0-9]+: f3 0f 01 ea saveprevssp +[a-f0-9]+: f3 0f 01 29 rstorssp \(%ecx\) +[a-f0-9]+: 0f 38 f6 04 02 wrssd %eax,\(%edx,%eax,1\) +[a-f0-9]+: 66 0f 38 f5 14 2f wrussd %edx,\(%edi,%ebp,1\) - +[a-f0-9]+: f3 0f ae 28 setssbsy \(%eax\) + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 0f ae 34 04 clrssbsy \(%esp,%eax,1\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 - +[a-f0-9]+: f3 0f 01 e9 incsspd + +[a-f0-9]+: f3 0f ae e9 incsspd %ecx +[a-f0-9]+: f3 0f 1e c9 rdsspd %ecx +[a-f0-9]+: f3 0f 01 ea saveprevssp +[a-f0-9]+: f3 0f 01 2c 01 rstorssp \(%ecx,%eax,1\) +[a-f0-9]+: 0f 38 f6 02 wrssd %eax,\(%edx\) +[a-f0-9]+: 66 0f 38 f5 14 2f wrussd %edx,\(%edi,%ebp,1\) - +[a-f0-9]+: f3 0f ae 28 setssbsy \(%eax\) + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 0f ae 34 04 clrssbsy \(%esp,%eax,1\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 diff --git a/gas/testsuite/gas/i386/cet.s b/gas/testsuite/gas/i386/cet.s index f0b6db0..f0178a8 100644 --- a/gas/testsuite/gas/i386/cet.s +++ b/gas/testsuite/gas/i386/cet.s @@ -1,25 +1,25 @@ # Check CET instructions .text _start: - incsspd + incsspd %ecx rdsspd %ecx saveprevssp rstorssp (%ecx) wrssd %eax, (%edx, %eax) wrussd %edx, (%edi, %ebp) - setssbsy (%eax) + setssbsy clrssbsy (%esp, %eax) endbr64 endbr32 .intel_syntax noprefix - incsspd + incsspd ecx rdsspd ecx saveprevssp rstorssp QWORD PTR [ecx + eax] wrssd [edx],eax wrussd [edi + ebp],edx - setssbsy QWORD PTR [eax] + setssbsy clrssbsy QWORD PTR [esp + eax] endbr64 endbr32 diff --git a/gas/testsuite/gas/i386/x86-64-cet-intel.d b/gas/testsuite/gas/i386/x86-64-cet-intel.d index 2d2af71..5e5f4a5 100644 --- a/gas/testsuite/gas/i386/x86-64-cet-intel.d +++ b/gas/testsuite/gas/i386/x86-64-cet-intel.d @@ -7,8 +7,8 @@ Disassembly of section .text: 0+ <_start>: - +[a-f0-9]+: f3 0f 01 e9 incsspd - +[a-f0-9]+: f3 48 0f 01 e9 incsspq + +[a-f0-9]+: f3 41 0f ae ec incsspd r12d + +[a-f0-9]+: f3 48 0f ae e8 incsspq rax +[a-f0-9]+: f3 41 0f 1e cc rdsspd r12d +[a-f0-9]+: f3 48 0f 1e c8 rdsspq rax +[a-f0-9]+: f3 0f 01 ea saveprevssp @@ -17,12 +17,12 @@ Disassembly of section .text: +[a-f0-9]+: 4a 0f 38 f6 14 39 wrssq \[rcx\+r15\*1\],rdx +[a-f0-9]+: 66 41 0f 38 f5 04 24 wrussd \[r12\],eax +[a-f0-9]+: 66 48 0f 38 f5 0c 03 wrussq \[rbx\+rax\*1\],rcx - +[a-f0-9]+: f3 0f ae 28 setssbsy QWORD PTR \[rax\] + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 42 0f ae 34 26 clrssbsy QWORD PTR \[rsi\+r12\*1\] +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 - +[a-f0-9]+: f3 0f 01 e9 incsspd - +[a-f0-9]+: f3 48 0f 01 e9 incsspq + +[a-f0-9]+: f3 41 0f ae ec incsspd r12d + +[a-f0-9]+: f3 48 0f ae e8 incsspq rax +[a-f0-9]+: f3 41 0f 1e cc rdsspd r12d +[a-f0-9]+: f3 48 0f 1e c8 rdsspq rax +[a-f0-9]+: f3 0f 01 ea saveprevssp @@ -31,7 +31,7 @@ Disassembly of section .text: +[a-f0-9]+: 4a 0f 38 f6 14 39 wrssq \[rcx\+r15\*1\],rdx +[a-f0-9]+: 66 41 0f 38 f5 04 24 wrussd \[r12\],eax +[a-f0-9]+: 66 48 0f 38 f5 0c 03 wrussq \[rbx\+rax\*1\],rcx - +[a-f0-9]+: f3 0f ae 28 setssbsy QWORD PTR \[rax\] + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 42 0f ae 34 26 clrssbsy QWORD PTR \[rsi\+r12\*1\] +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 diff --git a/gas/testsuite/gas/i386/x86-64-cet.d b/gas/testsuite/gas/i386/x86-64-cet.d index 6981e9f..af29827 100644 --- a/gas/testsuite/gas/i386/x86-64-cet.d +++ b/gas/testsuite/gas/i386/x86-64-cet.d @@ -6,8 +6,8 @@ Disassembly of section .text: 0+ <_start>: - +[a-f0-9]+: f3 0f 01 e9 incsspd - +[a-f0-9]+: f3 48 0f 01 e9 incsspq + +[a-f0-9]+: f3 41 0f ae ec incsspd %r12d + +[a-f0-9]+: f3 48 0f ae e8 incsspq %rax +[a-f0-9]+: f3 41 0f 1e cc rdsspd %r12d +[a-f0-9]+: f3 48 0f 1e c8 rdsspq %rax +[a-f0-9]+: f3 0f 01 ea saveprevssp @@ -16,12 +16,12 @@ Disassembly of section .text: +[a-f0-9]+: 4a 0f 38 f6 14 39 wrssq %rdx,\(%rcx,%r15,1\) +[a-f0-9]+: 66 41 0f 38 f5 04 24 wrussd %eax,\(%r12\) +[a-f0-9]+: 66 48 0f 38 f5 0c 03 wrussq %rcx,\(%rbx,%rax,1\) - +[a-f0-9]+: f3 0f ae 28 setssbsy \(%rax\) + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 42 0f ae 34 26 clrssbsy \(%rsi,%r12,1\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 - +[a-f0-9]+: f3 0f 01 e9 incsspd - +[a-f0-9]+: f3 48 0f 01 e9 incsspq + +[a-f0-9]+: f3 41 0f ae ec incsspd %r12d + +[a-f0-9]+: f3 48 0f ae e8 incsspq %rax +[a-f0-9]+: f3 41 0f 1e cc rdsspd %r12d +[a-f0-9]+: f3 48 0f 1e c8 rdsspq %rax +[a-f0-9]+: f3 0f 01 ea saveprevssp @@ -30,7 +30,7 @@ Disassembly of section .text: +[a-f0-9]+: 4a 0f 38 f6 14 39 wrssq %rdx,\(%rcx,%r15,1\) +[a-f0-9]+: 66 41 0f 38 f5 04 24 wrussd %eax,\(%r12\) +[a-f0-9]+: 66 48 0f 38 f5 0c 03 wrussq %rcx,\(%rbx,%rax,1\) - +[a-f0-9]+: f3 0f ae 28 setssbsy \(%rax\) + +[a-f0-9]+: f3 0f 01 e8 setssbsy +[a-f0-9]+: f3 42 0f ae 34 26 clrssbsy \(%rsi,%r12,1\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: f3 0f 1e fb endbr32 diff --git a/gas/testsuite/gas/i386/x86-64-cet.s b/gas/testsuite/gas/i386/x86-64-cet.s index fbed700..33cd4bf 100644 --- a/gas/testsuite/gas/i386/x86-64-cet.s +++ b/gas/testsuite/gas/i386/x86-64-cet.s @@ -1,8 +1,8 @@ # Check 64bit CET instructions .text _start: - incsspd - incsspq + incsspd %r12d + incsspq %rax rdsspd %r12d rdsspq %rax saveprevssp @@ -11,14 +11,14 @@ _start: wrssq %rdx, (%rcx, %r15) wrussd %eax, (%r12) wrussq %rcx, (%rbx, %rax) - setssbsy (%rax) + setssbsy clrssbsy (%rsi, %r12) endbr64 endbr32 .intel_syntax noprefix - incsspd - incsspq + incsspd r12d + incsspq rax rdsspd r12d rdsspq rax saveprevssp @@ -27,7 +27,7 @@ _start: wrssq [rcx+r15],rdx wrussd [r12],eax wrussq [rbx+rax],rcx - setssbsy QWORD PTR [rax] + setssbsy clrssbsy QWORD PTR [rsi+r12] endbr64 endbr32 |