x86: Fix insn decoder to support 0xEA as UD
Status from this message: The following commit has been merged into the x86/asm branch of tip:
Get series with b4
b4 am 174580488057.388420.1338751162448700082.stgit@devnote2Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | x86: Fix opcode map (!REX2) superscript tagsarch/ tools/ | +50 | 0 replies | |
| 2/2 | x86: Stop decoding i64 instructions in x86-64 mode at opcodearch/ arch/ arch/ +5 more | +44 | 1 reply |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Peter Zijlstra (Intel) |
|---|---|
| 1/2 | |
| 2/2 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] x86: Fix insn decoder to support 0xEA as UD
Hi,
Peter found that the current x86 instruction decoder reports the 0xEA instruction as "JMP Ap" always. But objdump says that is invalid on 64bit mode. Thus there is a difference of lenght of 0xEA between objdump and x86 insn decoder.
I found the opcodes which have (i64) superscript are invalid in 64bit mode, if it is not paired with (o64). Thus this stops decoding such instructions if insn->x86_64 is set.
With this fix, the single "0xEA" is correctly decoded as 1 byte instruction in 64bit mode.
------
printf "0:\tea\t\n" | insn_decoder_test -y -vinsn_decoder_test: success: Decoded and checked 1 instructions
------
In this series, I also found a bug in previous (!REX2) tag. The first commit fixes that.
---
Masami Hiramatsu (Google) (2):
x86: Fix opcode map (!REX2) superscript tags
x86: Stop decoding i64 instructions in x86-64 mode at opcode
arch/x86/include/asm/inat.h | 6 +++ arch/x86/lib/insn.c | 7 +++- arch/x86/lib/x86-opcode-map.txt | 56 ++++++++++++++-------------- arch/x86/tools/gen-insn-attr-x86.awk | 7 ++++ tools/arch/x86/include/asm/inat.h | 6 +++ tools/arch/x86/lib/insn.c | 7 +++- tools/arch/x86/lib/x86-opcode-map.txt | 56 ++++++++++++++-------------- tools/arch/x86/tools/gen-insn-attr-x86.awk | 7 ++++ 8 files changed, 94 insertions(+), 58 deletions(-)
--
Masami Hiramatsu (Google) <[email protected]>