From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: Re: [PATCH -tip v14 01/12] x86: instruction decoder API Date: Thu, 20 Aug 2009 02:21:14 +0200 Message-ID: <20090820002113.GK4972@nowhere> References: <20090813203403.31965.20973.stgit@localhost.localdomain> <20090813203413.31965.49709.stgit@localhost.localdomain> <20090819234227.GJ4972@nowhere> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Ingo Molnar , Steven Rostedt , lkml , systemtap , kvm , DLE , Jim Keniston , "H. Peter Anvin" , Ananth N Mavinakayanahalli , Avi Kivity , Andi Kleen , Christoph Hellwig , "Frank Ch. Eigler" , Jason Baron , "K.Prasad" , Lai Jiangshan , Li Zefan , =?utf-8?B?UHJ6ZW15c8WCYXdQYXdlxYJjenlr?= , Roland McGrath , Sam Ravnborg , Srikar Dronamraju , Tom Zanussi , Vegard Nossum To: Masami Hiramatsu Return-path: Content-Disposition: inline In-Reply-To: <20090819234227.GJ4972@nowhere> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, Aug 20, 2009 at 01:42:31AM +0200, Frederic Weisbecker wrote: > On Thu, Aug 13, 2009 at 04:34:13PM -0400, Masami Hiramatsu wrote: > > Add x86 instruction decoder to arch-specific libraries. This decode= r > > can decode x86 instructions used in kernel into prefix, opcode, mod= rm, > > sib, displacement and immediates. This can also show the length of > > instructions. > >=20 > > This version introduces instruction attributes for decoding instruc= tions. > > The instruction attribute tables are generated from the opcode map = file > > (x86-opcode-map.txt) by the generator script(gen-insn-attr-x86.awk)= =2E > >=20 > > 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. > >=20 > > 1-byte/2-bytes/3-bytes opcodes, which has 256 elements, are > > written as below; > >=20 > > Table: table-name > > Referrer: escaped-name > > opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra= 2)...] [| 2nd-mnemonic ...] > > (or) > > opcode: escape # escaped-name > > EndTable > >=20 > > Group opcodes, which has 8 elements, are written as below; > >=20 > > GrpTable: GrpXXX > > reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [|= 2nd-mnemonic ...] > > EndTable > >=20 > > These opcode maps include a few SSE and FP opcodes (for setup), bec= ause > > those opcodes are used in the kernel. > >=20 >=20 >=20 > I'm getting the following build error on an old K7 box: >=20 > arch/x86/lib/inat.c: In function =E2=80=98inat_get_opcode_attribute=E2= =80=99: > arch/x86/lib/inat.c:29: erreur: =E2=80=98inat_primary_table=E2=80=99 = undeclared (first use in this function) > arch/x86/lib/inat.c:29: erreur: (Each undeclared identifier is report= ed only once > arch/x86/lib/inat.c:29: erreur: for each function it appears in.) >=20 >=20 > I've attached my config. I haven't such problem on a dual x86-64 box. Actually I have the same problem in x86-64 The content of my arch/x86/lib/inat-tables.c: /* x86 opcode map generated from x86-opcode-map.txt */ /* Do not change this code. */ /* Table: one byte opcode */ /* Escape opcode map array */ const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1][INAT_LPRE= =46IX_MAX + 1] =3D { }; /* Group opcode map array */ const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1][INAT_LPREF= IX_MAX + 1] =3D { }; I guess there is a problem with the generation of this file.