From patchwork Mon Jul 18 19:51:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 72255 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp291617qga; Mon, 18 Jul 2016 12:54:04 -0700 (PDT) X-Received: by 10.98.58.73 with SMTP id h70mr48348877pfa.125.1468871644231; Mon, 18 Jul 2016 12:54:04 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j80si5050233pfa.194.2016.07.18.12.54.03; Mon, 18 Jul 2016 12:54:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbcGRTxs (ORCPT + 29 others); Mon, 18 Jul 2016 15:53:48 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:33926 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbcGRTvk (ORCPT ); Mon, 18 Jul 2016 15:51:40 -0400 Received: by mail-io0-f179.google.com with SMTP id q83so425196iod.1 for ; Mon, 18 Jul 2016 12:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J8K7O5/ufD7nDI6fICheK+8x/Tn6+Q91NLYmdIN4CL8=; b=RC1Sfw/EY43QObJvWQIztCncBSXrSrbCGjeKqkd0tmlXQECAITDUAG6gLHu9Y436vO GdsnsWjWOjgIw1tNjfWcP6mKCC29Y9RykbMgalj9QbiJ5IsImP9zWYvmeZ6QUGN0XzK7 uJjrgLRyrSztb/UDH7gG1PbPyAay+hrqVx58E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J8K7O5/ufD7nDI6fICheK+8x/Tn6+Q91NLYmdIN4CL8=; b=MvjMyZAy0cF9QrffmXllZj8hQCqkmmz0i3da6lia91gDjTq9sxOwBe0Xm9VjLNqsXB Y0QJW1h7CIZ8AOiisfHFzQ6dzeN7e/1e2gZtz2IsZbhEmv2zQx2TTbe3KruQZbshtqua JzccaRpDDH06c8dmXCMc7KpUzOXNBl9YvsbOTMVc+R3Zs5IXj/6oBuSCNkVdhAHMr/bi vbLXqifINPUq9a4FaYQM8h2THkvGmrXWKUpQe//4ecrWAHORyaKtzJ9F+A0kUditFvHo McU4lb3g0UEtckJqlWgKvtzJvCh2UNG6G6nFYkzphBeeeQFSLMcW1Z+HhPgJ7XnqWgLs cMXQ== X-Gm-Message-State: ALyK8tKs7s8hautFD0BgqmJyJ73EFhnVMEnBVRA19qyXcn1sKoWJuF0wrsFD73X6BLsieXQ0 X-Received: by 10.107.205.129 with SMTP id d123mr36569607iog.70.1468871499369; Mon, 18 Jul 2016 12:51:39 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r128sm5270676ita.6.2016.07.18.12.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 12:51:38 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, Mathieu Poirier Subject: [PATCH 05/10] coresight: etm4x: cleaning up default filter configuration Date: Mon, 18 Jul 2016 13:51:26 -0600 Message-Id: <1468871491-10997-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> References: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 9978cf7a5600..e348c18086f5 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -586,39 +586,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; /* @@ -627,7 +622,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; }