From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 161B5C63697 for ; Thu, 19 Nov 2020 17:23:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D7FB2100A for ; Thu, 19 Nov 2020 17:23:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="inJ1iY+s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D7FB2100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sK/EPfHfwrBgWx1x1vy7eHGbUbtFW/hiT4vSzbbZETA=; b=inJ1iY+ssdDcX3VY1Y8rQqTld q23Em19L2NN+KXkBulSyCrNBE+tx/uoqYJ6ycEyXsXZPAt6cszsPzODPoff5lXWb7SvFJd3lwr0Hn qglqDVoSSNGMXX+mBNKNqigpIvDmSkmwgKxjdlfH/XrEQWNudlQqmPvSyHmlQOBolcGkSdIFaC/19 8TovWCksH5Vx9m0UDfL72LLeRK0TxYyn7xOr4PyhzepzyoBM4PLh2LNrCc+0mVZHxKgwuRZPbEqag oFok9w8RTo2mhbDlBdtoydFEskj48u1q74GtSrVSNk0fbX8hLrYSTaRnaX5SmhMT/DEoC+A1aDvJ+ IlcImlnYg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfndz-0003Ma-BW; Thu, 19 Nov 2020 17:22:51 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfndx-0003Lx-4z for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 17:22:49 +0000 Received: from gaia (unknown [2.26.170.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EEB42468B; Thu, 19 Nov 2020 17:22:46 +0000 (UTC) Date: Thu, 19 Nov 2020 17:22:43 +0000 From: Catalin Marinas To: Suzuki K Poulose Subject: Re: [PATCH v4 25/25] coresight: Add support for v8.4 SelfHosted tracing Message-ID: <20201119172243.GF4376@gaia> References: <20201119164547.2982871-1-suzuki.poulose@arm.com> <20201119164547.2982871-26-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201119164547.2982871-26-suzuki.poulose@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_122249_278747_27FD254F X-CRM114-Status: GOOD ( 20.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mathieu.poirier@linaro.org, anshuman.khandual@arm.com, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , jonathan.zhouwen@huawei.com, mike.leach@linaro.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 19, 2020 at 04:45:47PM +0000, Suzuki K Poulose wrote: > From: Jonathan Zhou > > v8.4 tracing extensions added support for trace filtering controlled > by TRFCR_ELx. This must be programmed to allow tracing at EL1/EL2 and > EL0. The timestamp used is the virtual time. Also enable CONTEXIDR_EL2 > tracing if we are running the kernel at EL2. > > Cc: Catalin Marinas > Cc: Mathieu Poirier > Cc: Mike Leach > Cc: Will Deacon > Signed-off-by: Jonathan Zhou > [ Move the trace filtering setup etm_init_arch_data() and > clean ups] > Signed-off-by: Suzuki K Poulose > --- > .../coresight/coresight-etm4x-core.c | 25 +++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index 1d054d2ab2a0..647685736134 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -760,6 +760,30 @@ static bool etm4_init_csdev_access(struct etmv4_drvdata *drvdata, > return false; > } > > +static void cpu_enable_tracing(void) > +{ > + u64 dfr0 = read_sysreg(id_aa64dfr0_el1); > + u64 trfcr; > + > + if (!(dfr0 >> ID_AA64DFR0_TRACE_FILT_SHIFT)) > + return; What if we get a new field at position 44 while the FILT one at 40 is 0? We should use cpuid_feature_extract_field() here. BTW, can this function not go in the cpufeature.c code? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel