Add support for Intel TDX instructions.
gas/ * NEWS: Add TDX. * config/tc-i386.c (cpu_arch): Add .tdx. (cpu_noarch): Likewise. * doc/c-i386.texi: Document tdx. * testsuite/gas/i386/i386.exp: Run tdx tests. * testsuite/gas/i386/tdx.d: Likewise. * testsuite/gas/i386/tdx.s: Likewise. * testsuite/gas/i386/x86-64-tdx.d: Likewise. * testsuite/gas/i386/x86-64-tdx.s: Likewise. opcodes/ * i386-dis.c (enum): Add PREFIX_0F01_REG_1_RM_5, PREFIX_0F01_REG_1_RM_6, PREFIX_0F01_REG_1_RM_7, X86_64_0F01_REG_1_RM_5_P_2, X86_64_0F01_REG_1_RM_6_P_2, X86_64_0F01_REG_1_RM_7_P_2. (prefix_table): Likewise. (x86_64_table): Likewise. (rm_table): Likewise. * i386-gen.c (cpu_flag_init): Add CPU_TDX_FLAGS and CPU_ANY_TDX_FLAGS. (cpu_flags): Add CpuTDX. * i386-opc.h (enum): Add CpuTDX. (i386_cpu_flags): Add cputdx. * i386-opc.tbl: Add TDX insns. * i386-init.h: Regenerate. * i386-tbl.h: Likewise.
This commit is contained in:
parent
7469ddd78f
commit
81d54bb7ae
@ -1,4 +1,16 @@
|
||||
20200-09-17 Cooper Qu <cooper.qu@linux.alibaba.com>
|
||||
2020-09-24 Lili Cui <lili.cui@intel.com>
|
||||
|
||||
* NEWS: Add TDX.
|
||||
* config/tc-i386.c (cpu_arch): Add .tdx.
|
||||
(cpu_noarch): Likewise.
|
||||
* doc/c-i386.texi: Document tdx.
|
||||
* testsuite/gas/i386/i386.exp: Run tdx tests.
|
||||
* testsuite/gas/i386/tdx.d: Likewise.
|
||||
* testsuite/gas/i386/tdx.s: Likewise.
|
||||
* testsuite/gas/i386/x86-64-tdx.d: Likewise.
|
||||
* testsuite/gas/i386/x86-64-tdx.s: Likewise.
|
||||
|
||||
2020-09-17 Cooper Qu <cooper.qu@linux.alibaba.com>
|
||||
|
||||
* config/tc-csky.c (parse_type_ctrlreg): Use function
|
||||
csky_get_control_regno to operand.
|
||||
|
||||
1
gas/NEWS
1
gas/NEWS
@ -1,4 +1,5 @@
|
||||
-*- text -*-
|
||||
* Add support for Intel TDX instructions.
|
||||
|
||||
* Add support for Intel Key Locker instructions.
|
||||
|
||||
|
||||
@ -1220,6 +1220,8 @@ static const arch_entry cpu_arch[] =
|
||||
CPU_AVX512_BF16_FLAGS, 0 },
|
||||
{ STRING_COMMA_LEN (".avx512_vp2intersect"), PROCESSOR_UNKNOWN,
|
||||
CPU_AVX512_VP2INTERSECT_FLAGS, 0 },
|
||||
{ STRING_COMMA_LEN (".tdx"), PROCESSOR_UNKNOWN,
|
||||
CPU_TDX_FLAGS, 0 },
|
||||
{ STRING_COMMA_LEN (".enqcmd"), PROCESSOR_UNKNOWN,
|
||||
CPU_ENQCMD_FLAGS, 0 },
|
||||
{ STRING_COMMA_LEN (".serialize"), PROCESSOR_UNKNOWN,
|
||||
@ -1282,6 +1284,7 @@ static const noarch_entry cpu_noarch[] =
|
||||
{ STRING_COMMA_LEN ("noavx512_bf16"), CPU_ANY_AVX512_BF16_FLAGS },
|
||||
{ STRING_COMMA_LEN ("noavx512_vp2intersect"),
|
||||
CPU_ANY_AVX512_VP2INTERSECT_FLAGS },
|
||||
{ STRING_COMMA_LEN ("notdx"), CPU_ANY_TDX_FLAGS },
|
||||
{ STRING_COMMA_LEN ("noenqcmd"), CPU_ANY_ENQCMD_FLAGS },
|
||||
{ STRING_COMMA_LEN ("noserialize"), CPU_ANY_SERIALIZE_FLAGS },
|
||||
{ STRING_COMMA_LEN ("notsxldtrk"), CPU_ANY_TSXLDTRK_FLAGS },
|
||||
|
||||
@ -209,6 +209,7 @@ accept various extension mnemonics. For example,
|
||||
@code{avx512_vnni},
|
||||
@code{avx512_bitalg},
|
||||
@code{avx512_vp2intersect},
|
||||
@code{tdx},
|
||||
@code{avx512_bf16},
|
||||
@code{noavx512f},
|
||||
@code{noavx512cd},
|
||||
@ -226,6 +227,7 @@ accept various extension mnemonics. For example,
|
||||
@code{noavx512_vnni},
|
||||
@code{noavx512_bitalg},
|
||||
@code{noavx512_vp2intersect},
|
||||
@code{notdx},
|
||||
@code{noavx512_bf16},
|
||||
@code{noenqcmd},
|
||||
@code{noserialize},
|
||||
@ -1503,6 +1505,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
|
||||
@item @samp{.avx512vbmi} @tab @samp{.avx512_4fmaps} @tab @samp{.avx512_4vnniw}
|
||||
@item @samp{.avx512_vpopcntdq} @tab @samp{.avx512_vbmi2} @tab @samp{.avx512_vnni}
|
||||
@item @samp{.avx512_bitalg} @tab @samp{.avx512_bf16} @tab @samp{.avx512_vp2intersect}
|
||||
@item @samp{.tdx}
|
||||
@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.ibt}
|
||||
@item @samp{.wbnoinvd} @tab @samp{.pconfig} @tab @samp{.waitpkg} @tab @samp{.cldemote}
|
||||
@item @samp{.shstk} @tab @samp{.gfni} @tab @samp{.vaes} @tab @samp{.vpclmulqdq}
|
||||
|
||||
@ -489,6 +489,7 @@ if [gas_32_check] then {
|
||||
run_dump_test "enqcmd-intel"
|
||||
run_list_test "enqcmd-inval"
|
||||
run_dump_test "serialize"
|
||||
run_dump_test "tdx"
|
||||
run_dump_test "tsxldtrk"
|
||||
run_dump_test "vp2intersect"
|
||||
run_dump_test "vp2intersect-intel"
|
||||
@ -1097,6 +1098,7 @@ if [gas_64_check] then {
|
||||
run_dump_test "x86-64-enqcmd-intel"
|
||||
run_list_test "x86-64-enqcmd-inval"
|
||||
run_dump_test "x86-64-serialize"
|
||||
run_dump_test "x86-64-tdx"
|
||||
run_dump_test "x86-64-tsxldtrk"
|
||||
run_dump_test "x86-64-vp2intersect"
|
||||
run_dump_test "x86-64-vp2intersect-intel"
|
||||
|
||||
12
gas/testsuite/gas/i386/tdx.d
Normal file
12
gas/testsuite/gas/i386/tdx.d
Normal file
@ -0,0 +1,12 @@
|
||||
#as:
|
||||
#objdump: -dw
|
||||
#name: TDX insns
|
||||
#source: tdx.s
|
||||
|
||||
.*: +file format .*
|
||||
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+ <_start>:
|
||||
[ ]*[a-f0-9]+: 66 0f 01 cc + tdcall *
|
||||
#pass
|
||||
5
gas/testsuite/gas/i386/tdx.s
Normal file
5
gas/testsuite/gas/i386/tdx.s
Normal file
@ -0,0 +1,5 @@
|
||||
# Check TDX instructions.
|
||||
|
||||
.text
|
||||
_start:
|
||||
tdcall
|
||||
15
gas/testsuite/gas/i386/x86-64-tdx.d
Normal file
15
gas/testsuite/gas/i386/x86-64-tdx.d
Normal file
@ -0,0 +1,15 @@
|
||||
#as:
|
||||
#objdump: -dw
|
||||
#name: x86_64 TDX insns
|
||||
#source: x86-64-tdx.s
|
||||
|
||||
.*: +file format .*
|
||||
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+ <_start>:
|
||||
[ ]*[a-f0-9]+: 66 0f 01 cc + tdcall *
|
||||
[ ]*[a-f0-9]+: 66 0f 01 cd + seamret *
|
||||
[ ]*[a-f0-9]+: 66 0f 01 ce + seamops *
|
||||
[ ]*[a-f0-9]+: 66 0f 01 cf + seamcall *
|
||||
#pass
|
||||
8
gas/testsuite/gas/i386/x86-64-tdx.s
Normal file
8
gas/testsuite/gas/i386/x86-64-tdx.s
Normal file
@ -0,0 +1,8 @@
|
||||
# Check TDX instructions.
|
||||
|
||||
.text
|
||||
_start:
|
||||
tdcall
|
||||
seamret
|
||||
seamops
|
||||
seamcall
|
||||
@ -1,3 +1,21 @@
|
||||
2020-09-24 Lili Cui <lili.cui@intel.com>
|
||||
|
||||
* i386-dis.c (enum): Add PREFIX_0F01_REG_1_RM_5,
|
||||
PREFIX_0F01_REG_1_RM_6, PREFIX_0F01_REG_1_RM_7,
|
||||
X86_64_0F01_REG_1_RM_5_P_2, X86_64_0F01_REG_1_RM_6_P_2,
|
||||
X86_64_0F01_REG_1_RM_7_P_2.
|
||||
(prefix_table): Likewise.
|
||||
(x86_64_table): Likewise.
|
||||
(rm_table): Likewise.
|
||||
* i386-gen.c (cpu_flag_init): Add CPU_TDX_FLAGS
|
||||
and CPU_ANY_TDX_FLAGS.
|
||||
(cpu_flags): Add CpuTDX.
|
||||
* i386-opc.h (enum): Add CpuTDX.
|
||||
(i386_cpu_flags): Add cputdx.
|
||||
* i386-opc.tbl: Add TDX insns.
|
||||
* i386-init.h: Regenerate.
|
||||
* i386-tbl.h: Likewise.
|
||||
|
||||
2020-09-17 Cooper Qu <<cooper.qu@linux.alibaba.com>>
|
||||
|
||||
opcodes/
|
||||
|
||||
@ -952,6 +952,10 @@ enum
|
||||
enum
|
||||
{
|
||||
PREFIX_90 = 0,
|
||||
PREFIX_0F01_REG_1_RM_4,
|
||||
PREFIX_0F01_REG_1_RM_5,
|
||||
PREFIX_0F01_REG_1_RM_6,
|
||||
PREFIX_0F01_REG_1_RM_7,
|
||||
PREFIX_0F01_REG_3_RM_1,
|
||||
PREFIX_0F01_REG_5_MOD_0,
|
||||
PREFIX_0F01_REG_5_MOD_3_RM_0,
|
||||
@ -1175,6 +1179,9 @@ enum
|
||||
X86_64_EA,
|
||||
X86_64_0F01_REG_0,
|
||||
X86_64_0F01_REG_1,
|
||||
X86_64_0F01_REG_1_RM_5_PREFIX_2,
|
||||
X86_64_0F01_REG_1_RM_6_PREFIX_2,
|
||||
X86_64_0F01_REG_1_RM_7_PREFIX_2,
|
||||
X86_64_0F01_REG_2,
|
||||
X86_64_0F01_REG_3,
|
||||
X86_64_0F24,
|
||||
@ -3083,6 +3090,38 @@ static const struct dis386 prefix_table[][4] = {
|
||||
{ NULL, { { NULL, 0 } }, PREFIX_IGNORED }
|
||||
},
|
||||
|
||||
/* PREFIX_0F01_REG_1_RM_4 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ Bad_Opcode },
|
||||
{ "tdcall", { Skip_MODRM }, 0 },
|
||||
{ Bad_Opcode },
|
||||
},
|
||||
|
||||
/* PREFIX_0F01_REG_1_RM_5 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ Bad_Opcode },
|
||||
{ X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2) },
|
||||
{ Bad_Opcode },
|
||||
},
|
||||
|
||||
/* PREFIX_0F01_REG_1_RM_6 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ Bad_Opcode },
|
||||
{ X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2) },
|
||||
{ Bad_Opcode },
|
||||
},
|
||||
|
||||
/* PREFIX_0F01_REG_1_RM_7 */
|
||||
{
|
||||
{ "encls", { Skip_MODRM }, 0 },
|
||||
{ Bad_Opcode },
|
||||
{ X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2) },
|
||||
{ Bad_Opcode },
|
||||
},
|
||||
|
||||
/* PREFIX_0F01_REG_3_RM_1 */
|
||||
{
|
||||
{ "vmmcall", { Skip_MODRM }, 0 },
|
||||
@ -4205,6 +4244,24 @@ static const struct dis386 x86_64_table[][2] = {
|
||||
{ "sidt", { M }, 0 },
|
||||
},
|
||||
|
||||
/* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ "seamret", { Skip_MODRM }, 0 },
|
||||
},
|
||||
|
||||
/* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ "seamops", { Skip_MODRM }, 0 },
|
||||
},
|
||||
|
||||
/* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
|
||||
{
|
||||
{ Bad_Opcode },
|
||||
{ "seamcall", { Skip_MODRM }, 0 },
|
||||
},
|
||||
|
||||
/* X86_64_0F01_REG_2 */
|
||||
{
|
||||
{ "lgdt{Q|Q}", { M }, 0 },
|
||||
@ -8784,10 +8841,10 @@ static const struct dis386 rm_table[][8] = {
|
||||
{ "mwait", { { OP_Mwait, 0 } }, 0 },
|
||||
{ "clac", { Skip_MODRM }, 0 },
|
||||
{ "stac", { Skip_MODRM }, 0 },
|
||||
{ Bad_Opcode },
|
||||
{ Bad_Opcode },
|
||||
{ Bad_Opcode },
|
||||
{ "encls", { Skip_MODRM }, 0 },
|
||||
{ PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4) },
|
||||
{ PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5) },
|
||||
{ PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6) },
|
||||
{ PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7) },
|
||||
},
|
||||
{
|
||||
/* RM_0F01_REG_2 */
|
||||
|
||||
@ -313,6 +313,8 @@ static initializer cpu_flag_init[] =
|
||||
"CpuSERIALIZE" },
|
||||
{ "CPU_AVX512_VP2INTERSECT_FLAGS",
|
||||
"CpuAVX512_VP2INTERSECT" },
|
||||
{ "CPU_TDX_FLAGS",
|
||||
"CpuTDX" },
|
||||
{ "CPU_RDPRU_FLAGS",
|
||||
"CpuRDPRU" },
|
||||
{ "CPU_MCOMMIT_FLAGS",
|
||||
@ -409,6 +411,8 @@ static initializer cpu_flag_init[] =
|
||||
"CpuSERIALIZE" },
|
||||
{ "CPU_ANY_AVX512_VP2INTERSECT_FLAGS",
|
||||
"CpuAVX512_VP2INTERSECT" },
|
||||
{ "CPU_ANY_TDX_FLAGS",
|
||||
"CpuTDX" },
|
||||
{ "CPU_ANY_TSXLDTRK_FLAGS",
|
||||
"CpuTSXLDTRK" },
|
||||
{ "CPU_ANY_KL_FLAGS",
|
||||
@ -619,6 +623,7 @@ static bitfield cpu_flags[] =
|
||||
BITFIELD (CpuAVX512_BITALG),
|
||||
BITFIELD (CpuAVX512_BF16),
|
||||
BITFIELD (CpuAVX512_VP2INTERSECT),
|
||||
BITFIELD (CpuTDX),
|
||||
BITFIELD (CpuMWAITX),
|
||||
BITFIELD (CpuCLZERO),
|
||||
BITFIELD (CpuOSPKE),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -210,6 +210,8 @@ enum
|
||||
CpuAVX512_BF16,
|
||||
/* Intel AVX-512 VP2INTERSECT Instructions support required. */
|
||||
CpuAVX512_VP2INTERSECT,
|
||||
/* TDX Instructions support required. */
|
||||
CpuTDX,
|
||||
/* mwaitx instruction required */
|
||||
CpuMWAITX,
|
||||
/* Clzero instruction required */
|
||||
@ -375,6 +377,7 @@ typedef union i386_cpu_flags
|
||||
unsigned int cpuavx512_bitalg:1;
|
||||
unsigned int cpuavx512_bf16:1;
|
||||
unsigned int cpuavx512_vp2intersect:1;
|
||||
unsigned int cputdx:1;
|
||||
unsigned int cpumwaitx:1;
|
||||
unsigned int cpuclzero:1;
|
||||
unsigned int cpuospke:1;
|
||||
|
||||
@ -4133,3 +4133,12 @@ aesencwide256kl, 1, 0xf30f38d8, 0x2, 3, CpuWideKL, Modrm|No_bSuf|No_wSuf|No_lSuf
|
||||
aesdecwide256kl, 1, 0xf30f38d8, 0x3, 3, CpuWideKL, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Unspecified|BaseIndex }
|
||||
|
||||
// KEYLOCKER instructions end.
|
||||
|
||||
// TDX instructions.
|
||||
|
||||
tdcall, 0, 0x660f01cc, None, 3, CpuTDX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 }
|
||||
seamret, 0, 0x660f01cd, None, 3, CpuTDX|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 }
|
||||
seamops, 0, 0x660f01ce, None, 3, CpuTDX|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 }
|
||||
seamcall, 0, 0x660f01cf, None, 3, CpuTDX|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 }
|
||||
|
||||
// TDX instructions end.
|
||||
|
||||
8164
opcodes/i386-tbl.h
8164
opcodes/i386-tbl.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user