From: jon.medhurst@linaro.org (Jon Medhurst (Tixy))
Subject: [ltt-dev] [PATCH V1] ARM: Set bit 0 for thumb mode in kallsyms_lookup_name returned address
Date: Tue, 20 Sep 2011 08:24:44 +0100 [thread overview]
Message-ID: <1316503484.2253.15.camel@linaro1> (raw)
In-Reply-To: <CA+wbFdc_7oB3kgfvfj9y1Tk-q6ZoKTwWRxcHviAnY+9aHw-+tQ@mail.gmail.com>
On Mon, 2011-09-19 at 16:10 +0100, Dave Martin wrote:
> On Mon, Sep 19, 2011 at 10:00 AM, Avik Sil <avik.sil at linaro.org> wrote:
> > This patch fixes the undefined instruction oops due to execution
> > of thumb-2 code in ARM mode. The zero bit in the symbol address
> > returned by kallsyms_lookup_name is not set, leading to switching
> > to ARM mode that generates oops while executing thumb-2 code. For
> > detailed discussion, see [1].
> > [1] http://lists.casi.polymtl.ca/pipermail/ltt-dev/2011-September/005176.html
> >
> > v1:
> > - include wrapper function kallsyms_lookup_funcptr as suggested
> > by Dave Martin
> >
> > Signed-off-by: Avik Sil <avik.sil at linaro.org>
>
> Looks reasonable.
>
> Tixy, could it make sense for that definition of
> kallsyms_lookup_funcptr to migrate into the kernel headers? I had the
> impression that you might also have used this in some places, if it
> had been available.
>
I don't think so, the problems with kprobes are a bit more involved. The
only candidate for using this new function is in kprobes.c ...
/*
* Some oddball architectures like 64bit powerpc have function descriptors
* so this must be overridable.
*/
#ifndef kprobe_lookup_name
#define kprobe_lookup_name(name, addr) \
addr = ((kprobe_opcode_t *)(kallsyms_lookup_name(name)))
#endif
Replacing the kallsyms_lookup_name() here would make kprobes 'better'
for Thumb (avoid a small runtime overhead and some inconsistencies). But
I don't think that the semantics of the new function match this use, and
if it were desirable, we could overload the above kprobes function from
ARM arch code anyway. In fact, I think I'll propose such a patch...
--
Tixy
prev parent reply other threads:[~2011-09-20 7:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 9:00 Avik Sil
2011-09-19 14:57 ` Mathieu Desnoyers
2011-09-19 15:10 ` Dave Martin
2011-09-20 7:24 ` 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=1316503484.2253.15.camel@linaro1 \
--to=jon.medhurst@linaro.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