Skip to content

Commit 85fd85b

Browse files
kirylIngo Molnar
authored andcommitted
x86/insn: Fix CTEST instruction decoding
insn_decoder_test found a problem with decoding APX CTEST instructions: Found an x86 instruction decoder bug, please report this. ffffffff810021df 62 54 94 05 85 ff ctestneq objdump says 6 bytes, but insn_get_length() says 5 It happens because x86-opcode-map.txt doesn't specify arguments for the instruction and the decoder doesn't expect to see ModRM byte. Fixes: 690ca3a ("x86/insn: Add support for APX EVEX instructions to the opcode map") Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org # v6.10+ Link: https://lore.kernel.org/r/20250423065815.2003231-1-kirill.shutemov@linux.intel.com
1 parent 032ce1e commit 85fd85b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/x86/lib/x86-opcode-map.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,8 @@ AVXcode: 4
996996
83: Grp1 Ev,Ib (1A),(es)
997997
# CTESTSCC instructions are: CTESTB, CTESTBE, CTESTF, CTESTL, CTESTLE, CTESTNB, CTESTNBE, CTESTNL,
998998
# CTESTNLE, CTESTNO, CTESTNS, CTESTNZ, CTESTO, CTESTS, CTESTT, CTESTZ
999-
84: CTESTSCC (ev)
1000-
85: CTESTSCC (es) | CTESTSCC (66),(es)
999+
84: CTESTSCC Eb,Gb (ev)
1000+
85: CTESTSCC Ev,Gv (es) | CTESTSCC Ev,Gv (66),(es)
10011001
88: POPCNT Gv,Ev (es) | POPCNT Gv,Ev (66),(es)
10021002
8f: POP2 Bq,Rq (000),(11B),(ev)
10031003
a5: SHLD Ev,Gv,CL (es) | SHLD Ev,Gv,CL (66),(es)

tools/arch/x86/lib/x86-opcode-map.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,8 @@ AVXcode: 4
996996
83: Grp1 Ev,Ib (1A),(es)
997997
# CTESTSCC instructions are: CTESTB, CTESTBE, CTESTF, CTESTL, CTESTLE, CTESTNB, CTESTNBE, CTESTNL,
998998
# CTESTNLE, CTESTNO, CTESTNS, CTESTNZ, CTESTO, CTESTS, CTESTT, CTESTZ
999-
84: CTESTSCC (ev)
1000-
85: CTESTSCC (es) | CTESTSCC (66),(es)
999+
84: CTESTSCC Eb,Gb (ev)
1000+
85: CTESTSCC Ev,Gv (es) | CTESTSCC Ev,Gv (66),(es)
10011001
88: POPCNT Gv,Ev (es) | POPCNT Gv,Ev (66),(es)
10021002
8f: POP2 Bq,Rq (000),(11B),(ev)
10031003
a5: SHLD Ev,Gv,CL (es) | SHLD Ev,Gv,CL (66),(es)

0 commit comments

Comments
 (0)