All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coresight: etmv4: Update default filter and initialisation.
@ 2020-04-15 20:10 Mike Leach
  2020-04-20 18:16 ` Mathieu Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Leach @ 2020-04-15 20:10 UTC (permalink / raw)
  To: linux-arm-kernel, coresight, mathieu.poirier; +Cc: Mike Leach, suzuki.poulose

Differing default states set on driver init / perf init and as a result
of a sysfs reset.

The ETMv4 can be programmed to trace the entire instruction address range
without the need to use address comparator filter resources.
(Described in the ETMv4.x technical reference manual)

sysfs reset was using this method, perf and default driver init were setup
with an address range comparator for the entire address range.

The perf / driver init has been altered to use the method without needing
any comparator address hardware.

Minor adjustment to the vinst_ctrl register initialisation to ensure
correct zero initialisation.

Applies to Linux 5.7-rc1, tested on Juno-r1 and DB410c platforms.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
---
 .../coresight/coresight-etm4x-sysfs.c         |  2 +-
 drivers/hwtracing/coresight/coresight-etm4x.c | 23 +++++--------------
 2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
index ce41482431f9..b673e738bc9a 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
@@ -205,7 +205,7 @@ static ssize_t reset_store(struct device *dev,
 	 * started state. ARM recommends start-stop logic is set before
 	 * each trace run.
 	 */
-	config->vinst_ctrl |= BIT(0);
+	config->vinst_ctrl = BIT(0);
 	if (drvdata->nr_addr_cmp == true) {
 		config->mode |= ETM_MODE_VIEWINST_STARTSTOP;
 		/* SSSTATUS, bit[9] */
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index a90d757f7043..58ae5498ecf1 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -791,7 +791,7 @@ static void etm4_set_default_config(struct etmv4_config *config)
 	config->ts_ctrl = 0x0;
 
 	/* TRCVICTLR::EVENT = 0x01, select the always on logic */
-	config->vinst_ctrl |= BIT(0);
+	config->vinst_ctrl = BIT(0);
 }
 
 static u64 etm4_get_ns_access_type(struct etmv4_config *config)
@@ -894,17 +894,8 @@ static void etm4_set_start_stop_filter(struct etmv4_config *config,
 
 static void etm4_set_default_filter(struct etmv4_config *config)
 {
-	u64 start, stop;
-
-	/*
-	 * Configure address range comparator '0' to encompass all
-	 * possible addresses.
-	 */
-	start = 0x0;
-	stop = ~0x0;
-
-	etm4_set_comparator_filter(config, start, stop,
-				   ETM_DEFAULT_ADDR_COMP);
+	/* Trace everything 'default' filter achieved by no filtering */
+	config->viiectlr = 0x0;
 
 	/*
 	 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
@@ -925,11 +916,9 @@ static void etm4_set_default(struct etmv4_config *config)
 	/*
 	 * Make default initialisation trace everything
 	 *
-	 * Select the "always true" resource selector on the
-	 * "Enablign Event" line and configure address range comparator
-	 * '0' to trace all the possible address range.  From there
-	 * configure the "include/exclude" engine to include address
-	 * range comparator '0'.
+	 * This is done by a minimum default config sufficient to enable
+	 * full instruction trace - with a default filter for trace all
+	 * achieved by having no filtering.
 	 */
 	etm4_set_default_config(config);
 	etm4_set_default_filter(config);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] coresight: etmv4: Update default filter and initialisation.
  2020-04-15 20:10 [PATCH] coresight: etmv4: Update default filter and initialisation Mike Leach
@ 2020-04-20 18:16 ` Mathieu Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2020-04-20 18:16 UTC (permalink / raw)
  To: Mike Leach; +Cc: coresight, linux-arm-kernel, suzuki.poulose

On Wed, Apr 15, 2020 at 09:10:30PM +0100, Mike Leach wrote:
> Differing default states set on driver init / perf init and as a result
> of a sysfs reset.
> 
> The ETMv4 can be programmed to trace the entire instruction address range
> without the need to use address comparator filter resources.
> (Described in the ETMv4.x technical reference manual)
> 
> sysfs reset was using this method, perf and default driver init were setup
> with an address range comparator for the entire address range.
> 
> The perf / driver init has been altered to use the method without needing
> any comparator address hardware.
> 
> Minor adjustment to the vinst_ctrl register initialisation to ensure
> correct zero initialisation.
> 
> Applies to Linux 5.7-rc1, tested on Juno-r1 and DB410c platforms.
> 
> Signed-off-by: Mike Leach <mike.leach@linaro.org>

Applied - thanks,
Mathieu

> ---
>  .../coresight/coresight-etm4x-sysfs.c         |  2 +-
>  drivers/hwtracing/coresight/coresight-etm4x.c | 23 +++++--------------
>  2 files changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> index ce41482431f9..b673e738bc9a 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> @@ -205,7 +205,7 @@ static ssize_t reset_store(struct device *dev,
>  	 * started state. ARM recommends start-stop logic is set before
>  	 * each trace run.
>  	 */
> -	config->vinst_ctrl |= BIT(0);
> +	config->vinst_ctrl = BIT(0);
>  	if (drvdata->nr_addr_cmp == true) {
>  		config->mode |= ETM_MODE_VIEWINST_STARTSTOP;
>  		/* SSSTATUS, bit[9] */
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
> index a90d757f7043..58ae5498ecf1 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
> @@ -791,7 +791,7 @@ static void etm4_set_default_config(struct etmv4_config *config)
>  	config->ts_ctrl = 0x0;
>  
>  	/* TRCVICTLR::EVENT = 0x01, select the always on logic */
> -	config->vinst_ctrl |= BIT(0);
> +	config->vinst_ctrl = BIT(0);
>  }
>  
>  static u64 etm4_get_ns_access_type(struct etmv4_config *config)
> @@ -894,17 +894,8 @@ static void etm4_set_start_stop_filter(struct etmv4_config *config,
>  
>  static void etm4_set_default_filter(struct etmv4_config *config)
>  {
> -	u64 start, stop;
> -
> -	/*
> -	 * Configure address range comparator '0' to encompass all
> -	 * possible addresses.
> -	 */
> -	start = 0x0;
> -	stop = ~0x0;
> -
> -	etm4_set_comparator_filter(config, start, stop,
> -				   ETM_DEFAULT_ADDR_COMP);
> +	/* Trace everything 'default' filter achieved by no filtering */
> +	config->viiectlr = 0x0;
>  
>  	/*
>  	 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
> @@ -925,11 +916,9 @@ static void etm4_set_default(struct etmv4_config *config)
>  	/*
>  	 * Make default initialisation trace everything
>  	 *
> -	 * Select the "always true" resource selector on the
> -	 * "Enablign Event" line and configure address range comparator
> -	 * '0' to trace all the possible address range.  From there
> -	 * configure the "include/exclude" engine to include address
> -	 * range comparator '0'.
> +	 * This is done by a minimum default config sufficient to enable
> +	 * full instruction trace - with a default filter for trace all
> +	 * achieved by having no filtering.
>  	 */
>  	etm4_set_default_config(config);
>  	etm4_set_default_filter(config);
> -- 
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-20 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 20:10 [PATCH] coresight: etmv4: Update default filter and initialisation Mike Leach
2020-04-20 18:16 ` Mathieu Poirier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.