From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: Paul Mackerras <paulus@samba.org>
Cc: akpm@osdl.org, anton@samba.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PPC64 Fix kprobes calling smp_processor_id when preemptible
Date: Thu, 17 Mar 2005 12:47:16 +0530 [thread overview]
Message-ID: <20050317071716.GA7386@in.ibm.com> (raw)
In-Reply-To: <16949.6337.715642.803244@cargo.ozlabs.ibm.com>
On Mon, Mar 14, 2005 at 03:53:21PM +1100, Paul Mackerras wrote:
Hi Paul,
> When booting with kprobes and preemption both enabled and
> CONFIG_DEBUG_PREEMPT=y, I get lots of warnings about smp_processor_id
> being called in preemptible code, from kprobe_exceptions_notify. On
> ppc64, interrupts and preemption are not disabled in the handlers for
> most synchronous exceptions such as breakpoints and page faults
> (interrupts are disabled in the very early exception entry code but
> are reenabled before calling the C handler).
>
> This patch adds a preempt_disable/enable pair to
> kprobe_exceptions_notify, and moves the preempt_disable() in
> kprobe_handler() to be done only in the case where we are about to
> single-step an instruction. This eliminates the bug warnings.
The patch is fine, but it seems to break jprobes - we have an unbalanced
preempt_enable/disable path while handling jprobes. Patch below is
against 2.6.11-mm4 and fixes the issue.
Thanks,
Ananth
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
diff -Naurp temp/linux-2.6.11/arch/ppc64/kernel/kprobes.c kprobes/linux-2.6.11/arch/ppc64/kernel/kprobes.c
--- temp/linux-2.6.11/arch/ppc64/kernel/kprobes.c 2005-03-17 05:15:53.000000000 +0530
+++ kprobes/linux-2.6.11/arch/ppc64/kernel/kprobes.c 2005-03-17 19:46:21.000000000 +0530
@@ -262,7 +262,6 @@ int setjmp_pre_handler(struct kprobe *p,
void jprobe_return(void)
{
- preempt_enable_no_resched();
asm volatile("trap" ::: "memory");
}
prev parent reply other threads:[~2005-03-17 17:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-14 4:53 [PATCH] PPC64 Fix kprobes calling smp_processor_id when preemptible Paul Mackerras
2005-03-17 7:17 ` Ananth N Mavinakayanahalli [this message]
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=20050317071716.GA7386@in.ibm.com \
--to=ananth@in.ibm.com \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox