Skip to content

Commit

Permalink
x86/decoder: Fix and update the opcodes map
Browse files Browse the repository at this point in the history
Update x86-opcode-map.txt based on the October 2017 Intel SDM publication.
Fix INVPID to INVVPID.
Add UD0 and UD1 instruction opcodes.

Also sync the objtool and perf tooling copies of this file.

Signed-off-by: Randy Dunlap <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
rddunlap authored and Ingo Molnar committed Dec 15, 2017
1 parent 7ee18d6 commit f5b5fab
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
13 changes: 11 additions & 2 deletions arch/x86/lib/x86-opcode-map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ fb: psubq Pq,Qq | vpsubq Vx,Hx,Wx (66),(v1)
fc: paddb Pq,Qq | vpaddb Vx,Hx,Wx (66),(v1)
fd: paddw Pq,Qq | vpaddw Vx,Hx,Wx (66),(v1)
fe: paddd Pq,Qq | vpaddd Vx,Hx,Wx (66),(v1)
ff:
ff: UD0
EndTable

Table: 3-byte opcode 1 (0x0f 0x38)
Expand Down Expand Up @@ -717,7 +717,7 @@ AVXcode: 2
7e: vpermt2d/q Vx,Hx,Wx (66),(ev)
7f: vpermt2ps/d Vx,Hx,Wx (66),(ev)
80: INVEPT Gy,Mdq (66)
81: INVPID Gy,Mdq (66)
81: INVVPID Gy,Mdq (66)
82: INVPCID Gy,Mdq (66)
83: vpmultishiftqb Vx,Hx,Wx (66),(ev)
88: vexpandps/d Vpd,Wpd (66),(ev)
Expand Down Expand Up @@ -970,6 +970,15 @@ GrpTable: Grp9
EndTable

GrpTable: Grp10
# all are UD1
0: UD1
1: UD1
2: UD1
3: UD1
4: UD1
5: UD1
6: UD1
7: UD1
EndTable

# Grp11A and Grp11B are expressed as Grp11 in Intel SDM
Expand Down
15 changes: 12 additions & 3 deletions tools/objtool/arch/x86/insn/x86-opcode-map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ fb: psubq Pq,Qq | vpsubq Vx,Hx,Wx (66),(v1)
fc: paddb Pq,Qq | vpaddb Vx,Hx,Wx (66),(v1)
fd: paddw Pq,Qq | vpaddw Vx,Hx,Wx (66),(v1)
fe: paddd Pq,Qq | vpaddd Vx,Hx,Wx (66),(v1)
ff:
ff: UD0
EndTable

Table: 3-byte opcode 1 (0x0f 0x38)
Expand Down Expand Up @@ -717,7 +717,7 @@ AVXcode: 2
7e: vpermt2d/q Vx,Hx,Wx (66),(ev)
7f: vpermt2ps/d Vx,Hx,Wx (66),(ev)
80: INVEPT Gy,Mdq (66)
81: INVPID Gy,Mdq (66)
81: INVVPID Gy,Mdq (66)
82: INVPCID Gy,Mdq (66)
83: vpmultishiftqb Vx,Hx,Wx (66),(ev)
88: vexpandps/d Vpd,Wpd (66),(ev)
Expand Down Expand Up @@ -896,7 +896,7 @@ EndTable

GrpTable: Grp3_1
0: TEST Eb,Ib
1:
1: TEST Eb,Ib
2: NOT Eb
3: NEG Eb
4: MUL AL,Eb
Expand Down Expand Up @@ -970,6 +970,15 @@ GrpTable: Grp9
EndTable

GrpTable: Grp10
# all are UD1
0: UD1
1: UD1
2: UD1
3: UD1
4: UD1
5: UD1
6: UD1
7: UD1
EndTable

# Grp11A and Grp11B are expressed as Grp11 in Intel SDM
Expand Down
15 changes: 12 additions & 3 deletions tools/perf/util/intel-pt-decoder/x86-opcode-map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ fb: psubq Pq,Qq | vpsubq Vx,Hx,Wx (66),(v1)
fc: paddb Pq,Qq | vpaddb Vx,Hx,Wx (66),(v1)
fd: paddw Pq,Qq | vpaddw Vx,Hx,Wx (66),(v1)
fe: paddd Pq,Qq | vpaddd Vx,Hx,Wx (66),(v1)
ff:
ff: UD0
EndTable

Table: 3-byte opcode 1 (0x0f 0x38)
Expand Down Expand Up @@ -717,7 +717,7 @@ AVXcode: 2
7e: vpermt2d/q Vx,Hx,Wx (66),(ev)
7f: vpermt2ps/d Vx,Hx,Wx (66),(ev)
80: INVEPT Gy,Mdq (66)
81: INVPID Gy,Mdq (66)
81: INVVPID Gy,Mdq (66)
82: INVPCID Gy,Mdq (66)
83: vpmultishiftqb Vx,Hx,Wx (66),(ev)
88: vexpandps/d Vpd,Wpd (66),(ev)
Expand Down Expand Up @@ -896,7 +896,7 @@ EndTable

GrpTable: Grp3_1
0: TEST Eb,Ib
1:
1: TEST Eb,Ib
2: NOT Eb
3: NEG Eb
4: MUL AL,Eb
Expand Down Expand Up @@ -970,6 +970,15 @@ GrpTable: Grp9
EndTable

GrpTable: Grp10
# all are UD1
0: UD1
1: UD1
2: UD1
3: UD1
4: UD1
5: UD1
6: UD1
7: UD1
EndTable

# Grp11A and Grp11B are expressed as Grp11 in Intel SDM
Expand Down

0 comments on commit f5b5fab

Please sign in to comment.