All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>, Ingo Molnar <mingo@elte.hu>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Andi Kleen <andi@firstfloor.org>,
	kvm@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	systemtap-ml <systemtap@sources.redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Vegard Nossum <vegard.nossum@gmail.com>,
	Avi Kivity <avi@redhat.com>, Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH -tip 3/6 V4.1] x86: instruction decorder API
Date: Tue, 21 Apr 2009 20:17:57 -0400	[thread overview]
Message-ID: <49EE6235.20706@redhat.com> (raw)
In-Reply-To: <49E7C87E.8000202@zytor.com>

H. Peter Anvin wrote:
> Jim Keniston wrote:
>> It looks like AT2(Ev,Gv) would yield the same bits as AT2(Gv,Ev).  It'd
>> be nice not to lose the operand-order information.  And we'd have to
>> make clear whether which notation we're using -- src,dest as in the gnu
>> assembler, or dest,src as in the AMD (and Intel?) manuals.
>>
> 
> Since the information would come from the manuals, I would recommend 
> following them (dst first.)
>

Hi Peter and Jim,

Now what I'm doing is making opcode tables like this.

Table: 1-byte opcode
Alias: none
00: ADD Eb,Gb
01: ADD Ev,Gv
02: ADD Gb,Eb
03: ADD Gv,Ev
04: ADD AL,Ib
05: ADD rAX,Iz
06: PUSH ES (i64)
07: POP ES (i64)
08: OR Eb,Gb
09: OR Ev,Gv
0a: OR Gb,Eb
0b: OR Gv,Ev
0c: OR AL,Ib
0d: OR rAX,Iz
0e: PUSH CS
0f: 2-byte escape
...

and a parser script which parses them into,

const insn_attr_t primary_table[INAT_TABLE_SIZE] = {
	[0x04] = INAT_IMM(IMM_SIZE_BYTE)
	[0x05] = INAT_IMM(IMM_SIZE_VWORD32)
	[0x0c] = INAT_IMM(IMM_SIZE_BYTE)
	[0x0d] = INAT_IMM(IMM_SIZE_VWORD32)
	[0x0f] = INAT_ESC(IMM_ESC_2BYTE)
...

(note, instructions which has no attributes for decoder, are just ignored)


By the way, I'm worried about legal things of Intel's instruction
encoding expressions. Would you think there is any problem if we
have those tables in the kernel tree?

Thanks,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


  reply	other threads:[~2009-04-22  0:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 17:24 [PATCH -tip 3/6 V4] x86: instruction decorder API Masami Hiramatsu
2009-04-02 17:24 ` Masami Hiramatsu
2009-04-03 23:29 ` [PATCH -tip 3/6 V4.1] " Masami Hiramatsu
2009-04-03 23:29   ` Masami Hiramatsu
2009-04-03 23:43   ` H. Peter Anvin
2009-04-03 23:43     ` H. Peter Anvin
2009-04-04  0:37     ` Masami Hiramatsu
2009-04-04  0:37       ` Masami Hiramatsu
2009-04-06 22:48       ` Jim Keniston
2009-04-06 22:48         ` Jim Keniston
2009-04-06 22:55         ` H. Peter Anvin
2009-04-06 22:55           ` H. Peter Anvin
2009-04-16 23:31           ` Masami Hiramatsu
2009-04-16 23:31             ` Masami Hiramatsu
2009-04-16 23:39             ` H. Peter Anvin
2009-04-16 23:39               ` H. Peter Anvin
2009-04-17 13:31               ` Masami Hiramatsu
2009-04-17 13:31                 ` Masami Hiramatsu
2009-04-17 18:07                 ` H. Peter Anvin
2009-04-17 18:07                   ` H. Peter Anvin
2009-04-17  0:06             ` Jim Keniston
2009-04-17  0:08               ` H. Peter Anvin
2009-04-17  0:08                 ` H. Peter Anvin
2009-04-22  0:17                 ` Masami Hiramatsu [this message]
2009-04-22  0:17                   ` Masami Hiramatsu
2009-04-23  0:47                   ` Jim Keniston
2009-04-23 17:29                     ` Masami Hiramatsu
2009-04-23 17:29                       ` Masami Hiramatsu
2009-04-23 22:22                       ` Jim Keniston
2009-04-24  3:53                         ` Masami Hiramatsu
2009-04-24  3:53                           ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EE6235.20706@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jkenisto@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=systemtap@sources.redhat.com \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.