All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maneesh Soni <manesoni@cisco.com>
To: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: ralf@linux-mips.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org, david.daney@cavium.com,
	kamensky@cisco.com
Subject: Re: [PATCH] MIPS Kprobes: Support branch instructions probing
Date: Thu, 13 Oct 2011 15:42:18 +0530	[thread overview]
Message-ID: <20111013101217.GD16761@cisco.com> (raw)
In-Reply-To: <20111013094137.GA19054@in.ibm.com>

On Thu, Oct 13, 2011 at 03:11:38PM +0530, Ananth N Mavinakayanahalli wrote:
> On Thu, Oct 13, 2011 at 02:37:49PM +0530, Maneesh Soni wrote:
> 
> ...
> 
> I know nothing of MIPS internals, but...
>  
> >  static int __kprobes kprobe_handler(struct pt_regs *regs)
> > @@ -239,8 +531,13 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
> >  			save_previous_kprobe(kcb);
> >  			set_current_kprobe(p, regs, kcb);
> >  			kprobes_inc_nmissed_count(p);
> > -			prepare_singlestep(p, regs);
> > +			prepare_singlestep(p, regs, kcb);
> >  			kcb->kprobe_status = KPROBE_REENTER;
> > +			if (kcb->flags & SKIP_DELAYSLOT) {
> > +				resume_execution(p, regs, kcb);
> > +				restore_previous_kprobe(kcb);
> > +				preempt_enable_no_resched();
> > +			}
> >  			return 1;
> >  		} else {
> >  			if (addr->word != breakpoint_insn.word) {
> > @@ -284,8 +581,15 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
> >  	}
> > 
> >  ss_probe:
> > -	prepare_singlestep(p, regs);
> > -	kcb->kprobe_status = KPROBE_HIT_SS;
> > +	prepare_singlestep(p, regs, kcb);
> > +	if (kcb->flags & SKIP_DELAYSLOT) {
> > +		kcb->kprobe_status = KPROBE_HIT_SSDONE;
> > +		if (p->post_handler)
> > +			p->post_handler(p, regs, 0);
> > +		resume_execution(p, regs, kcb);
> 
> You are missing a preempt_disable_no_resched() here.
> 
ok.. you meant preempt_enable_no_resched(). Will add it in the next
version. Thanks for pointing it out.

Thanks
Maneesh

  parent reply	other threads:[~2011-10-13 10:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13  9:07 [PATCH] MIPS Kprobes: Support branch instructions probing Maneesh Soni
2011-10-13  9:41 ` Ananth N Mavinakayanahalli
2011-10-13 10:12   ` Ananth N Mavinakayanahalli
2011-10-13 10:12   ` Maneesh Soni [this message]
2011-10-13 17:28 ` David Daney
2011-10-13 18:07   ` Ralf Baechle
2011-10-13 19:16     ` Victor Kamensky
2011-10-13 22:59       ` Ralf Baechle
2011-10-14 17:31     ` Maneesh Soni
2011-10-14 17:28   ` Maneesh Soni

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=20111013101217.GD16761@cisco.com \
    --to=manesoni@cisco.com \
    --cc=ananth@in.ibm.com \
    --cc=david.daney@cavium.com \
    --cc=kamensky@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.