From: "S. P. Prasanna" <prasanna@in.ibm.com>
To: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Chuck Ebbert <cebbert@redhat.com>,
Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
linux-kernel@vger.kernel.org, ananth@in.ibm.com,
mathieu.desnoyers@polymtl.ca
Subject: Re: [patch 1/2] kprobes i386 quick fix mark-ro-data
Date: Tue, 19 Jun 2007 15:36:44 +0530 [thread overview]
Message-ID: <20070619100644.GA5478@in.ibm.com> (raw)
In-Reply-To: <200706182132.56559.ak@suse.de>
On Mon, Jun 18, 2007 at 09:32:56PM +0200, Andi Kleen wrote:
> On Monday 18 June 2007 20:56:32 Andrew Morton wrote:
> > On Mon, 18 Jun 2007 14:44:57 -0400
> > Chuck Ebbert <cebbert@redhat.com> wrote:
> >
> > > > I fancy it's done by the kprobe_page_fault handler, but I do not see
> > > > clearly how writing the breakpoint from arch_arm_kprobe() in
> > > > non-writeable memory is done.
> > >
> > > Looks like it's not merged yet:
> > >
> > > http://lkml.org/lkml/2007/6/7/2
> > >
> > > This needs to go in before 2.6.22-final
> >
> > Andi, I'll include the below two patches in the next batch, OK?
>
> It won't work reliably unless some of the c_p_a() fixes get in first.
>
> >
> >
> >
> > +extern int kernel_text_is_ro;
>
> No externs in .c files
Yes.
>
>
> I also don't like kernel_text_is_read_only() much, it would
> be better to just lookup_address() it and check the write flag.
Yes, I will look into this approach.
>
> But for 2.6.22 as a quick fix it might be better to just
> make KPROBES dependent on !DEBUG_RODATA. That would be a one liner.
>
Please find the quick fix as per your suggestion below.
Thanks
Prasanna
This patch is a quick fix to enable kprobes only if DEBUG_RODATA is
not configured. Since DEBUG_RODATA markes the kernel text pages as read-only.
Signed-off-by: Prasanna S P. <prasanna@in.ibm.com>
arch/i386/Kconfig | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff -puN arch/i386/Kconfig~kprobes-quick-fix-mark-ro-data-i386 arch/i386/Kconfig
--- linux-2.6.22-rc5/arch/i386/Kconfig~kprobes-quick-fix-mark-ro-data-i386 2007-06-19 14:55:31.000000000 +0530
+++ linux-2.6.22-rc5-prasanna/arch/i386/Kconfig 2007-06-19 14:55:31.000000000 +0530
@@ -1212,6 +1212,8 @@ source "drivers/Kconfig"
source "fs/Kconfig"
+source "arch/i386/Kconfig.debug"
+
menu "Instrumentation Support"
depends on EXPERIMENTAL
@@ -1219,7 +1221,7 @@ source "arch/i386/oprofile/Kconfig"
config KPROBES
bool "Kprobes (EXPERIMENTAL)"
- depends on KALLSYMS && EXPERIMENTAL && MODULES
+ depends on KALLSYMS && EXPERIMENTAL && MODULES && !DEBUG_RODATA
help
Kprobes allows you to trap at almost any kernel address and
execute a callback function. register_kprobe() establishes
@@ -1228,8 +1230,6 @@ config KPROBES
If in doubt, say "N".
endmenu
-source "arch/i386/Kconfig.debug"
-
source "security/Kconfig"
source "crypto/Kconfig"
_
--
Prasanna S.P.
Linux Technology Center
India Software Labs, IBM Bangalore
Email: prasanna@in.ibm.com
Ph: 91-80-41776329
next prev parent reply other threads:[~2007-06-19 10:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-15 20:23 [patch 0/8] Immediate values for fast branches Mathieu Desnoyers
2007-06-15 20:23 ` [patch 1/8] Immediate Value - Architecture Independent Code Mathieu Desnoyers
2007-06-15 20:23 ` [patch 2/8] Immediate Values - Non Optimized Architectures Mathieu Desnoyers
2007-06-15 20:23 ` [patch 3/8] Immediate Value - Add kconfig menus Mathieu Desnoyers
2007-06-15 20:23 ` [patch 4/8] Immediate Value - i386 Optimization Mathieu Desnoyers
2007-06-15 22:02 ` Chuck Ebbert
2007-06-17 17:50 ` Mathieu Desnoyers
2007-06-18 14:57 ` [patch 4/8] Immediate Value - i386 Optimization; kprobes Mathieu Desnoyers
2007-06-18 18:44 ` Chuck Ebbert
2007-06-18 18:56 ` Andrew Morton
2007-06-18 19:27 ` Mathieu Desnoyers
2007-06-18 19:32 ` Andi Kleen
2007-06-18 20:16 ` Chuck Ebbert
2007-06-19 10:06 ` S. P. Prasanna [this message]
2007-06-19 10:08 ` [patch 2/2] kprobes x86_64 quick fix mark-ro-data S. P. Prasanna
2007-06-19 13:21 ` Arjan van de Ven
2007-06-19 13:30 ` Mathieu Desnoyers
2007-06-19 13:44 ` Arjan van de Ven
2007-06-19 14:31 ` S. P. Prasanna
2007-06-19 16:47 ` [patch 1/2] kprobes i386 " Andi Kleen
2007-06-15 20:23 ` [patch 5/8] Immediate Value - PowerPC Optimization Mathieu Desnoyers
2007-06-15 20:23 ` [patch 6/8] Immediate Value - Documentation Mathieu Desnoyers
2007-06-15 20:23 ` [patch 7/8] F00F bug fixup for i386 - use immediate values Mathieu Desnoyers
2007-06-15 20:23 ` [patch 8/8] Scheduler profiling - Use " Mathieu Desnoyers
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=20070619100644.GA5478@in.ibm.com \
--to=prasanna@in.ibm.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=cebbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
/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