Skip to content

Commit d777820

Browse files
committed
Replace CET bit with IBT and SHSTK bits.
The latest specification for Intel CET technology defined two new bits instead of previously used CET bit. These are IBT and SHSTK bits. The patch replaces CET bit with IBT and SHSTK bits. gas/ * config/tc-i386.c (cpu_arch): Delete .cet. Add .ibt, .shstk. (cpu_noarch): Add noibt, noshstk. (parse_insn): Change cpucet to cpuibt. * doc/c-i386.texi: Delete .cet. Add .ibt, .shstk. * testsuite/gas/i386/cet-ibt-inval.l: New test. * testsuite/gas/i386/cet-ibt-inval.s: Likewise. * testsuite/gas/i386/cet-shstk-inval.l: Likewise. * testsuite/gas/i386/cet-shstk-inval.s: Likewise. * testsuite/gas/i386/x86-64-cet-ibt-inval.l: Likewise. * testsuite/gas/i386/x86-64-cet-ibt-inval.s: Likewise. * testsuite/gas/i386/x86-64-cet-shstk-inval.l: Likewise. * testsuite/gas/i386/x86-64-cet-shstk-inval.s: Likewise. opcodes/ * i386-gen.c (cpu_flag_init): Delete CPU_CET_FLAGS, CpuCET. Add CPU_IBT_FLAGS, CPU_SHSTK_FLAGS, CPY_ANY_IBT_FLAGS, CPU_ANY_SHSTK_FLAGS, CpuIBT, CpuSHSTK. (cpu_flags): Add CpuIBT, CpuSHSTK. * i386-opc.h (enum): Add CpuIBT, CpuSHSTK. (i386_cpu_flags): Add cpuibt, cpushstk. * i386-opc.tbl: Change CpuCET to CpuSHSTK and CpuIBT. * i386-init.h: Regenerate. * i386-tbl.h: Likewise.
1 parent 4bfce12 commit d777820

18 files changed

Lines changed: 5671 additions & 5563 deletions

‎gas/ChangeLog‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2018-01-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
2+
3+
* config/tc-i386.c (cpu_arch): Delete .cet. Add .ibt, .shstk.
4+
(cpu_noarch): Add noibt, noshstk.
5+
(parse_insn): Change cpucet to cpuibt.
6+
* doc/c-i386.texi: Delete .cet. Add .ibt, .shstk.
7+
* testsuite/gas/i386/cet-ibt-inval.l: New test.
8+
* testsuite/gas/i386/cet-ibt-inval.s: Likewise.
9+
* testsuite/gas/i386/cet-shstk-inval.l: Likewise.
10+
* testsuite/gas/i386/cet-shstk-inval.s: Likewise.
11+
* testsuite/gas/i386/x86-64-cet-ibt-inval.l: Likewise.
12+
* testsuite/gas/i386/x86-64-cet-ibt-inval.s: Likewise.
13+
* testsuite/gas/i386/x86-64-cet-shstk-inval.l: Likewise.
14+
* testsuite/gas/i386/x86-64-cet-shstk-inval.s: Likewise.
15+
116
2018-01-16 Nick Clifton <nickc@redhat.com>
217

318
* po/fr.po: Updated French translation.

‎gas/config/tc-i386.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,10 @@ static const arch_entry cpu_arch[] =
997997
CPU_RDPID_FLAGS, 0 },
998998
{ STRING_COMMA_LEN (".ptwrite"), PROCESSOR_UNKNOWN,
999999
CPU_PTWRITE_FLAGS, 0 },
1000-
{ STRING_COMMA_LEN (".cet"), PROCESSOR_UNKNOWN,
1001-
CPU_CET_FLAGS, 0 },
1000+
{ STRING_COMMA_LEN (".ibt"), PROCESSOR_UNKNOWN,
1001+
CPU_IBT_FLAGS, 0 },
1002+
{ STRING_COMMA_LEN (".shstk"), PROCESSOR_UNKNOWN,
1003+
CPU_SHSTK_FLAGS, 0 },
10021004
{ STRING_COMMA_LEN (".gfni"), PROCESSOR_UNKNOWN,
10031005
CPU_GFNI_FLAGS, 0 },
10041006
{ STRING_COMMA_LEN (".vaes"), PROCESSOR_UNKNOWN,
@@ -1038,6 +1040,8 @@ static const noarch_entry cpu_noarch[] =
10381040
{ STRING_COMMA_LEN ("noavx512_vbmi2"), CPU_ANY_AVX512_VBMI2_FLAGS },
10391041
{ STRING_COMMA_LEN ("noavx512_vnni"), CPU_ANY_AVX512_VNNI_FLAGS },
10401042
{ STRING_COMMA_LEN ("noavx512_bitalg"), CPU_ANY_AVX512_BITALG_FLAGS },
1043+
{ STRING_COMMA_LEN ("noibt"), CPU_ANY_IBT_FLAGS },
1044+
{ STRING_COMMA_LEN ("noshstk"), CPU_ANY_SHSTK_FLAGS },
10411045
};
10421046

10431047
#ifdef I386COFF
@@ -4048,7 +4052,7 @@ parse_insn (char *line, char *mnemonic)
40484052
case PREFIX_EXIST:
40494053
return NULL;
40504054
case PREFIX_DS:
4051-
if (current_templates->start->cpu_flags.bitfield.cpucet)
4055+
if (current_templates->start->cpu_flags.bitfield.cpuibt)
40524056
i.notrack_prefix = current_templates->start->name;
40534057
break;
40544058
case PREFIX_REP:

‎gas/doc/c-i386.texi‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,12 +1239,12 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
12391239
@item @samp{.avx512vbmi} @tab @samp{.avx512_4fmaps} @tab @samp{.avx512_4vnniw}
12401240
@item @samp{.avx512_vpopcntdq} @tab @samp{.avx512_vbmi2} @tab @samp{.avx512_vnni}
12411241
@item @samp{.avx512_bitalg}
1242-
@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.cet}
1242+
@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.ibt}
1243+
@item @samp{.shstk} @tab @samp{.gfni} @tab @samp{.vaes} @tab @samp{.vpclmulqdq}
12431244
@item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5}
12441245
@item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme} @tab @samp{.abm}
12451246
@item @samp{.lwp} @tab @samp{.fma4} @tab @samp{.xop} @tab @samp{.cx16}
1246-
@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx} @tab @samp{.gfni}
1247-
@item @samp{.vaes} @tab @samp{.vpclmulqdq}
1247+
@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx}
12481248
@end multitable
12491249

12501250
Apart from the warning, there are only two other effects on
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.*: Assembler messages:
2+
.*:6: Error: `endbr32' is not supported on `i386.noibt'
3+
.*:7: Error: `endbr64' is not supported on `i386.noibt'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.arch .ibt
2+
endbr32
3+
endbr64
4+
5+
.arch .noibt
6+
endbr32
7+
endbr64
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.*: Assembler messages:
2+
.*:6: Error: `incsspd' is not supported on `i386.noshstk'
3+
.*:7: Error: `rdsspd' is not supported on `i386.noshstk'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.arch .shstk
2+
incsspd %ecx
3+
rdsspd %ecx
4+
5+
.arch .noshstk
6+
incsspd %ecx
7+
rdsspd %ecx

‎gas/testsuite/gas/i386/i386.exp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
418418
run_dump_test "fpu-bad"
419419
run_dump_test "cet"
420420
run_dump_test "cet-intel"
421+
run_list_test "cet-ibt-inval"
422+
run_list_test "cet-shstk-inval"
421423
run_dump_test "pseudos"
422424
run_dump_test "notrack"
423425
run_dump_test "notrack-intel"
@@ -886,6 +888,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
886888
run_dump_test "x86-64-opcode-bad"
887889
run_dump_test "x86-64-cet"
888890
run_dump_test "x86-64-cet-intel"
891+
run_list_test "x86-64-cet-ibt-inval"
892+
run_list_test "x86-64-cet-shstk-inval"
889893
run_dump_test "x86-64-pseudos"
890894
run_dump_test "x86-64-notrack"
891895
run_dump_test "x86-64-notrack-intel"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.*: Assembler messages:
2+
.*:6: Error: `endbr32' is not supported on `x86_64.noibt'
3+
.*:7: Error: `endbr64' is not supported on `x86_64.noibt'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.arch .ibt
2+
endbr32
3+
endbr64
4+
5+
.arch .noibt
6+
endbr32
7+
endbr64

0 commit comments

Comments
 (0)