[Patch 6/6] PPC64-HWBKPT: Adapt kexec and samples code to recognise PPC64 hw-breakpoint
From: K.Prasad <hidden>
Date: 2009-09-03 18:41:21
Modify kexec code to disable DABR registers before a reboot. Adapt the samples code to populate PPC64-arch specific fields. Signed-off-by: K.Prasad <redacted> --- arch/powerpc/kernel/machine_kexec_64.c | 3 +++ samples/hw_breakpoint/data_breakpoint.c | 4 ++++ 2 files changed, 7 insertions(+) Index: linux-2.6-tip.ppc64_hbkpt/arch/powerpc/kernel/machine_kexec_64.c ===================================================================
--- linux-2.6-tip.ppc64_hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c
+++ linux-2.6-tip.ppc64_hbkpt/arch/powerpc/kernel/machine_kexec_64.c@@ -24,6 +24,7 @@ #include <asm/sections.h> /* _end */ #include <asm/prom.h> #include <asm/smp.h> +#include <asm/hw_breakpoint.h> int default_machine_kexec_prepare(struct kimage *image) {
@@ -214,6 +215,7 @@ static void kexec_prepare_cpus(void) put_cpu(); local_irq_disable(); + hw_breakpoint_disable(); } #else /* ! SMP */
@@ -233,6 +235,7 @@ static void kexec_prepare_cpus(void) if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down(0, 0); local_irq_disable(); + hw_breakpoint_disable(); } #endif /* SMP */
Index: linux-2.6-tip.ppc64_hbkpt/samples/hw_breakpoint/data_breakpoint.c ===================================================================
--- linux-2.6-tip.ppc64_hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c
+++ linux-2.6-tip.ppc64_hbkpt/samples/hw_breakpoint/data_breakpoint.c@@ -54,6 +54,10 @@ static int __init hw_break_module_init(v sample_hbp.info.type = HW_BREAKPOINT_WRITE; sample_hbp.info.len = HW_BREAKPOINT_LEN_4; #endif /* CONFIG_X86 */ +#ifdef CONFIG_PPC64 + sample_hbp.info.name = ksym_name; + sample_hbp.info.type = HW_BREAKPOINT_WRITE; +#endif /* CONFIG_PPC64 */ sample_hbp.triggered = (void *)sample_hbp_handler;