From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [RESEND][ PATCH -tip -v9 1/7] x86: instruction decoder API Date: Fri, 12 Jun 2009 15:50:57 -0700 Message-ID: <4A32DBD1.30309@zytor.com> References: <20090612224447.17311.72404.stgit@localhost.localdomain> <20090612224455.17311.19421.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Ingo Molnar , Steven Rostedt , lkml , systemtap , kvm , DLE , Jim Keniston , Ananth N Mavinakayanahalli , Srikar Dronamraju , Frederic Weisbecker , Andi Kleen , Vegard Nossum , Avi Kivity , =?UTF-8?B?UHJ6ZW15c8WCYXdQYXdlxYJjenlr?= To: Masami Hiramatsu Return-path: In-Reply-To: <20090612224455.17311.19421.stgit@localhost.localdomain> List-Unsubscribe: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org List-Id: kvm.vger.kernel.org Masami Hiramatsu wrote: > Add x86 instruction decoder to arch-specific libraries. This decoder > can decode x86 instructions used in kernel into prefix, opcode, modrm, > sib, displacement and immediates. This can also show the length of > instructions. > > This version introduces instruction attributes for decoding instructions. > The instruction attribute tables are generated from the opcode map file > (x86-opcode-map.txt) by the generator script(gen-insn-attr-x86.awk). > > Currently, the opcode maps are based on opcode maps in Intel(R) 64 and > IA-32 Architectures Software Developers Manual Vol.2: Appendix.A, > and consist of below two types of opcode tables. > > 1-byte/2-bytes/3-bytes opcodes, which has 256 elements, are > written as below; > > Table: table-name > Referrer: escaped-name > opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...] > (or) > opcode: escape # escaped-name > EndTable > > Group opcodes, which has 8 elements, are written as below; > > GrpTable: GrpXXX > reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...] > EndTable > > These opcode maps do NOT include most of SSE and FP opcodes, because > those opcodes are not used in the kernel. > > Signed-off-by: Masami Hiramatsu > Signed-off-by: Jim Keniston > Cc: H. Peter Anvin > Cc: Steven Rostedt > Cc: Ananth N Mavinakayanahalli > Cc: Srikar Dronamraju > Cc: Ingo Molnar > Cc: Frederic Weisbecker > Cc: Andi Kleen > Cc: Vegard Nossum > Cc: Avi Kivity > Cc: Przemysław Pawełczyk > --- > The decoder looks good by now. Acked-by: H. Peter Anvin -hpa