From: tixy@linaro.org (Jon Medhurst (Tixy))
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: Add generic instruction opcode manipulation helpers
Date: Tue, 06 Dec 2011 16:23:27 +0000 [thread overview]
Message-ID: <1323188607.3427.60.camel@linaro1> (raw)
In-Reply-To: <20111206150855.GA5385@mudshark.cambridge.arm.com>
I've cut down the cc list...
On Tue, 2011-12-06 at 15:08 +0000, Will Deacon wrote:
[...]
> Tixy - how much work do you reckon it would be to rework your kprobes
> decoding code into a generic `here are my callbacks, please decode this
> instruction stream for me' type thing?
>
> All I want for hw_breakpoint is to know whether an instruction is a load or
> a store, but even for that it looks like I'll need to duplicate a lot of
> stuff.
The kprobes instruction decoding is pretty specialised if you look at
it. Most of the complexity is in the data tables, (grep for "const union
decode_item") which are processed by kprobe_decode_insn(). For
documentation look for comments before "enum decode_type" and
kprobe_decode_insn(). I suspect that to try and create something generic
out of these would be major work.
An alternative would be to bend the data tables to your purpose by
squeezing in and 'instruction type' parameter into the table (ldr, str,
other) and then parsing the tables with a different function to get the
instruction type. You may find though that there are some classes of
instruction that the existing tables don't decode fully, because kprobes
isn't interested in distinguishing between them.
--
Tixy
prev parent reply other threads:[~2011-12-06 16:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 11:28 [RFC PATCH] ARM: Add generic instruction opcode manipulation helpers Dave Martin
2011-11-25 11:32 ` Dave Martin
2011-11-28 16:59 ` Rabin Vincent
2011-11-28 17:41 ` Dave Martin
2011-11-28 19:20 ` Tixy
2011-11-29 10:42 ` Dave Martin
2011-11-29 14:06 ` Jon Medhurst (Tixy)
2011-11-29 15:27 ` Dave Martin
2011-12-01 17:26 ` Rabin Vincent
2011-12-01 17:59 ` Dave Martin
2011-12-06 15:08 ` Will Deacon
2011-12-06 15:20 ` Dave Martin
2011-12-07 5:22 ` Bi Junxiao
2011-12-07 10:42 ` Dave Martin
2011-12-06 16:23 ` Jon Medhurst (Tixy) [this message]
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=1323188607.3427.60.camel@linaro1 \
--to=tixy@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).