From: Sachin Sant <sachinp@in.ibm.com>
To: ananth@in.ibm.com
Cc: Linux/PPC Development <linuxppc-dev@ozlabs.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
mhiramat@redhat.com
Subject: Re: [PowerPC] 2.6.33-git11 : Badness at kernel/kprobes.c:264
Date: Mon, 08 Mar 2010 18:33:16 +0530 [thread overview]
Message-ID: <4B94F594.7050205@in.ibm.com> (raw)
In-Reply-To: <20100308120009.GC14199@in.ibm.com>
Ananth N Mavinakayanahalli wrote:
>>> 2.6.33-git10(64ba99267...) was OK.
>>>
>>> This WARN_ON was introduced by commit 4610ee1d36...
>>>
>>> kprobes: Introduce generic insn_slot framework
>>>
>> FWIW, same on s390...
>>
>
> This patch should fix it:
>
> When freeing the instruction slot, the arithmetic to calculate the index
> of the slot in the page needs to account for the total size of the
> instruction on the various architectures.
>
> Calculate the index correctly when freeing the out-of-line execution slot.
>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
>
Thanks Ananth. Boots fine on my POWER6 box without any WAR_ON.
Regards
-Sachin
> ---
> Index: linux-8mar/kernel/kprobes.c
> ===================================================================
> --- linux-8mar.orig/kernel/kprobes.c 2010-03-08 17:10:33.000000000 +0530
> +++ linux-8mar/kernel/kprobes.c 2010-03-08 17:12:12.000000000 +0530
> @@ -259,7 +259,8 @@
> struct kprobe_insn_page *kip;
>
> list_for_each_entry(kip, &c->pages, list) {
> - long idx = ((long)slot - (long)kip->insns) / c->insn_size;
> + long idx = ((long)slot - (long)kip->insns) /
> + (c->insn_size * sizeof(kprobe_opcode_t));
> if (idx >= 0 && idx < slots_per_page(c)) {
> WARN_ON(kip->slot_used[idx] != SLOT_USED);
> if (dirty) {
>
>
>
>
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
WARNING: multiple messages have this Message-ID (diff)
From: Sachin Sant <sachinp@in.ibm.com>
To: ananth@in.ibm.com
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>,
Linux/PPC Development <linuxppc-dev@ozlabs.org>,
mhiramat@redhat.com, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PowerPC] 2.6.33-git11 : Badness at kernel/kprobes.c:264
Date: Mon, 08 Mar 2010 18:33:16 +0530 [thread overview]
Message-ID: <4B94F594.7050205@in.ibm.com> (raw)
In-Reply-To: <20100308120009.GC14199@in.ibm.com>
Ananth N Mavinakayanahalli wrote:
>>> 2.6.33-git10(64ba99267...) was OK.
>>>
>>> This WARN_ON was introduced by commit 4610ee1d36...
>>>
>>> kprobes: Introduce generic insn_slot framework
>>>
>> FWIW, same on s390...
>>
>
> This patch should fix it:
>
> When freeing the instruction slot, the arithmetic to calculate the index
> of the slot in the page needs to account for the total size of the
> instruction on the various architectures.
>
> Calculate the index correctly when freeing the out-of-line execution slot.
>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
>
Thanks Ananth. Boots fine on my POWER6 box without any WAR_ON.
Regards
-Sachin
> ---
> Index: linux-8mar/kernel/kprobes.c
> ===================================================================
> --- linux-8mar.orig/kernel/kprobes.c 2010-03-08 17:10:33.000000000 +0530
> +++ linux-8mar/kernel/kprobes.c 2010-03-08 17:12:12.000000000 +0530
> @@ -259,7 +259,8 @@
> struct kprobe_insn_page *kip;
>
> list_for_each_entry(kip, &c->pages, list) {
> - long idx = ((long)slot - (long)kip->insns) / c->insn_size;
> + long idx = ((long)slot - (long)kip->insns) /
> + (c->insn_size * sizeof(kprobe_opcode_t));
> if (idx >= 0 && idx < slots_per_page(c)) {
> WARN_ON(kip->slot_used[idx] != SLOT_USED);
> if (dirty) {
>
>
>
>
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
next prev parent reply other threads:[~2010-03-08 13:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 8:10 [PowerPC] 2.6.33-git11 : Badness at kernel/kprobes.c:264 Sachin Sant
2010-03-06 8:10 ` Sachin Sant
2010-03-08 10:11 ` Heiko Carstens
2010-03-08 10:11 ` Heiko Carstens
2010-03-08 12:00 ` Ananth N Mavinakayanahalli
2010-03-08 12:00 ` Ananth N Mavinakayanahalli
2010-03-08 13:03 ` Sachin Sant [this message]
2010-03-08 13:03 ` Sachin Sant
2010-03-08 14:03 ` Masami Hiramatsu
2010-03-08 14: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=4B94F594.7050205@in.ibm.com \
--to=sachinp@in.ibm.com \
--cc=ananth@in.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mhiramat@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 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.