LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
ia64 <linux-ia64@vger.kernel.org>,
"Luck, Tony" <tony.luck@intel.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Jim Keniston <jkenisto@us.ibm.com>,
systemtap-ml <systemtap@sources.redhat.com>
Subject: Re: [PATCH -mm] kprobes: kprobe-booster for ia64
Date: Mon, 10 Mar 2008 11:43:20 +0800 [thread overview]
Message-ID: <1205120600.20271.3.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <47D166E7.2050803@redhat.com>
On Sat, 2008-03-08 at 00:01 +0800, Masami Hiramatsu wrote:
> From: Masami Hiramatsu <mhiramat@redhat.com>
>
> +
> +/*
> + * In this function, we check whether the target bundle modifies IP
> or
> + * it triggers an exception. If so, it cannot be boostable.
> + */
> +static int __kprobes can_boost(bundle_t *bundle, uint slot,
> + unsigned long bundle_addr)
> +{
> + unsigned int template = bundle->quad0.template;
> +
> + do {
> + if (search_exception_tables(bundle_addr + slot) ||
> + __is_ia64_break_inst(bundle, slot))
> + return 0; /* exception may occur in this
> bundle*/
> + } while ((++slot) < 3);
> + template &= 0x1e;
> + if (template >= 0x10 /* including B unit */ ||
> + template == 0x04 /* including X unit */ ||
> + template == 0x06) /* undefined */
> + return 0;
> +
> + return 1;
> +}
> +
> +/* 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;
slot = (unsigned long)p->addr & 0xf ?
> + struct kprobe *other_kp;
> +
> + 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;
> + }
> +}
> +
There is no lock to protect the flag. If one cpu invokes other_kp and
the other cpu is changing the flag, what's the result?
Thanks,
Shaohua
next prev parent reply other threads:[~2008-03-10 3:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 16:01 Masami Hiramatsu
2008-03-10 3:43 ` Shaohua Li [this message]
2008-03-10 18:25 ` Masami Hiramatsu
2008-03-11 0:06 ` [PATCH -mm] kprobes: fix prepare_booster to get correct slot Masami Hiramatsu
2008-03-11 1:20 ` [PATCH -mm] kprobes: kprobe-booster for ia64 Shaohua Li
2008-03-11 18:17 ` Masami Hiramatsu
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=1205120600.20271.3.camel@sli10-desk.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=jkenisto@us.ibm.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=systemtap@sources.redhat.com \
--cc=tony.luck@intel.com \
--subject='Re: [PATCH -mm] kprobes: kprobe-booster for ia64' \
/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
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).