aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2012-03-23 09:35:05 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-13 08:14:07 -0700
commite5acefebad4863015271b91f865c62def9bfed82 (patch)
tree7fb6fad7729f00e6cde27d4b249bd2e7627f51af /drivers/misc
parenta492297156b336c3fde50ca35e40eb9ddde95478 (diff)
downloadkernel_samsung_smdk4412-e5acefebad4863015271b91f865c62def9bfed82.zip
kernel_samsung_smdk4412-e5acefebad4863015271b91f865c62def9bfed82.tar.gz
kernel_samsung_smdk4412-e5acefebad4863015271b91f865c62def9bfed82.tar.bz2
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/kgdbts.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index 0046138..cdefef2 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -967,22 +967,6 @@ static void run_singlestep_break_test(void)
kgdbts_break_test();
}
-static void test_debug_rodata(void)
-{
-#ifdef CONFIG_DEBUG_RODATA
- /* Until there is an api to write to read-only text segments, use
- * HW breakpoints for the remainder of any tests, else print a
- * failure message if hw breakpoints do not work.
- */
- if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
- eprintk("kgdbts: HW breakpoints BROKEN, ending tests\n");
- return;
- }
- force_hwbrks = 1;
- v1printk("kgdbts:Using HW breakpoints for SW breakpoint tests\n");
-#endif /* CONFIG_DEBUG_RODATA */
-}
-
static void kgdbts_run_tests(void)
{
char *ptr;
@@ -1015,7 +999,6 @@ static void kgdbts_run_tests(void)
v1printk("kgdbts:RUN access write breakpoint test\n");
run_hw_break_test(0);
}
- test_debug_rodata();
/* required internal KGDB tests */
v1printk("kgdbts:RUN plant and detach test\n");