Re: [PATCH -mm] kprobes: kprobe-booster for ia64
- From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
- Date: Mon, 10 Mar 2008 14:25:44 -0400
Hello Shaohua,
Thank you for reviewing!
Shaohua Li wrote:
On Sat, 2008-03-08 at 00:01 +0800, Masami Hiramatsu wrote:
From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>slot = (unsigned long)p->addr & 0xf ?
+
+/* Prepare long jump bundle and disables other boosters if need */
+static void __kprobes prepare_booster(struct kprobe *p)
+{
+ unsigned long addr = (unsigned long)p->addr & ~0xFULL;
+ unsigned int slot = addr & 0xf;
You are correct. I'll fix that.
+ struct kprobe *other_kp;There is no lock to protect the flag. If one cpu invokes other_kp and
+
+ if (can_boost(&p->ainsn.insn[0].bundle, slot, addr)) {
+ set_brl_inst(&p->ainsn.insn[1].bundle, (bundle_t
*)addr + 1);
+ p->ainsn.inst_flag |= INST_FLAG_BOOSTABLE;
+ }
+
+ /* disables boosters in previous slots */
+ for (; addr < (unsigned long)p->addr; addr++) {
+ other_kp = get_kprobe((void *)addr);
+ if (other_kp)
+ other_kp->ainsn.inst_flag &=
~INST_FLAG_BOOSTABLE;
+ }
+}
+
the other cpu is changing the flag, what's the result?
I think that other cpu never change the flag, because the caller of this
function(__register_kprobe) locks kprobe_mutex in kernel/kprobes.c.
Thanks,
Shaohua
Thanks,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH -mm] kprobes: kprobe-booster for ia64
- From: Shaohua Li
- [PATCH -mm] kprobes: fix prepare_booster to get correct slot
- From: Masami Hiramatsu
- Re: [PATCH -mm] kprobes: kprobe-booster for ia64
- References:
- [PATCH -mm] kprobes: kprobe-booster for ia64
- From: Masami Hiramatsu
- Re: [PATCH -mm] kprobes: kprobe-booster for ia64
- From: Shaohua Li
- [PATCH -mm] kprobes: kprobe-booster for ia64
- Prev by Date: Re: 2.6.25-rc4 todays: BUG: unable to handle kernel NULL pointer dereference at 0000000000000138
- Next by Date: Re: [RFC] JBD ordered mode rewrite
- Previous by thread: Re: [PATCH -mm] kprobes: kprobe-booster for ia64
- Next by thread: [PATCH -mm] kprobes: fix prepare_booster to get correct slot
- Index(es):
Relevant Pages
|