linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Jim Keniston <jkenisto@us.ibm.com>, Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>,
	prasanna@in.ibm.com, anil.s.keshavamurthy@intel.com,
	davem@davemloft.net, Harvey Harrison <harvey.harrison@gmail.com>,
	systemtap-ml <systemtap@sources.redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH 1/2] x86: fix kprobe_handler reenable preemption
Date: Tue, 18 Dec 2007 22:32:28 -0500	[thread overview]
Message-ID: <476890CC.1020100@redhat.com> (raw)
In-Reply-To: <4768555A.3000604@redhat.com>

Hi

Masami Hiramatsu wrote:
> Fix a preemption bug in kprobe_handler(). It has to call preempt_enable()
> before returning.
> I think this is critical on preemptive kernel.

Sorry, this patch has a mistake.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> ---
>  arch/x86/kernel/kprobes.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Index: b/arch/x86/kernel/kprobes.c
> ===================================================================
> --- a/arch/x86/kernel/kprobes.c	2007-12-18 12:51:00.000000000 -0500
> +++ b/arch/x86/kernel/kprobes.c	2007-12-18 12:53:38.000000000 -0500
> @@ -467,7 +467,8 @@
>  				arch_disarm_kprobe(p);
>  				regs->ip = (unsigned long)p->addr;
>  				reset_current_kprobe();
> -				return 1;
> +				ret = 1;
> +				goto no_kprobe;
>  #endif
>  			}
>  			/* We have reentered the kprobe_handler(), since
> @@ -481,7 +482,7 @@
>  			kprobes_inc_nmissed_count(p);
>  			prepare_singlestep(p, regs);
>  			kcb->kprobe_status = KPROBE_REENTER;
> -			return 1;
> +			ret = 1;

Here, "return 1;" is correct. After single step is done, preemption is enabled
in post_kprobe_handler().

>  		} else {
>  			if (*addr != BREAKPOINT_INSTRUCTION) {
>  			/* The breakpoint instruction was removed by
> 

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com


  reply	other threads:[~2007-12-19  3:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 23:18 [PATCH 1/2] x86: fix kprobe_handler reenable preemption Masami Hiramatsu
2007-12-19  3:32 ` Masami Hiramatsu [this message]
2007-12-19 10:20   ` Ingo Molnar
2007-12-19 16:03     ` 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=476890CC.1020100@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=harvey.harrison@gmail.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=prasanna@in.ibm.com \
    --cc=roland@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).