kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Keniston <jkenisto@us.ibm.com>
To: Masami Hiramatsu <mhiramat@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.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: Wed, 22 Apr 2009 17:47:00 -0700	[thread overview]
Message-ID: <1240447635.3713.21.camel@dyn9047018094.beaverton.ibm.com> (raw)
In-Reply-To: <49EE6235.20706@redhat.com>

On Tue, 2009-04-21 at 20:17 -0400, Masami Hiramatsu wrote:
...
> 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
> ...

We want to keep this info easy to parse. (Who knows how it might be
used, and by whom?)  Your format seems to be
	opcode: mnemonic [comma,separated,operands] [(extra_info)]
which is fine if you stick to it... but your entry for 0f doesn't match
that.

Also, something like
	+ extra_info
would be easier to parse (using, say, awk) than
	(extra_info)

> 
> 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?

Good question.  Sorry, I'm not a lawyer.  Intel and AMD and sandpile.org
all seem to be using the same notation, so the notation's inventor must
not be feeling too proprietary.  Interestingly, sandpile.org asserts a
copyright.

> 
> Thanks,
> 

Jim


  reply	other threads:[~2009-04-23  0:47 UTC|newest]

Thread overview: 17+ 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-03 23:29 ` [PATCH -tip 3/6 V4.1] " Masami Hiramatsu
2009-04-03 23:43   ` H. Peter Anvin
2009-04-04  0:37     ` Masami Hiramatsu
2009-04-06 22:48       ` Jim Keniston
2009-04-06 22:55         ` H. Peter Anvin
2009-04-16 23:31           ` Masami Hiramatsu
2009-04-16 23:39             ` H. Peter Anvin
2009-04-17 13:31               ` Masami Hiramatsu
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-22  0:17                 ` Masami Hiramatsu
2009-04-23  0:47                   ` Jim Keniston [this message]
2009-04-23 17:29                     ` Masami Hiramatsu
2009-04-23 22:22                       ` Jim Keniston
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=1240447635.3713.21.camel@dyn9047018094.beaverton.ibm.com \
    --to=jkenisto@us.ibm.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=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).