From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758981AbcHYV1M (ORCPT ); Thu, 25 Aug 2016 17:27:12 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:35113 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758902AbcHYV1F (ORCPT ); Thu, 25 Aug 2016 17:27:05 -0400 From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/28] coresight: etm4x: cleaning up default filter configuration Date: Thu, 25 Aug 2016 15:19:14 -0600 Message-Id: <1472159958-5981-25-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> References: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The default filter configuration was hard to read and included some redundancy. This patch attempts to stream line configuration and improve readability. No change of functionality is included. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 53 ++++++++++++++------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index f890d1de39e3..04462fffe8e4 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -583,39 +583,34 @@ static void etm4_set_default_config(struct etmv4_config *config) static void etm4_set_default_filter(struct etmv4_config *config) { - /* - * TRCVICTLR::SSSTATUS == 1, the start-stop logic is - * in the started state - */ - config->vinst_ctrl |= BIT(9); + u64 start, stop, access_type = 0; /* * Configure address range comparator '0' to encompass all * possible addresses. */ + start = 0x0; + stop = ~0x0; - /* First half of default address comparator: start at address 0 */ - config->addr_val[ETM_DEFAULT_ADDR_COMP] = 0x0; - /* trace instruction addresses */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] &= ~(BIT(0) | BIT(1)); - /* EXLEVEL_NS, bits[12:15], only trace application and kernel space */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= ETM_EXLEVEL_NS_HYP; - /* EXLEVEL_S, bits[11:8], don't trace anything in secure state */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= (ETM_EXLEVEL_S_APP | - ETM_EXLEVEL_S_OS | - ETM_EXLEVEL_S_HYP); - config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE; + /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */ + access_type = ETM_EXLEVEL_NS_HYP; /* - * Second half of default address comparator: go all - * the way to the top. - */ - config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = ~0x0; - /* trace instruction addresses */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] &= ~(BIT(0) | BIT(1)); - /* Address comparator type must be equal for both halves */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = - config->addr_acc[ETM_DEFAULT_ADDR_COMP]; + * EXLEVEL_S, bits[11:8], don't trace anything happening + * in secure state. + */ + access_type |= (ETM_EXLEVEL_S_APP | + ETM_EXLEVEL_S_OS | + ETM_EXLEVEL_S_HYP); + + /* First half of default address comparator */ + config->addr_val[ETM_DEFAULT_ADDR_COMP] = start; + config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type; + config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE; + + /* Second half of default address comparator */ + config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop; + config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type; config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE; /* @@ -624,7 +619,13 @@ static void etm4_set_default_filter(struct etmv4_config *config) */ config->viiectlr = BIT(0); - /* no start-stop filtering for ViewInst */ + /* + * TRCVICTLR::SSSTATUS == 1, the start-stop logic is + * in the started state + */ + config->vinst_ctrl |= BIT(9); + + /* No start-stop filtering for ViewInst */ config->vissctlr = 0x0; } -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.poirier@linaro.org (Mathieu Poirier) Date: Thu, 25 Aug 2016 15:19:14 -0600 Subject: [PATCH 24/28] coresight: etm4x: cleaning up default filter configuration In-Reply-To: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> References: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> Message-ID: <1472159958-5981-25-git-send-email-mathieu.poirier@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org The default filter configuration was hard to read and included some redundancy. This patch attempts to stream line configuration and improve readability. No change of functionality is included. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 53 ++++++++++++++------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index f890d1de39e3..04462fffe8e4 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -583,39 +583,34 @@ static void etm4_set_default_config(struct etmv4_config *config) static void etm4_set_default_filter(struct etmv4_config *config) { - /* - * TRCVICTLR::SSSTATUS == 1, the start-stop logic is - * in the started state - */ - config->vinst_ctrl |= BIT(9); + u64 start, stop, access_type = 0; /* * Configure address range comparator '0' to encompass all * possible addresses. */ + start = 0x0; + stop = ~0x0; - /* First half of default address comparator: start at address 0 */ - config->addr_val[ETM_DEFAULT_ADDR_COMP] = 0x0; - /* trace instruction addresses */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] &= ~(BIT(0) | BIT(1)); - /* EXLEVEL_NS, bits[12:15], only trace application and kernel space */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= ETM_EXLEVEL_NS_HYP; - /* EXLEVEL_S, bits[11:8], don't trace anything in secure state */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= (ETM_EXLEVEL_S_APP | - ETM_EXLEVEL_S_OS | - ETM_EXLEVEL_S_HYP); - config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE; + /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */ + access_type = ETM_EXLEVEL_NS_HYP; /* - * Second half of default address comparator: go all - * the way to the top. - */ - config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = ~0x0; - /* trace instruction addresses */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] &= ~(BIT(0) | BIT(1)); - /* Address comparator type must be equal for both halves */ - config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = - config->addr_acc[ETM_DEFAULT_ADDR_COMP]; + * EXLEVEL_S, bits[11:8], don't trace anything happening + * in secure state. + */ + access_type |= (ETM_EXLEVEL_S_APP | + ETM_EXLEVEL_S_OS | + ETM_EXLEVEL_S_HYP); + + /* First half of default address comparator */ + config->addr_val[ETM_DEFAULT_ADDR_COMP] = start; + config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type; + config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE; + + /* Second half of default address comparator */ + config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop; + config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type; config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE; /* @@ -624,7 +619,13 @@ static void etm4_set_default_filter(struct etmv4_config *config) */ config->viiectlr = BIT(0); - /* no start-stop filtering for ViewInst */ + /* + * TRCVICTLR::SSSTATUS == 1, the start-stop logic is + * in the started state + */ + config->vinst_ctrl |= BIT(9); + + /* No start-stop filtering for ViewInst */ config->vissctlr = 0x0; } -- 2.7.4