From patchwork Thu Aug 25 21:19:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 74746 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1049287qga; Thu, 25 Aug 2016 14:26:39 -0700 (PDT) X-Received: by 10.98.89.23 with SMTP id n23mr20385353pfb.34.1472160398976; Thu, 25 Aug 2016 14:26:38 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id h28si17315653pfk.146.2016.08.25.14.26.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 14:26:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd29H-0002kH-W8; Thu, 25 Aug 2016 21:25:20 +0000 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd24g-0006z9-Hz for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2016 21:20:37 +0000 Received: by mail-it0-x231.google.com with SMTP id e63so297112385ith.1 for ; Thu, 25 Aug 2016 14:20:15 -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=NzURTGLzLZ/e32MOjpKxICKTmoadM0piFB1TQTXuYko=; b=X13NWlryucW3emJWgxKDaMC79HfYIl1EOysX+c/BVMAoj3vzIldmbbU+eLq4QOYq+F kkgdfREVy3vI5hltMleR+riNKguIH2WkEtec9X4RbWzNoy2mJirl8lwM6t1fGBtxDhZR GpZrw827dKBt0Zu8izDCfAhqbWwz/wMgUu0H4= 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=NzURTGLzLZ/e32MOjpKxICKTmoadM0piFB1TQTXuYko=; b=TGLvJNJYRGmjOtPZKpWMWjf61jX/JJEyhw1FKZ6tknDNnfO8rF5ZnGtFsYNwo7N4nv /y5TfpFgWUnE1MsRXsl6JKf3oXto4ZLxbQC3AGzv2mOKJA7uLHaN7e4U3i7qkhA3nOEh K8S9KMa0x5FQ1NiIgY+1FFwvpxI0kFc8Zq45nUDf9ThY5ibB3DNPyIo7xhMqQtd9hX+x HktjHNKEeHiP3d9L7j1i1e38YaMLo/dwMb2v35nbH5WIqPsO7f5smuw+lxLhY1O9wP48 52eewHe6oioEiz+O/nt49axOOUDx3crxGdzfUbSSIiJE6kkxxOOSjASIOSnFTEkdZEx4 T0rg== X-Gm-Message-State: AE9vXwN1+wJHbWtTgPeIegY7ThUIqwbOAALuRurUaqRndZS5tWLHkeUEq7nOIKtHxuURQcBE X-Received: by 10.107.43.16 with SMTP id r16mr12435312ior.81.1472160015312; Thu, 25 Aug 2016 14:20:15 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o5sm14506120ith.20.2016.08.25.14.20.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 14:20:10 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160825_142034_800268_49CE260A X-CRM114-Status: GOOD ( 13.95 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c0b:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@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(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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; }