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=-14.5 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 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 108E1C4338F for ; Sat, 31 Jul 2021 06:05:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BB57D6069E for ; Sat, 31 Jul 2021 06:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB57D6069E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=f+6qh9Hdvbb04dZ3nmaOzJB/RXvQVluP38Jezs7pmW8=; b=25ricc/K1dfqBo 42sgaf2g9Lvbt4r7QVrWlcJVOPYdiSzt/+u7cBq2dDKTSOmXMVQbTNu/A3MpvYrDjmJCdGmwrtzVU nRfkdy8fdWksEHIRipoB4euTSErdnGJUPY8yxxTZxoVEbGwudymOEBAuJsFngvICbdgX0sr/wAOFG vjOyo0z8t0kvBKRnLC1uhsRSpu1aUleAh0cA5WfqZuGVv7bkUlhsRrsr8cPTn3uPzKmUEPAKmDn4k lMrNpUN5U3aX35v7obuS3tG3sEY0lVTj68Jt3FsFss4ASwaAmURMpKqewoMsrfPpBlgDzaLt3ExKc zvWQJZA2hsLuS0O7i1yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9i5n-00B2dD-Uh; Sat, 31 Jul 2021 06:03:28 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9i5k-00B2c1-3U for linux-arm-kernel@lists.infradead.org; Sat, 31 Jul 2021 06:03:25 +0000 Received: by mail-pj1-x1035.google.com with SMTP id j18-20020a17090aeb12b029017737e6c349so10537132pjz.0 for ; Fri, 30 Jul 2021 23:03:23 -0700 (PDT) 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=75Zkhg83/waZUlL0SId+YvamWoiIkDrDXEUeyRTWERc=; b=zzgpBEUrIKvu+dKlJJ/xrPzDeZ/TnnVtXB0yFrdxc/GyJ/YieEUpvQn0lMKTv8w4vx HOtrNRQeX0vDKCV8JoM6H/TIx8TmLEdoOMZpsiagdDeug/aHxsMj/Y5jIZvemcWpk7ui SDToqwk0ULG8/g8O5v0hW4H5LhxtrYorU9EYzW+5sMdwSjB7CS1hV3WSBDbt2uyRM+3o mVUd8e5b/3vBl4jhPju3hgqSOblCLwB23b3oMdME7uGJ4USctCGxEZ09DoE5JZHK9YgW WvCujxef4wycGeD1ajoctBruhpuTaTQi3Km+x48Vt86sZJsK9R4uNb1ZCU/D94WRK5oB lK0g== 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=75Zkhg83/waZUlL0SId+YvamWoiIkDrDXEUeyRTWERc=; b=qqT2UmmJNVV4NVlx6qvNSrgw74Czg8VAMlnAWNTDtx7SviSCwJV+wqkdWwPv7C+Zki I9M9cgh1lKqGspYoXmf4IVcVdDm22N4v2UhkjhUwTDRZxL9CxA59c0AtPCtbc9/DQ4Af OW6PwpJqeUrFyZGuO5hke0g1t46sJG9xGgzIN7Cbmf3jm1UwmLIBRnIYxXTKD7ZB8S04 YYLM9yW9gxoAG+8lb5FNHw6VR8hoElW65vgYH3cxaxgplwxh+beYcP5Qx6ttfcvWv66l jnQA30ESK7F3MXcNSMcdkjVEUDHmbWozIs9ClHOvNQt2PcoQdSBlzAfk/JB3ijBBts76 +Prw== X-Gm-Message-State: AOAM5318WDjCDePQAQgB/14eXuXtuZ+0XTcnIqoAGmr6HlXV592s/QqK Pa14h6semKFEsP9cmMoC8RCdIw== X-Google-Smtp-Source: ABdhPJwtM3rMZUgyVpwQmUuEHr+HM/85JnXrXwEmH2M+PFy9jtTtvc8zkBClsULutoKg9mDieZyALQ== X-Received: by 2002:a05:6a00:b46:b029:334:54db:af17 with SMTP id p6-20020a056a000b46b029033454dbaf17mr6188123pfo.26.1627711402944; Fri, 30 Jul 2021 23:03:22 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([204.124.181.43]) by smtp.gmail.com with ESMTPSA id m8sm4296685pfo.110.2021.07.30.23.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 23:03:22 -0700 (PDT) Date: Sat, 31 Jul 2021 14:03:12 +0800 From: Leo Yan To: Mike Leach Cc: James Clark , Arnaldo Carvalho de Melo , Mathieu Poirier , Coresight ML , Al Grant , "Suzuki K. Poulose" , Anshuman Khandual , John Garry , Will Deacon , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: Re: [PATCH 2/6] perf cs-etm: Initialise architecture based on TRCIDR1 Message-ID: <20210731060312.GB7437@leoy-ThinkPad-X240s> References: <20210721090706.21523-1-james.clark@arm.com> <20210721090706.21523-3-james.clark@arm.com> 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-20210730_230324_196239_AFEAEA86 X-CRM114-Status: GOOD ( 25.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, Jul 22, 2021 at 12:10:35PM +0100, Mike Leach wrote: > HI James > > On Wed, 21 Jul 2021 at 10:07, James Clark wrote: > > > > Currently the architecture is hard coded as ARCH_V8, but with the > > introduction of ETE we want to pick ARCH_AA64. And this change is also > > applicable to ETM v4.4 onwards as well. > > > > Signed-off-by: James Clark > > --- > > tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 14 +++++++++++++- > > 1 file changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > > index 30889a9d0165..5972a8afcc6b 100644 > > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > > @@ -126,6 +126,18 @@ static int cs_etm_decoder__gen_etmv3_config(struct cs_etm_trace_params *params, > > return 0; > > } > > > > +#define TRCIDR1_TRCARCHMIN_SHIFT 4 > > +#define TRCIDR1_TRCARCHMIN_MASK GENMASK(7, 4) > > +#define TRCIDR1_TRCARCHMIN(x) (((x) & TRCIDR1_TRCARCHMIN_MASK) >> TRCIDR1_TRCARCHMIN_SHIFT) > > +static enum _ocsd_arch_version cs_etm_decoder__get_arch_ver(u32 reg_idr1) > > +{ > > + /* > > + * If the ETM trace minor version is 4 or more then we can assume > > + * the architecture is ARCH_AA64 rather than just V8 > > + */ > > + return TRCIDR1_TRCARCHMIN(reg_idr1) >= 4 ? ARCH_AA64 : ARCH_V8; > > +} > > This is true for ETM4.x & ETE 1.x (arch 5.x) but not ETM 3.x > Probably need to beef up this comment or the function name to emphasise this. Yeah, I think it's good to change the function name. Eventually, this function should only be used for ETM4.x and ETE. Another minor comment is: can we refine the arch version number, e.g. change the OpenCSD's macro "ARCH_AA64" to "ARCH_V8R4", (or "ARCH_V8R3_AA64"), this can give more clear clue what's the ETM version. And a nitpick: how about to change OpenCSD macro "ARCH_V8r3" to "ARCH_V8R3" and assign it for ETMv4.3 IPs. Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel