This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC][Patch 2/2][take2]kprobe: kprobe-booster against 2.6.14-mm1 for i386
- From: Masami Hiramatsu <hiramatu at sdl dot hitachi dot co dot jp>
- To: systemtap at sources dot redhat dot com
- Cc: Masami Hiramatsu <hiramatu at sdl dot hitachi dot co dot jp>, Yumiko Sugita <sugita at sdl dot hitachi dot co dot jp>, Satoshi Oshima <soshima at redhat dot com>, Hideo Aoki <haoki at redhat dot com>, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, ananth at in dot ibm dot com
- Date: Tue, 06 Dec 2005 14:27:23 +0900
- Subject: Re: [RFC][Patch 2/2][take2]kprobe: kprobe-booster against 2.6.14-mm1 for i386
- References: <43870DDB.8020306@sdl.hitachi.co.jp> <438B142B.5080407@sdl.hitachi.co.jp> <438B148F.9000004@sdl.hitachi.co.jp> <438B14E1.3010301@sdl.hitachi.co.jp>
Hi,
I forgot to enable preemption in previous booster patch.
With this fix, the booster can work safely on the preemptible
kernel.
For safety, the booster is enabled only if the pre-handler
of kprobe is called from where the preemption is prohibited.
Masami Hiramatsu wrote:
> @@ -235,6 +283,14 @@ static int __kprobes kprobe_handler(stru
> /* handler has already set things up, so skip ss setup */
> return 1;
>
> + if (p->ainsn.boostable == 1 &&
#ifdef CONFIG_PREEMPT
preempt_count() != 1 &&
#endif
> + !p->post_handler && !p->break_handler ) {
> + /* Boost up -- we can execute copied instructions directly */
> + reset_current_kprobe();
> + regs->eip = (unsigned long)&p->ainsn.insn;
preempt_enable_no_resched();
> + return 1;
> + }
> +
> ss_probe:
> prepare_singlestep(p, regs);
> kcb->kprobe_status = KPROBE_HIT_SS;
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp