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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 6F90FC388F7 for ; Tue, 10 Nov 2020 17:34:25 +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 C4F7A2076E for ; Tue, 10 Nov 2020 17:34:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QWr6KGz/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MVfI/mI1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4F7A2076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=+gvTSkx7XMN+PB9VgViv/1H7rzLGg6xFF455QeLdOzI=; b=QWr6KGz/doOhVuqRyINSTafMC N9tX45uuPYk+LKFCpC7BE4zfpq1BL0724Vp924INtYurLtUmNOSoggWO0mDGYM4EhEV+Xz7DzbAl/ ftTmuqxN4biN8/fNXK4HNiZ0chKJZSYztaKqD726UzmN3wq26maBDJuNPK7zFd9v8KvBKye3xUlmz nLaqgMkJiU5ivE2BFFeoDJ5hK+fcW0paAjhZMbiQqRuHekxYmmlhAzDNaXXAW/H6RdnZ3BkSADCZL Gj5MDiERbo7ZVhALFFJKvp6iLPdfRV5NInQEL7c1jQI0KQO6SZTtIO3HkIlfUEGkTHjBZwyCiXdF/ fBnfOqlKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXW3-0004mo-Ei; Tue, 10 Nov 2020 17:33:11 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXW0-0004lk-HX for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 17:33:09 +0000 Received: by mail-pl1-x641.google.com with SMTP id g11so6806637pll.13 for ; Tue, 10 Nov 2020 09:33:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9zVnfWT/kePcxqOhf68I33NqWXFBDGvppNuEI4E5rYE=; b=MVfI/mI1n13XgDpXTRyKhljXo8trbSF0QGncs1VQDJW5qSNAad78ZBG85LcQL+gSeL /7cNmB9wC0DWkehgP14dTeRQBWfUQ7FuccWAvvxgj/KsQPQQpQ2BDoPiePLCe2aFUrz5 PzmWtSQBYC7OsgXeHMoGyO0mQI4/15gYwzUT2dv1Emnj6xadhyxbtnhYzWrUDnnRHDT9 1Kf2YQC2rD/XchXkfXxItC4k4twwKXyx5//Um9820CK4hR2RrOB/jIahojm+La/R8+/C TrEOZAyfQNJc8FhO+3dMVULCHdwbJqkwKk3E8ZsXj6vgx7gkBr3gFq6JWUeRRJsgIfuJ fxBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9zVnfWT/kePcxqOhf68I33NqWXFBDGvppNuEI4E5rYE=; b=IK/kUPZ9oVNMnAM9GL4PWeq7tSlRvb+lJ3loeOhrnbUxdqjMEiSVFaVKJ543rY2/kO 8q47nO6X0NZ5nsALF+uN7AS0v0Kni4g1KOH1p8Ib3intKtEuXzLUL1mgg6Eb/GmPF5Jq AVqGLurF5q6sM+e757K1IQ+8/Y9hbQrdmDRU7wKza7dVAX9F4PfYmd5gFApIrsparWXG 8Q0QGJ1Iw0jUXP+2Yb52HR68xBezMytySqSXWN+vStfCc+ySt53+sgI43wjJe2I5RoUK ZAvTFfpQtHsxsxivyqvs1liCO30PYQPULB2qLLvGi+k7jxUmf3Rh5wf41nku56X9ygih oUOw== X-Gm-Message-State: AOAM530yeAAFAnMFIB1k9RN0ZrVD+SVn2S48CRuYWQBBKdBqj5EZbimU fiCMpG4hHDhJcg6XVacgIcfkVXLyiQMbcw== X-Google-Smtp-Source: ABdhPJwmURK0sc0CDRd2x1IAF7JwRoZnVW/EZTlDgU4Sy9WN8JL7rqAKRlETwpJr5KQCIFPdEoVcgg== X-Received: by 2002:a17:902:a402:b029:d6:e257:c71a with SMTP id p2-20020a170902a402b02900d6e257c71amr17088228plq.49.1605029586070; Tue, 10 Nov 2020 09:33:06 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 199sm14528906pgg.18.2020.11.10.09.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 09:33:05 -0800 (PST) Date: Tue, 10 Nov 2020 10:33:03 -0700 From: Mathieu Poirier To: Suzuki K Poulose Subject: Re: [PATCH v3 23/26] coresight: etm4x: Detect system instructions support Message-ID: <20201110173303.GB3429138@xps15> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-25-suzuki.poulose@arm.com> <20201109202205.GB3396611@xps15> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_123308_646352_10CA5A0A X-CRM114-Status: GOOD ( 26.80 ) 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: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 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 Tue, Nov 10, 2020 at 09:31:42AM +0000, Suzuki K Poulose wrote: > On 11/9/20 8:22 PM, Mathieu Poirier wrote: > > On Wed, Oct 28, 2020 at 10:09:42PM +0000, Suzuki K Poulose wrote: > > > ETM v4.4 onwards adds support for system instruction access > > > to the ETM. Detect the support on an ETM and switch to using the > > > mode when available. > > > > > > Signed-off-by: Suzuki K Poulose > > > --- > > > .../coresight/coresight-etm4x-core.c | 39 +++++++++++++++++++ > > > 1 file changed, 39 insertions(+) > > > > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > index 4bc2f15b6332..dc537b5612eb 100644 > > > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > @@ -675,6 +675,37 @@ static const struct coresight_ops etm4_cs_ops = { > > > .source_ops = &etm4_source_ops, > > > }; > > > +static inline bool cpu_supports_sysreg_trace(void) > > > +{ > > > + u64 dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1); > > > + > > > + return ((dfr0 >> ID_AA64DFR0_TRACEVER_SHIFT) & 0xfUL) > 0; > > > > I would do: > > > > return ((dfr0 >> ID_AA64DFR0_TRACEVER_SHIFT) & 0xfUL) == 1; > > > > Because any other value than '1' are reserved. > > Correct. However, this is something we follow for all ID features > in the arm64 kernel and is clarified in the Arm ARM (ARM DDI 0487F.a) : > > "D13.1.3 Principles of the ID scheme for fields in ID registers" > > Which guarantees that a (field > n) implies, everything that field == n > is implied. (Well there are exceptions listed in the section, but > TRACEVER is not one of those). So this should cover an old kernel > running on a future CPU, using the features that it understands. > (See feature_matches() in arch/arm64/kernel/cpufeature.c, which is > the fundamental logic to detect a feature). > While I haven't found anything conclusive in cpufeature.c, the documentation is clear on the fact that versions are incremental and build on top of previous ones. We can proceed with the current implementation. > Please let me know if you're OK with the justification. > > Thanks for the review. > > Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel