Re: [PATCH v8 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-05-09 Thread Anju T Sudhakar
On CPU hotplug, dying CPU is checked to see whether it is one of the designated cpus, if yes, next online cpu from the same chip (for nest units) is designated as new cpu to read counters. For this purpose, we introduce a new state : CPUHP_AP_PERF_POWERPC_NEST_ONLINE. Signed-off-by: Anju T

[PATCH v9 00/10] IMC Instrumentation Support

2017-06-05 Thread Anju T Sudhakar
mc engine in cpuhot plug path v3 -> v4 : - Changed the events parser code to discover the PMU and events because of the changed format of the IMC DTS file (Patch 3). - Implemented the two TODOs to include core and thread IMC support with this patchset (Patches 7 through 10). - Changed t

[PATCH v9 01/10] powerpc/powernv: Data structure and macros definitions for IMC

2017-06-05 Thread Anju T Sudhakar
From: Madhavan Srinivasan Create a new header file to add the data structures and macros needed for In-Memory Collection (IMC) counter support. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 99

[PATCH v9 02/10] powerpc/powernv: Autoload IMC device driver module

2017-06-05 Thread Anju T Sudhakar
Code to create platform device for the IMC counters. Paltform devices are created based on the IMC compatibility string. New Config flag "CONFIG_HV_PERF_IMC_CTRS" add to contain the IMC counter changes. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by

[PATCH v9 03/10] powerpc/powernv: Detect supported IMC units and its events

2017-06-05 Thread Anju T Sudhakar
that all events supported by this PMU inherit the scale and unit properties of the PMU itself. For those events, we need to set the common unit and scale values. For failure to initialize any unit or any event, disable that unit and continue setting up the rest of them. Signed-off-by: Hemant Kuma

[PATCH v9 04/10] powerpc/perf: Add generic IMC pmu group and event functions

2017-06-05 Thread Anju T Sudhakar
ute and to register imc pmus. Add a event_init function for nest_imc events. Since, the IMC counters' data are periodically fed to a memory location, the functions to read/update, start/stop, add/del can be generic and can be used by all IMC PMU units. Signed-off-by: Anju T Sudhakar Signed-off-b

[PATCH v9 06/10] powerpc/powernv: Core IMC events detection

2017-06-05 Thread Anju T Sudhakar
with the help of the "type" property in the IMC device tree. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by

[PATCH v9 08/10] powerpc/powernv: Thread IMC events detection

2017-06-05 Thread Anju T Sudhakar
Code to add support for detection of thread IMC events. It adds a new domain IMC_DOMAIN_THREAD and it is determined with the help of the "type" property in the imc device-tree. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- ar

[PATCH v9 09/10] powerpc/perf: Thread IMC PMU functions

2017-06-05 Thread Anju T Sudhakar
ff-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h| 5 + arch/powerpc/perf/imc-pmu.c | 203 -- arch/powerpc/plat

[PATCH v9 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-06-05 Thread Anju T Sudhakar
. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 3 + arch/powerpc/include/asm/opal-api.h

[PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-05 Thread Anju T Sudhakar
kexec. Signed-off-by: Hemant Kumar Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/includ

[PATCH v9 10/10] powerpc/perf: Thread imc cpuhotplug support

2017-06-05 Thread Anju T Sudhakar
CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE is added to the list of existing states. Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 35 +-- include/linux/cpuhotplug.h | 1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v9 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-06-06 Thread Anju T Sudhakar
Hi Thomas, Thank you for reviewing the patch. On Tuesday 06 June 2017 02:09 PM, Thomas Gleixner wrote: On Mon, 5 Jun 2017, Anju T Sudhakar wrote: +/* + * nest_imc_stop : Does OPAL call to stop nest engine. + */ +static void nest_imc_stop(int *cpu_opal_rc) +{ + int rc; + + rc

Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-06 Thread Anju T Sudhakar
Hi Thomas, On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote: On Mon, 5 Jun 2017, Anju T Sudhakar wrote: +static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr) +{ + struct imc_mem_info *ptr = pmu_ptr->mem_info; + + if (!ptr) + return; Tha

Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-07 Thread Anju T Sudhakar
On Wednesday 07 June 2017 11:14 AM, Anju T Sudhakar wrote: Hi Thomas, On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote: On Mon, 5 Jun 2017, Anju T Sudhakar wrote: +static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr) +{ +struct imc_mem_info *ptr = pmu_ptr->mem_i

[PATCH v11 00/10] IMC Instrumentation Support

2017-06-28 Thread Anju T Sudhakar
to IMC (In-Memory Collection). v1 -> v2 : - Account for the cases where a PMU can have a common scale and unit values for all its supported events (Patch 3/6).

[PATCH v11 01/10] powerpc/powernv: Data structure and macros definitions for IMC

2017-06-28 Thread Anju T Sudhakar
From: Madhavan Srinivasan Create a new header file to add the data structures and macros needed for In-Memory Collection (IMC) counter support. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 99

[PATCH v11 02/10] powerpc/powernv: Autoload IMC device driver module

2017-06-28 Thread Anju T Sudhakar
Code to create platform device for the IMC counters. Paltform devices are created based on the IMC compatibility string. New Config flag "CONFIG_HV_PERF_IMC_CTRS" add to contain the IMC counter changes. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by

[PATCH v11 03/10] powerpc/powernv: Detect supported IMC units and its events

2017-06-28 Thread Anju T Sudhakar
that all events supported by this PMU inherit the scale and unit properties of the PMU itself. For those events, we need to set the common unit and scale values. For failure to initialize any unit or any event, disable that unit and continue setting up the rest of them. Signed-off-by: Hemant Kum

[PATCH v11 04/10] powerpc/perf: Add generic IMC pmu group and event functions

2017-06-28 Thread Anju T Sudhakar
ute and to register imc pmus. Add a event_init function for nest_imc events. Since, the IMC counters' data are periodically fed to a memory location, the functions to read/update, start/stop, add/del can be generic and can be used by all IMC PMU units. Signed-off-by: Anju T Sudhakar Signed-off-b

[PATCH v11 06/10] powerpc/powernv: Core IMC events detection

2017-06-28 Thread Anju T Sudhakar
From: Madhavan Srinivasan This patch adds support for detection of core IMC events along with the Nest IMC events. It adds a new domain IMC_DOMAIN_CORE and its determined with the help of the "type" property in the IMC device tree. Signed-off-by: Anju T Sudhakar Signed-off-by: He

[PATCH v11 08/10] powerpc/powernv: Thread IMC events detection

2017-06-28 Thread Anju T Sudhakar
Code to add support for detection of thread IMC events. It adds a new domain IMC_DOMAIN_THREAD and it is determined with the help of the "type" property in the imc device-tree. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- ar

[PATCH v11 10/10] powerpc/perf: Thread imc cpuhotplug support

2017-06-28 Thread Anju T Sudhakar
CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE is added to the list of existing states. Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 38 +- include/linux/cpuhotplug.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a

[PATCH v11 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-06-28 Thread Anju T Sudhakar
. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 1 + arch/powerpc/include/asm/opal-api.h

[PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-28 Thread Anju T Sudhakar
kexec. Signed-off-by: Hemant Kumar Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/includ

[PATCH v11 09/10] powerpc/perf: Thread IMC PMU functions

2017-06-28 Thread Anju T Sudhakar
ff-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h| 4 + arch/powerpc/perf/imc-pmu.c | 228 +- arch/po

[PATCH v12 00/10] IMC Instrumentation Support

2017-07-03 Thread Anju T Sudhakar
ation) to IMC (In-Memory Collection). v1 -> v2 : - Account for the cases where a PMU can have a common scale and unit values for all its supported events (Patch 3/6). - Fixed a Build error (for maple_defconfig) by enabling imc_pmu.o only for CONFIG_PPC_POWERNV=y (Patch 4/6) -

[PATCH v12 01/10] powerpc/powernv: Data structure and macros definitions for IMC

2017-07-03 Thread Anju T Sudhakar
From: Madhavan Srinivasan Create a new header file to add the data structures and macros needed for In-Memory Collection (IMC) counter support. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 99

[PATCH v12 02/10] powerpc/powernv: Autoload IMC device driver module

2017-07-03 Thread Anju T Sudhakar
Code to create platform device for the IMC counters. Paltform devices are created based on the IMC compatibility string. New Config flag "CONFIG_HV_PERF_IMC_CTRS" add to contain the IMC counter changes. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by

[PATCH v12 03/10] powerpc/powernv: Detect supported IMC units and its events

2017-07-03 Thread Anju T Sudhakar
that all events supported by this PMU inherit the scale and unit properties of the PMU itself. For those events, we need to set the common unit and scale values. For failure to initialize any unit or any event, disable that unit and continue setting up the rest of them. Signed-off-by: Hemant Kum

[PATCH v12 04/10] powerpc/perf: Add generic IMC pmu group and event functions

2017-07-03 Thread Anju T Sudhakar
ute and to register imc pmus. Add a event_init function for nest_imc events. Since, the IMC counters' data are periodically fed to a memory location, the functions to read/update, start/stop, add/del can be generic and can be used by all IMC PMU units. Signed-off-by: Anju T Sudhakar Signed-off-b

[PATCH v12 06/10] powerpc/powernv: Core IMC events detection

2017-07-03 Thread Anju T Sudhakar
From: Madhavan Srinivasan This patch adds support for detection of core IMC events along with the Nest IMC events. It adds a new domain IMC_DOMAIN_CORE and its determined with the help of the "type" property in the IMC device tree. Signed-off-by: Anju T Sudhakar Signed-off-by: He

[PATCH v12 08/10] powerpc/powernv: Thread IMC events detection

2017-07-03 Thread Anju T Sudhakar
Code to add support for detection of thread IMC events. It adds a new domain IMC_DOMAIN_THREAD and it is determined with the help of the "type" property in the imc device-tree. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- ar

[PATCH v12 09/10] powerpc/perf: Thread IMC PMU functions

2017-07-03 Thread Anju T Sudhakar
cpus. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h| 4 + arch/powerpc/perf/imc-pmu.c | 241 -- arch/powerpc/platforms/powernv/opal-imc.c | 2 + 3 files changed

[PATCH v12 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-07-03 Thread Anju T Sudhakar
. Signed-off-by: Anju T Sudhakar Signed-off-by: Hemant Kumar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/imc-pmu.h | 11 + arch/powerpc/include/asm/opal-api.h

[PATCH v12 10/10] powerpc/perf: Thread IMC PMU functions

2017-07-03 Thread Anju T Sudhakar
CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE is added to the list of existing states. Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 38 +- include/linux/cpuhotplug.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a

[PATCH v12 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-07-03 Thread Anju T Sudhakar
kexec. Signed-off-by: Hemant Kumar Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/includ

Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on cpuhotplug

2017-09-25 Thread Anju T Sudhakar
Hi mpe, On Thursday 21 September 2017 10:04 AM, Michael Ellerman wrote: Anju T Sudhakar writes: Nest/core pmu units are enabled only when it is used. A reference count is maintained for the events which uses the nest/core pmu units. Currently in *_imc_counters_release function a WARN() is

[PATCH] powerpc/perf: Fix for core/nest imc call trace on cpuhotplug

2017-10-03 Thread Anju T Sudhakar
the ref count will not hit a negative value. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 28 1 file changed, 28 insertions(+) diff --

Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on cpuhotplug

2017-10-05 Thread Anju T Sudhakar
Hi Santosh, On Thursday 05 October 2017 03:20 PM, Santosh Sivaraj wrote: * Anju T Sudhakar wrote (on 2017-10-04 06:50:52 +): Nest/core pmu units are enabled only when it is used. A reference count is maintained for the events which uses the nest/core pmu units. Currently in

[PATCH] powerpc/powernv: Add kernel cmdline parameter to disable imc

2017-10-08 Thread Anju T Sudhakar
Add a kernel command line parameter option to disable In-Memory Collection (IMC) counters and add documentation. This helps in debug. Signed-off-by: Anju T Sudhakar Reviewed-By: Madhavan Srinivasan --- Documentation/admin-guide/kernel-parameters.txt | 7 + arch/powerpc/platforms/powernv

Re: linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599: pointless test ?

2017-10-09 Thread Anju T Sudhakar
pu >= 0 && ncpu < nr_cpu_ids) { but unsigned int ncpu, core_id; Suggest remove test. Nice catch. Thanks for mentioning this. I will fix this. Thanks, Anju Thanks. Notifying the author would be more helpful: $ git blame -L 599,599 arch/powerpc/perf/imc-pmu.c 39a846db1d574 (Anju T

[PATCH] powerpc/perf: Fix IMC initialization crash

2017-10-10 Thread Anju T Sudhakar
imc_common_cpuhp_mem_free() to handle the failing case gracefully. Signed-off-by: Anju T Sudhakar Reported-by: Pridhiviraj Paidipeddi --- arch/powerpc/perf/imc-pmu.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch

Re: [PATCH] powerpc/powernv: Add kernel cmdline parameter to disable imc

2017-10-11 Thread Anju T Sudhakar
Hi mpe, stewart, On Wednesday 11 October 2017 01:55 AM, Stewart Smith wrote: Michael Ellerman writes: Anju T Sudhakar writes: Add a kernel command line parameter option to disable In-Memory Collection (IMC) counters and add documentation. This helps in debug. I'd really rather we d

[PATCH] powerpc/perf: Add ___GFP_NOWARN flag to alloc_pages_node()

2017-10-11 Thread Anju T Sudhakar
memory from a node which has no memory behind it. Add a ___GFP_NOWARN flag in allocation request as a fix. Signed-off-by: Anju T Sudhakar Reported-by: Michael Ellerman Reported-by: Venkat R.B --- arch/powerpc/perf/imc-pmu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH V2] powerpc/perf: Fix IMC initialization crash

2017-10-12 Thread Anju T Sudhakar
prior to dereferencing the attribute element, to handle the failing case gracefully. Signed-off-by: Anju T Sudhakar Reported-by: Pridhiviraj Paidipeddi --- arch/powerpc/perf/imc-pmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc

Re: [PATCH] powerpc/perf: Fix IMC allocation routine

2017-10-24 Thread Anju T Sudhakar
division up, fixing the bug. Signed-off-by: Guilherme G. Piccoli Acked-by:  Anju T Sudhakar --- Anju, looks good to you? Tested in P9 with latest FW available. arch/powerpc/perf/imc-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b

[PATCH] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-10-27 Thread Anju T Sudhakar
Add ldbar spr to sysfs. The spr will hold thread level In-Memory Collection (IMC) counter configuration data. Signed-off-by: Anju T Sudhakar Acked-by: Madhavan Srinivasan --- arch/powerpc/kernel/sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b

[PATCH] powerpc/perf: Fix core-imc hotplug callback failure during imc initialization

2017-10-31 Thread Anju T Sudhakar
: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 8812624..08139f9 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -30,6 +30,7 @@ static

[PATCH] powerpc/perf: Change the data type for the variable 'ncpu' in IMC code

2017-10-31 Thread Anju T Sudhakar
Change the data type for the variable 'ncpu' in ppc_core_imc_cpu_offline(), since cpumask_any_but() returns an 'int' value. Signed-off-by: Anju T Sudhakar Reported-by: David Binderman --- arch/powerpc/perf/imc-pmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[PATCH] powerpc/perf: Clean up IMC code with some code refactoring

2017-10-31 Thread Anju T Sudhakar
Factor out memory freeing part for attribute elements from imc_common_mem_free(), also handle the memory leak for pmu->events in update_events_in_group(). Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 24 1 file changed, 16 insertions(+)

[PATCH v2] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-10-31 Thread Anju T Sudhakar
Add ldbar spr to sysfs. The spr will hold thread level In-Memory Collection (IMC) counter configuration data. Signed-off-by: Anju T Sudhakar --- arch/powerpc/kernel/sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c

Re: [PATCH] powerpc/perf: Fix core-imc hotplug callback failure during imc initialization

2017-11-02 Thread Anju T Sudhakar
Hi, On Wednesday 01 November 2017 06:22 AM, Michael Ellerman wrote: Anju T Sudhakar writes: Call trace observed during boot: What's the actual oops? The actual oops is: [0.750749] PCI: CLS 0 bytes, default 128 [0.750855] Unpacking initramfs... [1.570445] Freeing i

[PATCH v2] powerpc/perf: Fix core-imc hotplug callback failure during imc initialization

2017-11-02 Thread Anju T Sudhakar
re-imc counters are not even initialized. Thus creating the above stack dump. Add a check to see if core-imc counters are enabled or not in the cpuhotplug offline path before migrating the context to handle this failing scenario. Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar ---

Re: [PATCH v2] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-11-07 Thread Anju T Sudhakar
Hi mpe, On Wednesday 01 November 2017 06:20 AM, Michael Ellerman wrote: Anju T Sudhakar writes: Add ldbar spr to sysfs. The spr will hold thread level In-Memory Collection (IMC) counter configuration data. This is missing any justification for why we would want to expose this, and in

[PATCH] powerpc/powernv: Fix IMC_MAX_PMU macro

2017-11-09 Thread Anju T Sudhakar
, microcode could support more nest units (max of 64 nest units). Hence fix the value for the macro. Fixes:8f95faaac56c1 ('powerpc/powernv: Detect and create IMC device') Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc-pmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-11-09 Thread Anju T Sudhakar
or not. And bit 1 indicates the mode (if 0-Accumulation Mode/if 1-Trace Mode). Signed-off-by: Anju T Sudhakar --- arch/powerpc/kernel/sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 4437c70..f8caee0 100644 --- a

Re: [PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-11-09 Thread Anju T Sudhakar
Hi, Kindly ignore this patch, I send a wrong version. Will send out the right one. Thanks, Anju On Thursday 09 November 2017 05:43 PM, Anju T Sudhakar wrote: Add ldbar spr to sysfs. The spr holds thread level In-Memory Collection (IMC) counter configuration data. Exposing this will help

[PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2017-11-09 Thread Anju T Sudhakar
or not. And bit 1 indicates the mode (if 0-Accumulation Mode/if 1-Trace Mode). Signed-off-by: Anju T Sudhakar --- arch/powerpc/kernel/sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 4437c70..caefb64 100644 --- a

[PATCH] powerpc/perf: Add debugfs interface for imc run-mode and run-status

2017-11-12 Thread Anju T Sudhakar
root@:/sys/kernel/debug/imc# ls imc_cmd_0 imc_cmd_8 imc_mode_0 imc_mode_8 Signed-off-by: Anju T Sudhakar --- arch/powerpc/

Re: [PATCH] powerpc/perf: Add debugfs interface for imc run-mode and run-status

2017-11-12 Thread Anju T Sudhakar
Hi, Kindly ignore this version Thanks, Anju On Monday 13 November 2017 11:06 AM, Anju T Sudhakar wrote: In memory Collection (IMC) counter pmu driver controls the ucode's execution state. At the system boot, IMC perf driver pause the ucode. Ucode state is changed to "running"

[PATCH] powerpc/perf: Add debugfs interface for imc-mode and imc-command

2017-11-12 Thread Anju T Sudhakar
root@:/sys/kernel/debug/imc# ls imc_cmd_0 imc_cmd_8 imc_mode_0 imc_mode_8 Signed-off-by: Anju T Sudhakar --- arch/powerpc/

[PATCH] powerpc/perf: Fix nest-imc cpuhotplug callback failure

2017-12-04 Thread Anju T Sudhakar
. https://patchwork.ozlabs.org/patch/844047/ (v2) Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a

[PATCH] powerpc/perf: Fix kfree memory allocated for nest pmus

2017-12-07 Thread Anju T Sudhakar
registered. Fixes: 73ce9aec65b1 ("powerpc/perf: Fix IMC_MAX_PMU macro") Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 0ead3cd..4eb9e2b 10

[PATCH 0/3] IMC code clean up and refactoring

2017-12-10 Thread Anju T Sudhakar
The first patch removes the unused variable in the code for IMC(In-memory collection counters). The second patch does some code refactoring. The third patch in the series make struct imc_events as a parameter to the function imc_parse_event(). Anju T Sudhakar (3): powerpc/perf: Remove

[PATCH 1/3] powerpc/perf: Remove thread_imc_pmu global variable from

2017-12-10 Thread Anju T Sudhakar
Remove the global variable 'thread_imc_pmu', since it is not used in the code. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 4eb9e2b..ef7f9dd 100644

[PATCH 3/3] powerpc/perf: Passs struct imc_events as a parameter to imc_parse_event()

2017-12-10 Thread Anju T Sudhakar
less memory") Suggested-by: Michael Ellerman Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc-pmu.h | 2 +- arch/powerpc/perf/imc-pmu.c| 66 +++--- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/include/asm/im

[PATCH 2/3] powerpc/perf: IMC code cleanup with some code refactoring

2017-12-10 Thread Anju T Sudhakar
Factor out memory freeing part for attribute elements from imc_common_cpuhp_mem_free(). Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc

[PATCH v2] platform/powernv: Add debugfs interface for imc-mode and imc-command

2017-12-12 Thread Anju T Sudhakar
ied in the ima-catalog, that is used to export the imc mode/command, otherwise IMC_CNTL_BLK_OFFSET is used. Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc-pmu.h| 7 +++ arch/powerpc/platforms/powernv/opal-imc.c | 77 +

[PATCH V2 0/4] OPTPROBES for powerpc

2016-12-14 Thread Anju T Sudhakar
in V1 into a single patch. - Comments by Masami are addressed. - Some helper functions are implemented in separate patches. - Optimization for kprobe placed on the kretprobe_trampoline during boot time is implemented. Kindly let me know your suggestions and comments. Thanks, -Anju Anju T Su

[PATCH V2 3/4] arch/powerpc: Implement Optprobes

2016-12-14 Thread Anju T Sudhakar
buffer allocated and the instruction being probed is within ?? 32MB. Signed-off-by: Anju T Sudhakar Signed-off-by: Naveen N. Rao --- .../features/debug/optprobes/arch-support.txt | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/kprobes.h

[PATCH V2 4/4] arch/powerpc: Optimize kprobe in kretprobe_trampoline

2016-12-14 Thread Anju T Sudhakar
Kprobe placed on the kretprobe_trampoline during boot time can be optimized, since the instruction at probe point is a 'nop'. Signed-off-by: Anju T Sudhakar --- arch/powerpc/kernel/kprobes.c | 8 arch/powerpc/kernel/optprobes.c | 7 +++ 2 files changed, 11 insert

[PATCH V2 1/4] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64()

2016-12-14 Thread Anju T Sudhakar
From: "Naveen N. Rao" Introduce __PPC_SH64() as a 64-bit variant to encode shift field in some of the shift and rotate instructions operating on double-words. Convert some of the BPF instruction macros to use the same. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 1

[PATCH V2 2/4] powerpc: add helper to check if offset is within rel branch range

2016-12-14 Thread Anju T Sudhakar
From: "Naveen N. Rao" Signed-off-by: Naveen N. Rao Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/lib/code-patching.c | 24 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/power

Re: [PATCH V2 2/4] powerpc: add helper to check if offset is within rel branch range

2016-12-16 Thread Anju T Sudhakar
Hi Masami, Thank you for reviewing the patch set. On Friday 16 December 2016 05:22 PM, Masami Hiramatsu wrote: On Wed, 14 Dec 2016 21:48:30 +0530 Anju T Sudhakar wrote: From: "Naveen N. Rao" The coding is OK to me. Please add a description for this patch here, e.g. what is do

Re: [PATCH V2 3/4] arch/powerpc: Implement Optprobes

2016-12-16 Thread Anju T Sudhakar
Hi Masami, On Friday 16 December 2016 07:32 PM, Masami Hiramatsu wrote: On Wed, 14 Dec 2016 21:48:27 +0530 Anju T Sudhakar wrote: Detour buffer contains instructions to create an in memory pt_regs. After the execution of the pre-handler, a call is made for instruction emulation. The NIP

Re: [PATCH V2 0/4] OPTPROBES for powerpc

2016-12-16 Thread Anju T Sudhakar
Hi Balbir, On Friday 16 December 2016 08:16 PM, Balbir Singh wrote: On 15/12/16 03:18, Anju T Sudhakar wrote: This is the V2 patchset of the kprobes jump optimization (a.k.a OPTPROBES)for powerpc. Kprobe being an inevitable tool for kernel developers, enhancing the performance of kprobe has

[PATCH V3 0/4] OPTPROBES for powerpc

2016-12-19 Thread Anju T Sudhakar
ressed. - Description in the cover letter is modified a bit. Kindly let me know your suggestions and comments. Thanks, -Anju Anju T Sudhakar (2): arch/powerpc: Implement Optprobes arch/powerpc: Optimize kprobe in kretprobe_trampoline Naveen N. Rao (2): powerpc: asm/ppc-opcode.h: introduce __PP

[PATCH V3 3/4] arch/powerpc: Implement Optprobes

2016-12-19 Thread Anju T Sudhakar
buffer allocated and the instruction being probed is within ?? 32MB. Signed-off-by: Anju T Sudhakar Signed-off-by: Naveen N. Rao --- .../features/debug/optprobes/arch-support.txt | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/kprobes.h

[PATCH V3 4/4] arch/powerpc: Optimize kprobe in kretprobe_trampoline

2016-12-19 Thread Anju T Sudhakar
Kprobe placed on the kretprobe_trampoline during boot time can be optimized, since the instruction at probe point is a 'nop'. Signed-off-by: Anju T Sudhakar Acked-by: Masami Hiramatsu --- arch/powerpc/kernel/kprobes.c | 8 arch/powerpc/kernel/optprobes.c | 7 +++---

[PATCH V3 1/4] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64()

2016-12-19 Thread Anju T Sudhakar
From: "Naveen N. Rao" Introduce __PPC_SH64() as a 64-bit variant to encode shift field in some of the shift and rotate instructions operating on double-words. Convert some of the BPF instruction macros to use the same. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 1

[PATCH V3 2/4] powerpc: add helper to check if offset is within rel branch range

2016-12-19 Thread Anju T Sudhakar
he current instruction. This patch verifies whether the target address is within +/- 32MB range or not. Signed-off-by: Naveen N. Rao Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/lib/code-patching.c | 24 +++- 2 files c

Re: [PATCH V3 3/4] arch/powerpc: Implement Optprobes

2017-02-07 Thread Anju T Sudhakar
Hi Michael, Thank you so much for the review. On Wednesday 01 February 2017 04:23 PM, Michael Ellerman wrote: Anju T Sudhakar writes: Detour buffer contains instructions to create an in memory pt_regs. After the execution of the pre-handler, a call is made for instruction emulation. The

[PATCH 2/3] powerpc: add helper to check if offset is within rel branch range

2017-02-08 Thread Anju T Sudhakar
verifies whether the target address is within +/- 32MB range or not. Signed-off-by: Naveen N. Rao Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/lib/code-patching.c | 24 +++- 2 files changed, 24 insertions(+), 1

[PATCH 1/3] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64()

2017-02-08 Thread Anju T Sudhakar
From: "Naveen N. Rao" Introduce __PPC_SH64() as a 64-bit variant to encode shift field in some of the shift and rotate instructions operating on double-words. Convert some of the BPF instruction macros to use the same. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 1

[PATCH 3/3] powerpc: kprobes: fixes for kprobe_lookup_name on BE

2017-02-08 Thread Anju T Sudhakar
From: "Naveen N. Rao" Fix two issues with kprobes.h on BE which were exposed with the optprobes work: - one, having to do with a missing include for linux/module.h for MODULE_NAME_LEN -- this didn't show up previously since the only users of kprobe_lookup_name were in kprobes.c, which included li

[PATCH v4 1/2] arch/powerpc: Implement Optprobes

2017-02-08 Thread Anju T Sudhakar
the address range between the detour buffer allocated and the instruction being probed is within +/- 32MB. Signed-off-by: Anju T Sudhakar Signed-off-by: Naveen N. Rao Acked-by: Masami Hiramatsu --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/code-patching.h | 1

[PATCH v4 0/2] OPTPROBES for powerpc

2017-02-08 Thread Anju T Sudhakar
suggestions and comments. Thanks, -Anju Anju T Sudhakar (2): arch/powerpc: Implement Optprobes arch/powerpc: Optimize kprobe in kretprobe_trampoline arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/include/asm/kprobes.h

[PATCH v4 2/2] arch/powerpc: Optimize kprobe in kretprobe_trampoline

2017-02-08 Thread Anju T Sudhakar
Kprobe placed on the kretprobe_trampoline during boot time can be optimized, since the instruction at probe point is a 'nop'. Signed-off-by: Anju T Sudhakar Acked-by: Masami Hiramatsu --- arch/powerpc/kernel/kprobes.c | 8 arch/powerpc/kernel/optprobes.c | 7 +++---

Re: [v4,1/2] arch/powerpc: Implement Optprobes

2017-02-14 Thread Anju T Sudhakar
this purpose. Instructions which can be emulated using analyse_instr() are the candidates for optimization. Before optimization ensure that the address range between the detour buffer allocated and the instruction being probed is within +/- 32MB. Signed-off-by: Anju T Sudhakar Signed-off-by: Naveen

Re: [bug report] powerpc/perf: Add nest IMC PMU support

2018-02-07 Thread Anju T Sudhakar
Hi Dan Carpenter, On Wednesday 31 January 2018 08:55 PM, Dan Carpenter wrote: Hello Anju T Sudhakar, The patch 885dcd709ba9: "powerpc/perf: Add nest IMC PMU support" from Jul 19, 2017, leads to the following static checker warning: arch/powerpc/perf/imc-pmu.c:1393 in

Re: [PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2018-03-12 Thread Anju T Sudhakar
Hi, On Tuesday 06 March 2018 04:35 PM, Michael Ellerman wrote: Anju T Sudhakar writes: diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 4437c70..caefb64 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -757,6 +759,9 @@ static int

[PATCH 0/4] powerpc/perf: IMC Cleanups

2018-04-09 Thread Anju T Sudhakar
exec works The first three patches in this series addresses the comments by Dan Carpenter. Anju T Sudhakar (4): powerpc/perf: Rearrange memory freeing in imc init

[PATCH 1/4] powerpc/perf: Rearrange memory freeing in imc init

2018-04-09 Thread Anju T Sudhakar
avoid such access. Also free the memory which is dynamically allocated during imc initialization, wherever required. Signed-off-by: Anju T Sudhakar --- test matrix and static checker run details are updated in the cover letter patch is based on https://git.kernel.org/pub/scm/linux/kernel/git

[PATCH 2/4] powerpc/perf: Replace the direct return with goto statement

2018-04-09 Thread Anju T Sudhakar
Replace the direct return statement in imc_mem_init() with goto, to adhere to the kernel coding style. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch

[PATCH 4/4] powerpc/perf: Unregister thread-imc if core-imc not supported

2018-04-09 Thread Anju T Sudhakar
Enable thread-imc in the kernel, only if core-imc is registered. Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc-pmu.h| 1 + arch/powerpc/perf/imc-pmu.c | 12 arch/powerpc/platforms/powernv/opal-imc.c | 9 + 3 files changed, 22

[PATCH 3/4] powerpc/perf: Return appropriate value for unknown domain

2018-04-09 Thread Anju T Sudhakar
Return proper error code for unknown domain during IMC initialization. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 1b285cd..4b4ca83 100644 --- a

[PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-11 Thread Anju T Sudhakar
able, will fix this issue. Reported-by: Pridhiviraj Paidipeddi Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index d7532e7..75fb23c 100644 --- a/arch/pow

Re: [PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-14 Thread Anju T Sudhakar
Hi, On Saturday 12 May 2018 06:05 AM, Balbir Singh wrote: On Fri, May 11, 2018 at 11:43 PM, Anju T Sudhakar wrote: Currently memory is allocated for core-imc based on cpu_present_mask, which has bit 'cpu' set iff cpu is populated. We use (cpu number / threads per core) as as arra

Re: [PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-14 Thread Anju T Sudhakar
On Friday 11 May 2018 07:13 PM, Anju T Sudhakar wrote: Currently memory is allocated for core-imc based on cpu_present_mask, which has bit 'cpu' set iff cpu is populated. We use (cpu number / threads per core) as as array index to access the memory. So in a system with guarded co

<    1   2   3   >