Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables

2016-02-11 Thread Murali Sampath


  Original Message
From: Balbir Singh
Sent: Thursday, February 11, 2016 4:37 AM
To: Kamalesh Babulal
Cc: Petr Mladek; Jessica Yu; linux-kernel@vger.kernel.org; Steven Rostedt; 
Torsten Duwe; Jiri Kosina; live-patch...@vger.kernel.org; Miroslav Benes; 
linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables


On Thu, 2016-02-11 at 14:09 +0530, Kamalesh Babulal wrote:
> * Balbir Singh  [2016-02-11 18:48:17]:
>
> > On Wed, 2016-02-10 at 17:25 +0100, Torsten Duwe wrote:
> >
> > snip
> >
> > > diff --git a/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > b/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > new file mode 100755
> > > index 000..68d6482
> > > --- /dev/null
> > > +++ b/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > @@ -0,0 +1,33 @@
> > > +#!/bin/sh
> > > +# Test whether the compile option -mprofile-kernel
> > > +# generates profiling code ( = a call to mcount), and
> > > +# whether a function without any global references sets
> > > +# the TOC pointer properly at the beginning, and
> > > +# whether the "notrace" function attribute successfully
> > > +# suppresses the _mcount call.
> > > +
> > > +echo "int func() { return 0; }" | \
> > > +$* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
> > > +grep -q "mcount"
> > > +
> > > +trace_result=$?
> > > +
> > > +echo "int func() { return 0; }" | \
> > > +$* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
> > > +sed -n -e '/func:/,/bl _mcount/p' | grep -q TOC
> > > +
> > > +leaf_toc_result=$?
> > > +
> >
> > leaf_toc_result failed for me with gcc 5. I'll try and grab gcc-6
> > and give the patches a spin
> >
>
> It fails for me to on ppc64le but pass over ppc64
>

This series is for ppc64le only, so we can safely ignore ppc64 for now

Regards,
Balbir Singh.
___
Linuxppc-dev mailing list
linuxppc-...@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables

2016-02-11 Thread Murali Sampath
‎ t

  Original Message
From: Balbir Singh
Sent: Thursday, February 11, 2016 4:37 AM
To: Kamalesh Babulal
Cc: Petr Mladek; Jessica Yu; linux-kernel@vger.kernel.org; Steven Rostedt; 
Torsten Duwe; Jiri Kosina; live-patch...@vger.kernel.org; Miroslav Benes; 
linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables


On Thu, 2016-02-11 at 14:09 +0530, Kamalesh Babulal wrote:
> * Balbir Singh  [2016-02-11 18:48:17]:
>
> > On Wed, 2016-02-10 at 17:25 +0100, Torsten Duwe wrote:
> >
> > snip
> >
> > > diff --git a/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > b/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > new file mode 100755
> > > index 000..68d6482
> > > --- /dev/null
> > > +++ b/arch/powerpc/gcc-mprofile-kernel-notrace.sh
> > > @@ -0,0 +1,33 @@
> > > +#!/bin/sh
> > > +# Test whether the compile option -mprofile-kernel
> > > +# generates profiling code ( = a call to mcount), and
> > > +# whether a function without any global references sets
> > > +# the TOC pointer properly at the beginning, and
> > > +# whether the "notrace" function attribute successfully
> > > +# suppresses the _mcount call.
> > > +
> > > +echo "int func() { return 0; }" | \
> > > +$* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
> > > +grep -q "mcount"
> > > +
> > > +trace_result=$?
> > > +
> > > +echo "int func() { return 0; }" | \
> > > +$* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
> > > +sed -n -e '/func:/,/bl _mcount/p' | grep -q TOC
> > > +
> > > +leaf_toc_result=$?
> > > +
> >
> > leaf_toc_result failed for me with gcc 5. I'll try and grab gcc-6
> > and give the patches a spin
> >
>
> It fails for me to on ppc64le but pass over ppc64
>

This series is for ppc64le only, so we can safely ignore ppc64 for now

Regards,
Balbir Singh.
___
Linuxppc-dev mailing list
linuxppc-...@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 1/1] powerpc/86xx: Consolidate common platform code

2016-02-11 Thread Murali Sampath


  Original Message
From: Denis Kirjanov
Sent: Thursday, February 11, 2016 4:22 AM
To: Alessio Igor Bogani
Cc: Scott Wood; linuxppc-...@lists.ozlabs.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] powerpc/86xx: Consolidate common platform code


On 2/11/16, Alessio Igor Bogani  wrote:
> Signed-off-by: Alessio Igor Bogani 
> ---
> v1 -> v2
>   Use appropriate [PATCH] prefix
>
>  arch/powerpc/platforms/86xx/Makefile   |  2 +-
>  arch/powerpc/platforms/86xx/common.c   | 42
> ++
>  arch/powerpc/platforms/86xx/gef_ppc9a.c| 32 +--
>  arch/powerpc/platforms/86xx/gef_sbc310.c   | 32 +--
>  arch/powerpc/platforms/86xx/gef_sbc610.c   | 32 +--
>  arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 20 ++
>  arch/powerpc/platforms/86xx/mpc86xx.h  |  2 ++
>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 21 +--
>  arch/powerpc/platforms/86xx/sbc8641d.c | 32 +--
>  9 files changed, 52 insertions(+), 163 deletions(-)
>  create mode 100644 arch/powerpc/platforms/86xx/common.c
>
> diff --git a/arch/powerpc/platforms/86xx/Makefile
> b/arch/powerpc/platforms/86xx/Makefile
> index ede815d..2d889ad 100644
> --- a/arch/powerpc/platforms/86xx/Makefile
> +++ b/arch/powerpc/platforms/86xx/Makefile
> @@ -2,7 +2,7 @@
>  # Makefile for the PowerPC 86xx linux kernel.
>  #
>
> -obj-y:= pic.o
> +obj-y:= pic.o common.o
>  obj-$(CONFIG_SMP)+= mpc86xx_smp.o
>  obj-$(CONFIG_MPC8641_HPCN)   += mpc86xx_hpcn.o
>  obj-$(CONFIG_SBC8641D)   += sbc8641d.o
> diff --git a/arch/powerpc/platforms/86xx/common.c
> b/arch/powerpc/platforms/86xx/common.c
> new file mode 100644
> index 000..bee3177
> --- /dev/null
> +++ b/arch/powerpc/platforms/86xx/common.c
> @@ -0,0 +1,42 @@
> +/*
> + * Routines common to most mpc86xx-based boards.
> + *
> + * This is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include 
> +
> +#include "mpc86xx.h"
> +
> +static const struct of_device_id mpc86xx_common_ids[] __initconst = {
> + { .type = "soc", },
> + { .compatible = "soc", },
> + { .compatible = "simple-bus", },
> + { .name = "localbus", },
> + { .compatible = "gianfar", },
> + { .compatible = "fsl,mpc8641-pcie", },
> + {},
> +};
> +
> +int __init mpc86xx_common_publish_devices(void)
> +{
> + return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
> +}
> +
> +long __init mpc86xx_time_init(void)
> +{
> + unsigned int temp;
> +
> + /* Set the time base to zero */
> + mtspr(SPRN_TBWL, 0);
> + mtspr(SPRN_TBWU, 0);
> +
> + temp = mfspr(SPRN_HID0);
> + temp |= HID0_TBEN;
> + mtspr(SPRN_HID0, temp);
> + asm volatile("isync");
While we're here you could just use isync()

> +
> + return 0;
> +}
> diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c
> b/arch/powerpc/platforms/86xx/gef_ppc9a.c
> index bf17933..8e63b75 100644
> --- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
> +++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
> @@ -197,37 +197,7 @@ static int __init gef_ppc9a_probe(void)
>   return 0;
>  }
>
> -static long __init mpc86xx_time_init(void)
> -{
> - unsigned int temp;
> -
> - /* Set the time base to zero */
> - mtspr(SPRN_TBWL, 0);
> - mtspr(SPRN_TBWU, 0);
> -
> - temp = mfspr(SPRN_HID0);
> - temp |= HID0_TBEN;
> - mtspr(SPRN_HID0, temp);
> - asm volatile("isync");
> -
> - return 0;
> -}
> -
> -static const struct of_device_id of_bus_ids[] __initconst = {
> - { .compatible = "simple-bus", },
> - { .compatible = "gianfar", },
> - { .compatible = "fsl,mpc8641-pcie", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - printk(KERN_DEBUG "Probe platform devices\n");
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_arch_initcall(gef_ppc9a, declare_of_platform_devices);
> +machine_arch_initcall(gef_ppc9a, mpc86xx_common_publish_devices);
>
>  define_machine(gef_ppc9a) {
>   .name   = "GE PPC9A",
> diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c
> b/arch/powerpc/platforms/86xx/gef_sbc310.c
> index 8facf58..0e0be94 100644
> --- a/arch/powerpc/platforms/86xx/gef_sbc310.c
> +++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
> @@ -184,37 +184,7 @@ static int __init gef_sbc310_probe(void)
>   return 0;
>  }
>
> -static long __init mpc86xx_time_init(void)
> -{
> - unsigned int temp;
> -
> - /* Set the time base to zero */
> - mtspr(SPRN_TBWL, 0);
> - mtspr(SPRN_TBWU, 0);
> -
> - temp = mfspr(SPRN_HID0);
> - temp |= HID0_TBEN;
> - mtspr(SPRN_HID0, temp);
> - asm volatile("isync");
> -
> - return 0;
> -}
> -
> -static const struct of