]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86,kgdb: Fix DEBUG_RODATA limitation using text_poke()
authorJason Wessel <jason.wessel@windriver.com>
Fri, 23 Mar 2012 14:35:05 +0000 (09:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 15:33:48 +0000 (08:33 -0700)
commitfdf8d98d89726f435f4d7f89fc898340c2f47bc9
treeaa35623a48796d23ba8861abeb28283aa57cff94
parent706e51dedb8c4d05cf9f4feb1cfecc3d5618f2bf
x86,kgdb: Fix DEBUG_RODATA limitation using text_poke()

commit 3751d3e85cf693e10e2c47c03c8caa65e171099b upstream.

There has long been a limitation using software breakpoints with a
kernel compiled with CONFIG_DEBUG_RODATA going back to 2.6.26. For
this particular patch, it will apply cleanly and has been tested all
the way back to 2.6.36.

The kprobes code uses the text_poke() function which accommodates
writing a breakpoint into a read-only page.  The x86 kgdb code can
solve the problem similarly by overriding the default breakpoint
set/remove routines and using text_poke() directly.

The x86 kgdb code will first attempt to use the traditional
probe_kernel_write(), and next try using a the text_poke() function.
The break point install method is tracked such that the correct break
point removal routine will get called later on.

Cc: x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Inspried-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/kgdb.c
drivers/misc/kgdbts.c
include/linux/kgdb.h