[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49E884C2.9030409@redhat.com>
Date: Fri, 17 Apr 2009 09:31:46 -0400
From: Masami Hiramatsu <mhiramat@...hat.com>
To: "H. Peter Anvin" <hpa@...or.com>
CC: Jim Keniston <jkenisto@...ibm.com>, Ingo Molnar <mingo@...e.hu>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Andi Kleen <andi@...stfloor.org>, kvm@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
systemtap-ml <systemtap@...rces.redhat.com>,
LKML <linux-kernel@...r.kernel.org>,
Vegard Nossum <vegard.nossum@...il.com>,
Avi Kivity <avi@...hat.com>, Roland McGrath <roland@...hat.com>
Subject: Re: [PATCH -tip 3/6 V4.1] x86: instruction decorder API
H. Peter Anvin wrote:
> Masami Hiramatsu wrote:
>>
>> Hmm, I have an idea about instruction table. Usually, instruction tables
>> are encoded with code defined by each decoder/emulator. This method
>> will show their internal code directly, and is hard to maintain when
>> the opcode map is updated. Instead of that, I'd like to suggest using
>> the expressions in the opcode maps in a vender's genuine document (in
>> this case, Intel/AMD's manual) or www.sandpile.org for instruction
>> tables.
>>
>
> Yes, we discussed this at the Collab Summit. I think it's the only sane
> thing.
>
>> e.g.
>>
>> const insn_attr_t onebyte_attr_table[ATTR_TABLE_SIZE] = {
>> /* 0x00-0x0f */
>> AT2(Eb,Gb), AT2(Ev,Gv), AT2(Gb,Eb), AT2(Gv,Ev),
>> AT2(AL,Ib), AT2(rAX,Iz), AT2(ES,i64), AT2(ES,i64),
>> AT2(Eb,Gb), AT2(Ev,Gv), AT2(Gb,Eb), AT2(Gv,Ev),
>> AT2(AL,Ib), AT2(rAX,Iz), AT2(CS,i64), AT(ESC),
>> ...
>>
>> Here, AT and AT2 macros are defined as follows:
>>
>
> I would suggest using an actual parser, rather than relying on cpp for
> this. The parser will be much more powerful, and will make it much
> easier to change data structure radically as we discussed.
Aah, I see. So we'd better make a parser which generates internal
data structure from genuine opcode map in compilation time.
And I changed my mind about internal data structure too.
In this version, I'll use a smallest bits which are needed
for the decoder.
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@...hat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists