Re: [RFC PATCH v2] coresight: etm4x: Modify core-commit of cpu to avoid the overflow of HiSilicon ETM

2020-11-12 Thread Suzuki K Poulose
K Poulose wrote: On 08/27/2020 09:44 PM, Mathieu Poirier wrote: Hi Liu, On Wed, Aug 19, 2020 at 04:06:37PM +0800, Qi Liu wrote: When too much trace information is generated on-chip, the ETM will overflow, and cause data loss. This is a common phenomenon on ETM devices. But sometimes we do not

Re: [RFC 02/11] coresight: etm-perf: Allow an event to use different sinks

2020-11-12 Thread Suzuki K Poulose
On 11/12/20 10:37 AM, Linu Cherian wrote: Hi Suzuki, On Thu, Nov 12, 2020 at 2:51 PM Suzuki K Poulose wrote: Hi Linu, Please could you test this slightly modified version and give us a Tested-by tag if you are happy with the results ? Suzuki On 11/10/20 12:45 PM, Anshuman Khandual wrote

Re: [RFC 07/11] coresight: sink: Add TRBE driver

2020-11-12 Thread Suzuki K Poulose
On 11/10/20 12:45 PM, Anshuman Khandual wrote: Trace Buffer Extension (TRBE) implements a trace buffer per CPU which is accessible via the system registers. The TRBE supports different addressing modes including CPU virtual address and buffer modes including the circular buffer mode. The TRBE buf

Re: [RFC 10/11] coresgith: etm-perf: Connect TRBE sink with ETE source

2020-11-12 Thread Suzuki K Poulose
Hi Anshuman, On 11/10/20 12:45 PM, Anshuman Khandual wrote: Unlike traditional sink devices, individual TRBE instances are not detected via DT or ACPI nodes. Instead TRBE instances are detected during CPU online process. Hence a path connecting ETE and TRBE on a given CPU would not have been esta

Re: [RFC 09/11] coresight: etm-perf: Disable the path before capturing the trace data

2020-11-12 Thread Suzuki K Poulose
On 11/10/20 12:45 PM, Anshuman Khandual wrote: perf handle structure needs to be shared with the TRBE IRQ handler for capturing trace data and restarting the handle. There is a probability of an undefined reference based crash when etm event is being stopped while a TRBE IRQ also getting processe

Re: [RFC 02/11] coresight: etm-perf: Allow an event to use different sinks

2020-11-12 Thread Suzuki K Poulose
Hi Linu, Please could you test this slightly modified version and give us a Tested-by tag if you are happy with the results ? Suzuki On 11/10/20 12:45 PM, Anshuman Khandual wrote: From: Suzuki K Poulose When there are multiple sinks on the system, in the absence of a specified sink, it is

Re: [PATCH v3 18/26] coresight: etm4x: Clean up exception level masks

2020-11-10 Thread Suzuki K Poulose
On 11/6/20 6:52 PM, Mathieu Poirier wrote: Good morning, On Wed, Oct 28, 2020 at 10:09:37PM +, Suzuki K Poulose wrote: etm4_get_access_type() calculates the exception level bits for use in address comparator registers. This is also used by the TRCVICTLR register by shifting to the required

Re: [PATCH v3 26/26] dts: bindings: coresight: ETM system register access only units

2020-11-10 Thread Suzuki K Poulose
On 11/9/20 8:50 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:45PM +, Suzuki K Poulose wrote: Document the bindings for ETMs with system register accesses. Cc: devicet...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Cc: Rob Herring Signed-off-by: Suzuki K Poulose

Re: [PATCH v3 25/26] coresight: etm4x: Add support for sysreg only devices

2020-11-10 Thread Suzuki K Poulose
On 11/9/20 8:46 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:44PM +, Suzuki K Poulose wrote: Add support for devices with system instruction access only. They don't have a memory mapped interface and thus are not AMBA devices. Cc: Mathieu Poirier Cc: Mike Leach Signed-o

Re: [PATCH v3 19/26] coresight: etm4x: Detect access early on the target CPU

2020-11-10 Thread Suzuki K Poulose
On 11/6/20 8:46 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:38PM +, Suzuki K Poulose wrote: In preparation to detect the support for system instruction support, move the detection of the device access to the target CPU. Signed-off-by: Suzuki K Poulose --- .../coresight

Re: [PATCH v3 22/26] coresight: etm4x: Add necessary synchronization for sysreg access

2020-11-10 Thread Suzuki K Poulose
On 11/9/20 6:32 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:41PM +, Suzuki K Poulose wrote: As per the specification any update to the TRCPRGCTLR must be synchronized by a context synchronization event (in our case an explicist ISB) before the TRCSTATR is checked. Cc: Mike

Re: [PATCH v3 23/26] coresight: etm4x: Detect system instructions support

2020-11-10 Thread Suzuki K Poulose
On 11/9/20 8:22 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:42PM +, Suzuki K Poulose wrote: ETM v4.4 onwards adds support for system instruction access to the ETM. Detect the support on an ETM and switch to using the mode when available. Signed-off-by: Suzuki K Poulose

Re: [PATCH v3 07/26] coresight: Introduce device access abstraction

2020-11-10 Thread Suzuki K Poulose
On 11/9/20 9:00 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:26PM +, Suzuki K Poulose wrote: We are about to introduce support for sysreg access to ETMv4.4+ component. Since there are generic routines that access the registers (e.g, CS_LOCK/UNLOCK , claim/disclaim operations

Re: [PATCH v3 20/26] coresight: etm4x: Handle ETM architecture version

2020-11-09 Thread Suzuki K Poulose
On 11/6/20 9:11 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:39PM +, Suzuki K Poulose wrote: We are about to rely on TRCDEVARCH for detecting the ETM and its architecture version, falling back to TRCIDR1 if the former is not implemented (in older broken implementations). Also

Re: [PATCH v3 19/26] coresight: etm4x: Detect access early on the target CPU

2020-11-09 Thread Suzuki K Poulose
On 11/6/20 8:34 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:38PM +, Suzuki K Poulose wrote: In preparation to detect the support for system instruction support, move the detection of the device access to the target CPU. Signed-off-by: Suzuki K Poulose --- .../coresight

Re: [PATCH v3 18/26] coresight: etm4x: Clean up exception level masks

2020-11-09 Thread Suzuki K Poulose
On 11/6/20 6:52 PM, Mathieu Poirier wrote: Good morning, Good morning. On Wed, Oct 28, 2020 at 10:09:37PM +, Suzuki K Poulose wrote: etm4_get_access_type() calculates the exception level bits for use in address comparator registers. This is also used by the TRCVICTLR register by

Re: [PATCH v3 17/26] coresight: etm4x: Cleanup secure exception level masks

2020-11-09 Thread Suzuki K Poulose
On 11/5/20 9:55 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:36PM +, Suzuki K Poulose wrote: We rely on the ETM architecture version to decide whether Secure EL2 is available on the CPU for excluding the level for address comparators and viewinst main control register. We must

Re: [PATCH v3 14/26] coresight: etm4x: Add sysreg access helpers

2020-11-05 Thread Suzuki K Poulose
Hi Mathieu, On 11/5/20 8:52 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:33PM +, Suzuki K Poulose wrote: ETMv4.4 architecture defines the system instructions for accessing ETM via register accesses. Add basic support for accessing a given register via system instructions. Cc

Re: [PATCH v3 10/26] coresight: Convert claim/disclaim operations to use access wrappers

2020-11-04 Thread Suzuki K Poulose
On 11/3/20 6:36 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:29PM +, Suzuki K Poulose wrote: Convert the generic CLAIM tag management APIs to use the device access layer abstraction. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing

Re: [PATCH v3 09/26] coresight: Convert coresight_timeout to use access abstraction

2020-11-04 Thread Suzuki K Poulose
On 11/3/20 6:03 PM, Mathieu Poirier wrote: On Wed, Oct 28, 2020 at 10:09:28PM +, Suzuki K Poulose wrote: Convert the generic routines to use the new access abstraction layer gradually, starting with coresigth_timeout. Cc: Mike Leach Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K

Re: [PATCH v3 07/26] coresight: Introduce device access abstraction

2020-11-04 Thread Suzuki K Poulose
On 11/3/20 5:25 PM, Mathieu Poirier wrote: On Tue, Nov 03, 2020 at 10:14:17AM -0700, Mathieu Poirier wrote: Hi Suzuki, On Wed, Oct 28, 2020 at 10:09:26PM +, Suzuki K Poulose wrote: We are about to introduce support for sysreg access to ETMv4.4+ component. Since there are generic routines

Re: [PATCH v3 06/26] coresight: etm4x: Handle access to TRCSSPCICRn

2020-11-02 Thread Suzuki K Poulose
On 11/2/20 9:46 PM, Mathieu Poirier wrote: Hi Suzuki, On Wed, Oct 28, 2020 at 10:09:25PM +, Suzuki K Poulose wrote: TRCSSPCICR is present only if all of the following are true: TRCIDR4.NUMSSCC > n. TRCIDR4.NUMPC > 0b . TRCSSCSR.PC == 0b1 Signed-off-by: Su

Re: [PATCH v2 31/39] docs: ABI: cleanup several ABI documents

2020-10-30 Thread Suzuki K Poulose
s-bus-coresight-devices-etb10 | 5 +- For the above, Acked-by: Suzuki K Poulose

Re: [PATCH v3 00/26] coresight: Support for ETM system instructions

2020-10-29 Thread Suzuki K Poulose
On 10/29/20 7:53 AM, Mike Leach wrote: Hi Suzuki, On Wed, 28 Oct 2020 at 22:10, Suzuki K Poulose wrote: CoreSight ETMv4.4 obsoletes memory mapped access to ETM and mandates the system instructions for registers. This also implies that they may not be on the amba bus. Right now all the

Re: [PATCH v3 14/26] coresight: etm4x: Add sysreg access helpers

2020-10-29 Thread Suzuki K Poulose
Joe, Andy Need your input on the checkpatch failures on this patch. Please see below. On 10/28/20 10:09 PM, Suzuki K Poulose wrote: ETMv4.4 architecture defines the system instructions for accessing ETM via register accesses. Add basic support for accessing a given register via system

[PATCH v3 05/26] coresight: etm4x: Handle TRCVIPCSSCTLR accesses

2020-10-28 Thread Suzuki K Poulose
TRCVIPCSSCTLR is not present if the TRCIDR4.NUMPC > 0. Thus we should only access the register if it is present, preventing any undesired behavior. Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 +++ 1 file changed, 7 insertions(+)

[PATCH v3 04/26] coresight: etm4x: Fix accesses to TRCPROCSELR

2020-10-28 Thread Suzuki K Poulose
TRCPROCSELR is not implemented if the TRCIDR3.NUMPROC == 0. Skip accessing the register in such cases. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions

[PATCH v3 00/26] coresight: Support for ETM system instructions

2020-10-28 Thread Suzuki K Poulose
r claim/disclaim and CS_LOCK/UNLOCK conversions. - Move device access initialisation for etm4x to the target CPU - Cleanup secure exception level mask handling. - Switch to use TRCDEVARCH for ETM component discovery. This is for making - Check the availability of OS/Software Locks before

[PATCH v3 01/26] coresight: etm4x: Fix accesses to TRCVMIDCTLR1

2020-10-28 Thread Suzuki K Poulose
TRCVMIDCTRL1 is only implemented only if the TRCIDR4.NUMVMIDC > 4. We must not touch the register otherwise. Cc: sta...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 ++--- 1 file changed

[PATCH v3 02/26] coresight: etm4x: Fix accesses to TRCCIDCTLR1

2020-10-28 Thread Suzuki K Poulose
The TRCCIDCTLR1 is only implemented if TRCIDR4.NUMCIDC > 4. Don't touch the register if it is not implemented. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 ++--- 1 file changed, 6 insertions(+), 3 d

[PATCH v3 12/26] coresight: etm4x: Convert all register accesses

2020-10-28 Thread Suzuki K Poulose
Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 326 +- .../coresight/coresight-etm4x-sysfs.c | 9 +- drivers/hwtracing/coresight/coresight-etm4x.h | 24 ++ 3 files changed, 187 insertions(+), 172 deletions(-) d

[PATCH v3 22/26] coresight: etm4x: Add necessary synchronization for sysreg access

2020-10-28 Thread Suzuki K Poulose
As per the specification any update to the TRCPRGCTLR must be synchronized by a context synchronization event (in our case an explicist ISB) before the TRCSTATR is checked. Cc: Mike Leach Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x

[PATCH v3 20/26] coresight: etm4x: Handle ETM architecture version

2020-10-28 Thread Suzuki K Poulose
handling by adding helpers. Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 2 +- drivers/hwtracing/coresight/coresight-etm4x.h | 60 ++- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x

[PATCH v3 09/26] coresight: Convert coresight_timeout to use access abstraction

2020-10-28 Thread Suzuki K Poulose
Convert the generic routines to use the new access abstraction layer gradually, starting with coresigth_timeout. Cc: Mike Leach Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 5 ++-- drivers/hwtracing/coresight/coresight

[PATCH v3 08/26] coresight: tpiu: Prepare for using coresight device access abstraction

2020-10-28 Thread Suzuki K Poulose
the access directly to avoid having to deal with the un-initialised csdev. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-tpiu.c | 30 +--- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers

[PATCH v3 06/26] coresight: etm4x: Handle access to TRCSSPCICRn

2020-10-28 Thread Suzuki K Poulose
TRCSSPCICR is present only if all of the following are true: TRCIDR4.NUMSSCC > n. TRCIDR4.NUMPC > 0b . TRCSSCSR.PC == 0b1 Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 13 - 1 file changed, 8 insertions

[PATCH v3 11/26] coresight: etm4x: Always read the registers on the host CPU

2020-10-28 Thread Suzuki K Poulose
As we are about to add support for sysreg access to ETM4.4+ components, make sure that we read the registers only on the host CPU. Cc: Mike Leach Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-sysfs.c | 23 --- 1 file

[PATCH v3 18/26] coresight: etm4x: Clean up exception level masks

2020-10-28 Thread Suzuki K Poulose
users by shifting to their field. No functional changes, only code cleanups. Signed-off-by: Suzuki K Poulose --- Changes since previous version: - Fix the duplicate shift. More commentary --- .../coresight/coresight-etm4x-core.c | 47 +-- .../coresight/coresight-etm4x

[PATCH v3 24/26] coresight: etm4x: Refactor probing routine

2020-10-28 Thread Suzuki K Poulose
CoreSight ETM with system register access may not have a memory mapped i/o access. Refactor the ETM specific probing into a common routine to allow reusing the code for such ETMs. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c

[PATCH v3 23/26] coresight: etm4x: Detect system instructions support

2020-10-28 Thread Suzuki K Poulose
ETM v4.4 onwards adds support for system instruction access to the ETM. Detect the support on an ETM and switch to using the mode when available. Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 39 +++ 1 file changed, 39 insertions(+) diff

[PATCH v3 16/26] coresight: etm4x: Check for Software Lock

2020-10-28 Thread Suzuki K Poulose
The Software lock is not implemented for system instructions based accesses. So, skip the lock register access in such cases. Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 40 --- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git

[PATCH v3 21/26] coresight: etm4x: Use TRCDEVARCH for component discovery

2020-10-28 Thread Suzuki K Poulose
We have been using TRCIDR1 for detecting the ETM version. This is in preparation for the future IP support. Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 46 +-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers

[PATCH v3 26/26] dts: bindings: coresight: ETM system register access only units

2020-10-28 Thread Suzuki K Poulose
Document the bindings for ETMs with system register accesses. Cc: devicet...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Cc: Rob Herring Signed-off-by: Suzuki K Poulose --- Documentation/devicetree/bindings/arm/coresight.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH v3 25/26] coresight: etm4x: Add support for sysreg only devices

2020-10-28 Thread Suzuki K Poulose
Add support for devices with system instruction access only. They don't have a memory mapped interface and thus are not AMBA devices. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 50 +-- 1 file ch

[PATCH v3 10/26] coresight: Convert claim/disclaim operations to use access wrappers

2020-10-28 Thread Suzuki K Poulose
Convert the generic CLAIM tag management APIs to use the device access layer abstraction. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 6 +- drivers/hwtracing/coresight/coresight-core.c | 66

[PATCH v3 19/26] coresight: etm4x: Detect access early on the target CPU

2020-10-28 Thread Suzuki K Poulose
In preparation to detect the support for system instruction support, move the detection of the device access to the target CPU. Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 45 --- 1 file changed, 40 insertions(+), 5 deletions(-) diff

[PATCH v3 13/26] coresight: etm4x: Add commentary on the registers

2020-10-28 Thread Suzuki K Poulose
As we are about define a switch..case table for individual register access by offset for implementing the system instruction support, document the possible set of registers for each group to make it easier to co-relate. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose

[PATCH v3 03/26] coresight: etm4x: Update TRCIDR3.NUMPROCS handling to match v4.2

2020-10-28 Thread Suzuki K Poulose
Since ETMv4.2, TRCIDR3.NUMPROCS has been extended to a 5bit field by encoding the top 2 bits[4:3] in TRCIDR3.[13:12], which were RES0. Fix the driver to compute the field correctly for ETMv4.2+ Cc: Mike Leach Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight

[PATCH v3 00/26] coresight: Support for ETM system instructions

2020-10-28 Thread Suzuki K Poulose
r claim/disclaim and CS_LOCK/UNLOCK conversions. - Move device access initialisation for etm4x to the target CPU - Cleanup secure exception level mask handling. - Switch to use TRCDEVARCH for ETM component discovery. This is for making - Check the availability of OS/Software Locks before

[PATCH v3 17/26] coresight: etm4x: Cleanup secure exception level masks

2020-10-28 Thread Suzuki K Poulose
We rely on the ETM architecture version to decide whether Secure EL2 is available on the CPU for excluding the level for address comparators and viewinst main control register. We must instead use the TRCDIDR3.EXLEVEL_S field to detect the supported levels. Signed-off-by: Suzuki K Poulose

[PATCH v3 07/26] coresight: Introduce device access abstraction

2020-10-28 Thread Suzuki K Poulose
layer for the accesses to a given device. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 1 + drivers/hwtracing/coresight/coresight-core.c | 49 + .../hwtracing/coresight/coresight-cti-core.c | 1 + drivers/hwtracing

[PATCH v3 14/26] coresight: etm4x: Add sysreg access helpers

2020-10-28 Thread Suzuki K Poulose
ETMv4.4 architecture defines the system instructions for accessing ETM via register accesses. Add basic support for accessing a given register via system instructions. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 39

[PATCH v3 15/26] coresight: etm4x: Define DEVARCH register fields

2020-10-28 Thread Suzuki K Poulose
Define the fields of the DEVARCH register for identifying a component as an ETMv4.x unit. Going forward, we use the DEVARCH register for the component identification, rather than the TRCIDR3. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x

Re: [PATCH 1/2] hwtracing: coresight: add missing MODULE_LICENSE()

2020-10-27 Thread Suzuki K Poulose
On 10/27/20 8:51 AM, ba...@kernel.org wrote: From: Felipe Balbi Fix the following build warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/hwtracing/coresight/coresight.o Signed-off-by: Felipe Balbi Acked-by: Suzuki K Poulose

Re: [PATCH] coresight: etm4x: Add config to exclude kernel mode tracing

2020-10-15 Thread Suzuki K Poulose
Hi Sai, On 10/15/2020 01:45 PM, Sai Prakash Ranjan wrote: On production systems with ETMs enabled, it is preferred to exclude kernel mode(NS EL1) tracing for security concerns and support only userspace(NS EL0) tracing. So provide an option via kconfig to exclude kernel mode tracing if it is req

Re: [PATCH 1/2] coresight: tmc-etf: Fix NULL ptr dereference in tmc_enable_etf_sink_perf()

2020-10-14 Thread Suzuki K Poulose
On 10/14/2020 10:36 AM, Sai Prakash Ranjan wrote: On 2020-10-13 22:05, Suzuki K Poulose wrote: On 10/07/2020 02:00 PM, Sai Prakash Ranjan wrote: There was a report of NULL pointer dereference in ETF enable path for perf CS mode with PID monitoring. It is almost 100% reproducible when the

Re: [PATCH 1/2] coresight: tmc-etf: Fix NULL ptr dereference in tmc_enable_etf_sink_perf()

2020-10-13 Thread Suzuki K Poulose
On 10/07/2020 02:00 PM, Sai Prakash Ranjan wrote: There was a report of NULL pointer dereference in ETF enable path for perf CS mode with PID monitoring. It is almost 100% reproducible when the process to monitor is something very active such as chrome and with ETF as the sink and not ETR. Curren

Re: [PATCH 2/2] coresight: etm4x: Fix save and restore of TRCVMIDCCTLR1 register

2020-09-28 Thread Suzuki K Poulose
TRCCIDCCTLR1); writel_relaxed(state->trcvmidcctlr0, drvdata->base + TRCVMIDCCTLR0); - writel_relaxed(state->trcvmidcctlr0, drvdata->base + TRCVMIDCCTLR1); + writel_relaxed(state->trcvmidcctlr1, drvdata->base + TRCVMIDCCTLR1); Reviewed-by: Suzuki K Poulose

Re: [PATCH v6] perf: arm_dsu: Support DSU ACPI devices

2020-09-15 Thread Suzuki K Poulose
| 63 +- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index 96ed93c..98e68ed 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c Reviewed-by: Suzuki K Poulose

Re: [PATCH v11 15/24] coresight: allow replicator driver to be built as module

2020-09-15 Thread Suzuki K Poulose
functions, for module unload - add a MODULE_DEVICE_TABLE for autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Co-developed-by: Mian Yousaf Kaukab Signed-off-by: Mian Yousaf Kaukab Signed-off-by

Re: [PATCH v11 06/24] coresight: add try_get_module() in coresight_grab_device()

2020-09-15 Thread Suzuki K Poulose
active session. Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Suggested-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose

Re: [PATCH v5] perf: arm_dsu: Support DSU ACPI devices

2020-09-15 Thread Suzuki K Poulose
Hi Tuan On 09/14/2020 05:21 PM, Tuan Phan wrote: Reported-by: kernel test robot mailto:l...@intel.com>> All warnings (new ones prefixed by >>): drivers/perf/arm_dsu_pmu.c:799:36: warning: unused variable 'dsu_pmu_acpi_match' [-Wunused-const-variable]   static const struct acpi_device_id dsu

Re: [PATCH v10 14/24] coresight: allow funnel driver to be built as module

2020-09-13 Thread Suzuki K Poulose
autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Co-developed-by: Mian Yousaf Kaukab Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reported

Re: [PATCH v10 14/24] coresight: allow funnel driver to be built as module

2020-09-13 Thread Suzuki K Poulose
autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Co-developed-by: Mian Yousaf Kaukab Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reported

Re: [PATCH v10 10/24] coresight: etm4x: allow etm4x to be built as a module

2020-09-13 Thread Suzuki K Poulose
etm4_remove function, for module unload - add a MODULE_DEVICE_TABLE for autoloading on boot - delay advertising the per-cpu etmdrvdata - protect etmdrvdata[] by modifying it on relevant CPU Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah

Re: [PATCH v10 09/24] coresight: etm3x: allow etm3x to be built as a module

2020-09-13 Thread Suzuki K Poulose
function, for module unload - add a MODULE_DEVICE_TABLE for autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reviewed-by: Mike

Re: [PATCH v5] perf: arm_dsu: Support DSU ACPI devices

2020-09-10 Thread Suzuki K Poulose
On 09/10/2020 08:07 PM, Tuan Phan wrote: Hi Will, On Sep 10, 2020, at 6:40 AM, kernel test robot wrote: Hi Tuan, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.9-rc4 next-20200910] [If your patch is applied to

Re: [PATCH v3] perf: arm_dsu: Support DSU ACPI devices

2020-09-07 Thread Suzuki K Poulose
On 09/07/2020 12:02 PM, Will Deacon wrote: [+ Suzuki as I'd like his Ack on this] Thanks Will ! On Fri, Aug 14, 2020 at 05:39:40PM -0700, Tuan Phan wrote: Add support for probing device from ACPI node. Each DSU ACPI node and its associated cpus are inside a cluster node. Signed-off-by: Tua

Re: [PATCH v7] perf test: Introduce script for Arm CoreSight testing

2020-09-07 Thread Suzuki K Poulose
be to get syscall args filenames 75: Use vfs_getname probe to get syscall args filenames # perf test 71 71: Check Arm CoreSight trace data recording and branch samples: Ok Signed-off-by: Leo Yan Leo, Thank you so much for testcase ! Reviewed-by: Suzuki K Poulose

Re: [PATCH v6] perf test: Introduce script for Arm CoreSight testing

2020-09-07 Thread Suzuki K Poulose
On 09/07/2020 08:29 AM, Leo Yan wrote: We need a simple method to test Perf with Arm CoreSight drivers, this could be used for smoke testing when new patch is coming for perf or CoreSight drivers, and we also can use the test to confirm if the CoreSight has been enabled successfully on new platfo

[PATCH v2] coresight: etm4x: Handle unreachable sink in perf mode

2020-09-02 Thread Suzuki K Poulose
oirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- Change since v1: - Updated the description, added Tested-by. - No code changes - Rebased on coresight/next --- drivers/hwtracing/coresight/coresight-etm-perf.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/hwtrac

Re: [RFC PATCH v2] coresight: etm4x: Modify core-commit of cpu to avoid the overflow of HiSilicon ETM

2020-09-02 Thread Suzuki K Poulose
On 08/27/2020 09:44 PM, Mathieu Poirier wrote: Hi Liu, On Wed, Aug 19, 2020 at 04:06:37PM +0800, Qi Liu wrote: When too much trace information is generated on-chip, the ETM will overflow, and cause data loss. This is a common phenomenon on ETM devices. But sometimes we do not want to lose perf

Re: [PATCH] coresight: etm4x: Handle unreachable sink in perf mode

2020-09-01 Thread Suzuki K Poulose
On 08/19/2020 08:22 PM, Mathieu Poirier wrote: Hi Suzuki, On Tue, Aug 18, 2020 at 08:29:31PM +0100, Suzuki K Poulose wrote: If the specified/hinted sink is not reachable from a subset of the CPUs, we could end up unable to trace the event on those CPUs. This is the best effort we could do

[PATCH] coresight: etm4x: Handle unreachable sink in perf mode

2020-08-18 Thread Suzuki K Poulose
] el0_sync+0x140/0x180 Fixes: f9d81a657bb8 ("coresight: perf: Allow tracing on hotplugged CPUs") Reported-by: Jeremy Linton Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm-perf.c | 10 ++ 1 file changed, 10

Re: [PATCH v2] coresight: etm4x: Add Support for HiSilicon ETM device

2020-08-13 Thread Suzuki K Poulose
-Hip08 */ + CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */ Acked-by: Suzuki K Poulose

Re: [PATCH] coresight: fix offset by one error in counting ports

2020-08-13 Thread Suzuki K Poulose
gt;child_port; + if (ptr->child_port >= pdata->nr_inport) + pdata->nr_inport = ptr->child_port + 1; } } I was about to post a similar fix following a report from Jeremy. This looks fine to me. Reviewed-by: Suzuki K Poulose

Re: [PATCH v4] perf test: Introduce script for Arm CoreSight testing

2020-08-12 Thread Suzuki K Poulose
Hi Leo, On 08/06/2020 08:02 AM, Leo Yan wrote: We need a simple method to test Perf with Arm CoreSight drivers, this could be used for smoke testing when new patch is coming for perf or CoreSight drivers, and we also can use the test to confirm if the CoreSight has been enabled successfully on n

Re: [PATCH 2/2] KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set

2020-08-11 Thread Suzuki K Poulose
_pgd") Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: James Morse Signed-off-by: Will Deacon --- Reviewed-by: Suzuki K Poulose

Re: [PATCH] coresight: etm4x: Add Support for HiSilicon ETM device

2020-08-04 Thread Suzuki K Poulose
Hi Qi On 08/03/2020 02:35 PM, Qi Liu wrote: Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08 contains ETMv4.2 device and Hip09 contains ETMv4.5 device. Does the ETMv4.5 on your system implement system instructions to access the ETMs ? If so, please could you give the follo

Re: [PATCHv3] coresight: etm4x: Fix etm4_count race by moving cpuhp callbacks to init

2020-08-03 Thread Suzuki K Poulose
quot;hwtracing/coresight-etm4x: Convert to hotplug state machine") Suggested-by: Suzuki K Poulose Signed-off-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose

Re: [PATCH 1/4] drivers/perf: Add support for ARMv8.3-SPE

2020-07-31 Thread Suzuki K Poulose
On 07/31/2020 01:18 PM, liwei (GF) wrote: On 2020/7/30 16:14, Leo Yan wrote: Hi Suzuki, On Wed, Jul 29, 2020 at 10:12:50AM +0100, Suzuki Kuruppassery Poulose wrote: On 07/24/2020 10:16 AM, Wei Li wrote: Armv8.3 extends the SPE by adding: - Alignment field in the Events packet, and filtering

Re: [RFC PATCH 03/14] coresight: tpiu: Use coresight device access abstraction

2020-07-31 Thread Suzuki K Poulose
On 07/29/2020 10:01 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:29PM +0100, Suzuki K Poulose wrote: TPIU driver access the device before the coresight device is registered. In other words, before the drvdata->csdev is valid. Thus, we need to make sure that the csdev_access is va

Re: [RFC PATCH 09/14] coresight: etm4x: Add sysreg access helpers

2020-07-31 Thread Suzuki K Poulose
On 07/30/2020 10:41 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:35PM +0100, Suzuki K Poulose wrote: ETMv4.4 architecture defines the system instructions for accessing ETM via register accesses. Add basic support for accessing a given register via system instructions. Cc: Mathieu

Re: [RFC PATCH 08/14] coresight: etm4x: Convert all register accesses

2020-07-31 Thread Suzuki K Poulose
On 07/30/2020 09:20 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:34PM +0100, Suzuki K Poulose wrote: Convert all register accesses from etm4x driver to use a wrapper to allow switching the access at runtime with little overhead. co-developed by sed tool ;-), mostly equivalent to

Re: [RFC PATCH 06/14] coresight: Convert claim and lock operations to use access wrappers

2020-07-31 Thread Suzuki K Poulose
On 07/30/2020 08:54 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:32PM +0100, Suzuki K Poulose wrote: Convert the CoreSight CLAIM set/clear, LOCK/UNLOCK operations to use the coresight device access abstraction. Mostly a mechanical change. Cc: Mathieu Poirier Cc: Mike Leach

Re: [RFC PATCH 04/14] coresight: etm4x: Free up argument of etm4_init_arch_data

2020-07-31 Thread Suzuki K Poulose
On 07/30/2020 06:31 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:30PM +0100, Suzuki K Poulose wrote: etm4_init_arch_data is called early during the device probe, even before the coresight_device is registered. Since we are about to replace the direct access via abstraction layer, we

Re: [RFC PATCH 14/14] dts: bindings: coresight: ETMv4.4 system register access only units

2020-07-30 Thread Suzuki K Poulose
On 07/29/2020 06:20 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:40PM +0100, Suzuki K Poulose wrote: Document the bindings for ETMv4.4 and later with only system register access. Cc: Rob Herring Cc: devicet...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by

Re: [RFC PATCH 02/14] coresight: Introduce device access abstraction

2020-07-30 Thread Suzuki K Poulose
On 07/29/2020 08:56 PM, Mathieu Poirier wrote: On Wed, Jul 22, 2020 at 06:20:28PM +0100, Suzuki K Poulose wrote: We are about to introduce support for sysreg access to ETMv4.4+ component. Since there are generic routines that access the registers (e.g, CS_LOCK/UNLOCK , claim/disclaim operations

Re: [RFC PATCH 01/14] coresight: etm4x: Skip save/restore before device registration

2020-07-30 Thread Suzuki K Poulose
On 07/29/2020 07:01 PM, Mathieu Poirier wrote: Hi Suzuki, I have starte to review this - comments will be scattered over a few days. On Wed, Jul 22, 2020 at 06:20:27PM +0100, Suzuki K Poulose wrote: Skip cpu save/restore before the coresight device is registered. Cc: Mathieu Poirier Cc

Re: [PATCH 1/4] drivers/perf: Add support for ARMv8.3-SPE

2020-07-29 Thread Suzuki K Poulose
On 07/24/2020 10:16 AM, Wei Li wrote: Armv8.3 extends the SPE by adding: - Alignment field in the Events packet, and filtering on this event using PMSEVFR_EL1. - Support for the Scalable Vector Extension (SVE). The main additions for SVE are: - Recording the vector length for SVE operations i

Re: [PATCH] coresight: etm4x: Fix etm4_count race using atomic variable

2020-07-27 Thread Suzuki K Poulose
On 07/27/2020 07:07 AM, Sai Prakash Ranjan wrote: etm4_count keeps track of number of ETMv4 registered and on some systems, a race is observed on etm4_count variable which can lead to multiple calls to cpuhp_setup_state_nocalls_cpuslocked(). This function internally calls cpuhp_store_callbacks()

[RFC PATCH 04/14] coresight: etm4x: Free up argument of etm4_init_arch_data

2020-07-22 Thread Suzuki K Poulose
available via etmdrvdata[smp_processor_id()]. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b

[RFC PATCH 08/14] coresight: etm4x: Convert all register accesses

2020-07-22 Thread Suzuki K Poulose
ata->base + \(.*\))/etm4x_\1_write32(csdev, \2, \3) We don't want to replace them with the csdev_access_* to avoid a function call for every register access for system register access. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-et

[RFC PATCH 12/14] coresight: etm4x: Refactor probing routine

2020-07-22 Thread Suzuki K Poulose
CoreSight ETM with system register access may not have a memory mapped i/o access. Refactor the ETM specific probing into a common routine to allow reusing the code for such ETMs. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight

[RFC PATCH 05/14] coresight: Convert coresight_timeout to use access abstraction

2020-07-22 Thread Suzuki K Poulose
Convert the generic routines to use the new access abstraction layer gradually, starting with coresigth_timeout. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 2 +- drivers/hwtracing/coresight/coresight-etb10.c | 5

[RFC PATCH 11/14] coresight: etm4x: Detect system register access support

2020-07-22 Thread Suzuki K Poulose
: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x.c | 76 +++ drivers/hwtracing/coresight/coresight-etm4x.h | 16 2 files changed, 78 insertions(+), 14 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight

[RFC PATCH 07/14] coresight: etm4x: Always read the registers on the host CPU

2020-07-22 Thread Suzuki K Poulose
As we are about to add support for sysreg access to ETM4.4+ components, make sure that we read the registers only on the host CPU. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-sysfs.c | 23 --- 1 file changed, 10

[RFC PATCH 06/14] coresight: Convert claim and lock operations to use access wrappers

2020-07-22 Thread Suzuki K Poulose
Convert the CoreSight CLAIM set/clear, LOCK/UNLOCK operations to use the coresight device access abstraction. Mostly a mechanical change. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 14 ++-- .../hwtracing/coresight

[RFC PATCH 14/14] dts: bindings: coresight: ETMv4.4 system register access only units

2020-07-22 Thread Suzuki K Poulose
Document the bindings for ETMv4.4 and later with only system register access. Cc: Rob Herring Cc: devicet...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- Documentation/devicetree/bindings/arm/coresight.txt | 6 +- 1 file changed, 5 insertions

[RFC PATCH 10/14] coresight: etm4x: Define DEVARCH register fields

2020-07-22 Thread Suzuki K Poulose
Define the fields of the DEVARCH register for identifying a component as an ETMv4.x unit. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x.c | 4 ++-- drivers/hwtracing/coresight/coresight-etm4x.h | 16 2

<    1   2   3   4   5   6   7   8   9   10   >