linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	vegard.nossum@oracle.com, penberg@kernel.org,
	jamie.iles@oracle.com, mingo@redhat.com, tglx@linutronix.de,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] x86/insn: Extract more information about instructions
Date: Thu, 17 Apr 2014 11:20:21 -0400	[thread overview]
Message-ID: <534FF135.40404@oracle.com> (raw)
In-Reply-To: <534E1559.8050904@hitachi.com>

On 04/16/2014 01:30 AM, Masami Hiramatsu wrote:
> (2014/04/16 13:03), Sasha Levin wrote:
>> > On 04/15/2014 11:54 PM, H. Peter Anvin wrote:
>>> >> On 04/15/2014 08:47 PM, Sasha Levin wrote:
>>>>> >>>>
>>>>> >>>> Yes, if kmemcheck for some reason needs to figure out if an instruction
>>>>> >>>> is a MOV variant we'll need to list quite a few mnemonics, but that list
>>>>> >>>> will be much shorter and more readable than a corresponding list of opcodes.
>>>>> >>>>
>>> >> You're completely missing my point.  If you are looking at MOV, with
>>> >> 80%+ probability you're doing something very, very wrong, because you
>>> >> will be including instructions that do something completely different
>>> >> from what you thought.
>>> >>
>>> >> This is true for a lot of the x86 instructions.
>> > 
>> > Right, but assuming that the AND example I presented earlier makes sense, I
>> > can't create mnemonic entries only for instructions where doing so would
>> > "probably" be right.
>> > 
>> > If there are use cases where working with mnemonics is correct, we should
>> > be doing that in kmemcheck. If the way kmemcheck deals with mnemonics is
>> > incorrect we should go ahead and fix kmemcheck.
> In that case, as I said, the mnemonics classifier should be build in
> kmemcheck at this point, since we cannot provide any general mnemonic
> classifier for that purpose. If it becomes enough generic, and accurate,
> it would be better consolidate both, I think.

kmemcheck isn't an instruction decoder, it should not be parsing x86-opcode-map.txt,
that's why there's an API to access that in inat.c.

Basically you're saying that you don't want to extend the API to extract the extra
mnemonic field which already exists in the data we're extracting from anyways, and
that kmemcheck should go around the API and do it itself.

It's not like the instruction decoder is a generic piece of code right now anyways,
it only serves mostly [k,u]probes and was built around the their requirements, and
now everybody are surprised that kmemcheck has different requirements than kprobes.


Thanks,
Sasha

  reply	other threads:[~2014-04-17 15:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 17:44 [PATCH 1/4] kmemcheck: add additional selfchecks Sasha Levin
2014-04-14 17:44 ` [PATCH 2/4] x86: Move instruction decoder data into header Sasha Levin
2014-04-15  1:41   ` Masami Hiramatsu
2014-04-15  2:28     ` Sasha Levin
2014-04-15  3:10       ` Masami Hiramatsu
2014-04-15 14:24         ` Sasha Levin
2014-04-16  3:06           ` Masami Hiramatsu
2014-04-14 17:44 ` [PATCH 3/4] x86/insn: Extract more information about instructions Sasha Levin
2014-04-15  3:12   ` Masami Hiramatsu
2014-04-15  4:36     ` Masami Hiramatsu
2014-04-15 15:10     ` Sasha Levin
2014-04-16  3:26       ` H. Peter Anvin
2014-04-16  3:47         ` Sasha Levin
2014-04-16  3:54           ` H. Peter Anvin
2014-04-16  4:03             ` Sasha Levin
2014-04-16  4:31               ` H. Peter Anvin
2014-04-16  5:30               ` Masami Hiramatsu
2014-04-17 15:20                 ` Sasha Levin [this message]
2014-04-17 15:28                   ` H. Peter Anvin
2014-04-17 17:31                     ` Sasha Levin
2014-04-18  3:40                       ` Masami Hiramatsu
2014-04-18  3:45                         ` H. Peter Anvin
2014-04-18 15:47                           ` Sasha Levin
2014-04-18 16:48                             ` H. Peter Anvin
2014-04-16  5:44       ` Masami Hiramatsu
2014-04-17 15:33         ` Sasha Levin
2014-04-18  3:25           ` Masami Hiramatsu
2014-04-14 17:44 ` [PATCH 4/4] kmemcheck: Switch to using kernel disassembler Sasha Levin
2014-04-15  8:17   ` Pekka Enberg

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=534FF135.40404@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jamie.iles@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=penberg@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vegard.nossum@oracle.com \
    --cc=x86@kernel.org \
    /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).