From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: "Jon Medhurst (Tixy)" <tixy@linaro.org>
Cc: Wang Nan <wangnan0@huawei.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
davem@davemloft.net,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Will Deacon <will.deacon@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Li Zefan <lizefan@huawei.com>,
peifeiyue@huawei.com
Subject: Re: [RFC PATCH] kprobes: arm: enable OPTPROBES for arm 32
Date: Wed, 6 Aug 2014 23:57:19 +0100 [thread overview]
Message-ID: <20140806225719.GW30282@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1407335003.3006.38.camel@linaro1.home>
On Wed, Aug 06, 2014 at 03:23:23PM +0100, Jon Medhurst (Tixy) wrote:
> On Tue, 2014-08-05 at 15:28 +0800, Wang Nan wrote:
> > +static inline int
> > +arm_branch_to_addr(unsigned int *pinst, void *src, void *dest)
> > +{
> > + unsigned int inst = 0xea000000;
> > + long offset = (unsigned long)(dest) -
> > + ((unsigned long)(src) + 8);
> > + if ((offset > 0x3fffffc) || (offset < -0x3fffffc)) {
> > + printk(KERN_WARNING "Failed to instrument %pS to %pS\n", src, dest);
> > + return -EINVAL;
> > + }
> > +
> > + inst |= (((unsigned long)offset) >> 2) & (0x00ffffffUL);
> > + *pinst = inst;
> > + return 0;
> > +}
> > +
>
> This looks remarkably similar to the code in arch/arm/kernel/insn.c so I
> think you can probably just use the existing arm_gen_branch() function.
Which would be a better idea as the version found in insn.c is not
buggy.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-08-06 22:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 7:28 Wang Nan
2014-08-06 4:44 ` Masami Hiramatsu
2014-08-06 6:24 ` Wang Nan
2014-08-07 6:59 ` Masami Hiramatsu
2014-08-08 1:25 ` Wang Nan
2014-08-08 2:07 ` Masami Hiramatsu
2014-08-06 13:36 ` Jon Medhurst (Tixy)
2014-08-06 13:40 ` Wang Nan
2014-08-06 14:23 ` Jon Medhurst (Tixy)
2014-08-06 22:57 ` Russell King - ARM Linux [this message]
2014-08-06 22:55 ` Russell King - ARM Linux
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=20140806225719.GW30282@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=peifeiyue@huawei.com \
--cc=tixy@linaro.org \
--cc=wangnan0@huawei.com \
--cc=will.deacon@arm.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
all inboxes | Powered by JetHome®