Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp39234pxy; Fri, 30 Jul 2021 23:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVtL/spQ9gRaP/SidSy1Y5zut1gHhjGMxxaCQIY+Uqb1RyK1kEYvweTcr9m4/+hrnx1rRI X-Received: by 2002:a02:7f12:: with SMTP id r18mr5081459jac.50.1627711635292; Fri, 30 Jul 2021 23:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627711635; cv=none; d=google.com; s=arc-20160816; b=Hice88sIuJIEDVujnhskBRBNddnxrCxv44iL4noSe6tpg9s3FBh2NtcNL64sw6wfB6 B63DrVsOhI84R3qJuERmc+L4BXI28ZC8MjfwJ5gNdfTV/MypO0tzye1SSWkcCN+yfy2w UIs6bfJeczqXmlFJg47O+KH8Nf+f2f0FBPF0FiA0r+SyLzNSvpeT71H571cG8Ysiz4oQ aHx/Bdi37vy8myEwIFpkDvlb5T0jMHgegH0pq5sQmFEi0RU/mgH4M9jAVHOMulN3bxLp XDJXP4Thm7aSlKLjHytr4QvD3BhyAivTHkcYiLppSE8C7Yr+AdQLYewXaFoBeALaWAWG p9TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=75Zkhg83/waZUlL0SId+YvamWoiIkDrDXEUeyRTWERc=; b=h17Hj1TnhGOrzA31FLM6csui8+HvsDSol2AXy4lbC9PIyo5gfoLhvDUmtRo5v3yE3J XyijL0lEMLn+rMITafaoGwbit7LljL1haGT0JxJOksy0BBCi9LaDHaN871i6A8Lph/yz mgtQBQI7Ft8WvNo6U3GbgOssWplHiJBsP/bep7loACG9IM8TGJQIdz+Fslhmqu3dabsf A5obxx4mO2x1r8bYD4hUdncssHiNkwmG2duiVcuDLJijWUwIeILfltZMChB9PfUnD5kY QM5ZM6RfvUmPStTax72EbXPIT5qgCfRRRPaesZbwf7+1jLZA/Chp7E8olHh20+AQM+8p EWIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zzgpBEUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si4310523ilo.15.2021.07.30.23.06.50; Fri, 30 Jul 2021 23:07:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zzgpBEUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237046AbhGaGDa (ORCPT + 99 others); Sat, 31 Jul 2021 02:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236982AbhGaGD3 (ORCPT ); Sat, 31 Jul 2021 02:03:29 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E08FC06175F for ; Fri, 30 Jul 2021 23:03:23 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id l19so18345066pjz.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=MKsIitL5zmbWIArvDTJxRmOZDaKgxIKRPHUr64dL2pl3U6gXj5/kWaSNubwN6yxkEB Sa2UYYg8klbkFcRwoU+NsSLmM54S2OE2vd1fFO4BmDmsi/96vyAnwW5d/5Zz2hzioYfC f9IyepDk/hyGSTUnqw9DHM5YprsE5AZ+1DHUq0BlfjHXun9FFO73XlbBxlSJYMOQzE42 LY4Kj3gPd4pV7/NIHuVcYOKpFBAGyRsonpnxVWcqNb+MkmYSe/sVNtMI0D7tN4scuZU1 rPfKlqKez7nS/5tVKskDBWnJr1r7NWxifgaqbuVNJ3jgx42k4Twgs519Lp7FJ7tpamHj X8cw== X-Gm-Message-State: AOAM531n7fxWDKCjmu7N8j2wSzgmnKmaeThZZOCjwRRTe0YAV0eHezok m+eLqc+eroPhKIRfKBR1lU+nGw== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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