[Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- 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.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include 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.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.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; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- 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.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include 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.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.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; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- 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.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include 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.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.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; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- 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.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include 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.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.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; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- 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.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include 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.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.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; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
On Thu, 14 May 2009, K.Prasad wrote: > Index: linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c > === > --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c > 2009-05-14 00:17:24.0 +0530 > +++ linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c > 2009-05-14 00:58:06.0 +0530 > @@ -54,6 +54,10 @@ > 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 = DABR_DATA_WRITE; This should be HW_BREAKPOINT_WRITE, not DABR_DATA_WRITE. Alan Stern ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
On Thu, 2009-05-14 at 16:18 +0200, Geert Uytterhoeven wrote: > On Fri, 15 May 2009, Michael Ellerman wrote: > > On Thu, 2009-05-14 at 15:59 +0200, Geert Uytterhoeven wrote: > > > On Thu, 14 May 2009, K.Prasad wrote: > > > > 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 > > > > --- > > > > arch/powerpc/kernel/machine_kexec_64.c |6 > > > > samples/hw_breakpoint/data_breakpoint.c |4 > > > > > > > > Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > > > === > > > > --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c > > > > 2009-05-14 00:17:24.0 +0530 > > > > +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > > > 2009-05-14 09:48:09.0 +0530 > > > > @@ -24,6 +24,7 @@ > > > > #include /* _end */ > > > > #include > > > > #include > > > > +#include > > > > > > > > int default_machine_kexec_prepare(struct kimage *image) > > > > { > > > > @@ -214,6 +215,9 @@ > > > > put_cpu(); > > > > > > > > local_irq_disable(); > > > > +#ifdef CONFIG_PPC64 > > >^^^ > > > > + hw_breakpoint_disable(); > > > > +#endif > > >^^ > > > > > > What about providing a dummy definition of hw_breakpoint_disable() > > > in if !CONFIG_PPC64? > > > > That would be good. > > > > What would be better, is to notice that machine_kexec_64.c is only ever > > built for 64-bit - hence the name. And so no ifdefs or anything else is > > required. > > Right ;-) > > But that can't be said for other files, like e.g. > arch/powerpc/kernel/ptrace.c. Yeah you're right, the rest of this series could use lots of #ifdefs in headers love. cheers signature.asc Description: This is a digitally signed message part ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
On Fri, 15 May 2009, Michael Ellerman wrote: > On Thu, 2009-05-14 at 15:59 +0200, Geert Uytterhoeven wrote: > > On Thu, 14 May 2009, K.Prasad wrote: > > > 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 > > > --- > > > arch/powerpc/kernel/machine_kexec_64.c |6 > > > samples/hw_breakpoint/data_breakpoint.c |4 > > > > > > Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > > === > > > --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c > > > 2009-05-14 00:17:24.0 +0530 > > > +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > > 2009-05-14 09:48:09.0 +0530 > > > @@ -24,6 +24,7 @@ > > > #include /* _end */ > > > #include > > > #include > > > +#include > > > > > > int default_machine_kexec_prepare(struct kimage *image) > > > { > > > @@ -214,6 +215,9 @@ > > > put_cpu(); > > > > > > local_irq_disable(); > > > +#ifdef CONFIG_PPC64 > >^^^ > > > + hw_breakpoint_disable(); > > > +#endif > >^^ > > > > What about providing a dummy definition of hw_breakpoint_disable() > > in if !CONFIG_PPC64? > > That would be good. > > What would be better, is to notice that machine_kexec_64.c is only ever > built for 64-bit - hence the name. And so no ifdefs or anything else is > required. Right ;-) But that can't be said for other files, like e.g. arch/powerpc/kernel/ptrace.c. With kind regards, Geert Uytterhoeven Software Architect Techsoft Centre Technology and Software Centre Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: geert.uytterhoe...@sonycom.com Internet: http://www.sony-europe.com/ A division of Sony Europe (Belgium) N.V. VAT BE 0413.825.160 · RPR Brussels Fortis · BIC GEBABEBB · IBAN BE41293037680010 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
On Thu, 2009-05-14 at 15:59 +0200, Geert Uytterhoeven wrote: > On Thu, 14 May 2009, K.Prasad wrote: > > 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 > > --- > > arch/powerpc/kernel/machine_kexec_64.c |6 > > samples/hw_breakpoint/data_breakpoint.c |4 > > > > Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > === > > --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c > > 2009-05-14 00:17:24.0 +0530 > > +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > > 2009-05-14 09:48:09.0 +0530 > > @@ -24,6 +24,7 @@ > > #include /* _end */ > > #include > > #include > > +#include > > > > int default_machine_kexec_prepare(struct kimage *image) > > { > > @@ -214,6 +215,9 @@ > > put_cpu(); > > > > local_irq_disable(); > > +#ifdef CONFIG_PPC64 >^^^ > > + hw_breakpoint_disable(); > > +#endif >^^ > > What about providing a dummy definition of hw_breakpoint_disable() > in if !CONFIG_PPC64? That would be good. What would be better, is to notice that machine_kexec_64.c is only ever built for 64-bit - hence the name. And so no ifdefs or anything else is required. cheers signature.asc Description: This is a digitally signed message part ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
On Thu, 14 May 2009, K.Prasad wrote: > 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 > --- > arch/powerpc/kernel/machine_kexec_64.c |6 > samples/hw_breakpoint/data_breakpoint.c |4 > > Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > === > --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c > 2009-05-14 00:17:24.0 +0530 > +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c > 2009-05-14 09:48:09.0 +0530 > @@ -24,6 +24,7 @@ > #include /* _end */ > #include > #include > +#include > > int default_machine_kexec_prepare(struct kimage *image) > { > @@ -214,6 +215,9 @@ > put_cpu(); > > local_irq_disable(); > +#ifdef CONFIG_PPC64 ^^^ > + hw_breakpoint_disable(); > +#endif ^^ What about providing a dummy definition of hw_breakpoint_disable() in if !CONFIG_PPC64? and if you make it safe to always include , you can get rid of the #ifdef in e.g. --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/ptrace.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c @@ -37,6 +37,9 @@ #include #include #include +#ifdef CONFIG_PPC64 +#include +#endif With kind regards, Geert Uytterhoeven Software Architect Techsoft Centre Technology and Software Centre Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: geert.uytterhoe...@sonycom.com Internet: http://www.sony-europe.com/ A division of Sony Europe (Belgium) N.V. VAT BE 0413.825.160 · RPR Brussels Fortis · BIC GEBABEBB · IBAN BE41293037680010 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[RFC Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage
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 --- arch/powerpc/kernel/machine_kexec_64.c |6 samples/hw_breakpoint/data_breakpoint.c |4 Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c === --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c 2009-05-14 00:17:24.0 +0530 +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c 2009-05-14 09:48:09.0 +0530 @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include int default_machine_kexec_prepare(struct kimage *image) { @@ -214,6 +215,9 @@ put_cpu(); local_irq_disable(); +#ifdef CONFIG_PPC64 + hw_breakpoint_disable(); +#endif } #else /* ! SMP */ @@ -233,6 +237,9 @@ if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down(0, 0); local_irq_disable(); +#ifdef CONFIG_PPC64 + hw_breakpoint_disable(); +#endif } #endif /* SMP */ Index: linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c === --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c 2009-05-14 00:17:24.0 +0530 +++ linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c 2009-05-14 00:58:06.0 +0530 @@ -54,6 +54,10 @@ 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 = DABR_DATA_WRITE; +#endif /* CONFIG_PPC64 */ sample_hbp.triggered = (void *)sample_hbp_handler; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev