From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6B71D516C for ; Mon, 13 Apr 2026 02:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776049123; cv=none; b=YJ5kLobuqjSuiav8QHGtZYNfzVhIfvAXqzAqnz5UN7KuQthW8JX5nW+OYa3Sjc/ZC+HVTd0YtIL19+0MJThgM80ULwN2ZICVH5HPOYt3YI9SiSz8OmkTRm0q8h3eIVqj6iLMarepMBW88ymxPoWDF57SOaAXEtBIWlYAZxhdh8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776049123; c=relaxed/simple; bh=+U5upar4E/afNSDR99KaeTsgrLERkTmxixib9ha9Qlw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Q1Hsi5hE//b2VFLun11OE7s1Q0Ui8+kwYIQtvvllULZE+LHLFv7t1gVAWzql2YzeuQKS/NJ6wpujbHd2yhkKDaEWsDnlY0/7pDe3j6sDltA0a8jZH2jXvMgztWTZ+2dlIUVklVLIITRsgjA7viDm9fK4Eoo/lF/NHJiQzekyJls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XRo9VdKR; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=T+RHPuKA; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XRo9VdKR"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="T+RHPuKA" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63CNL1Yj3654447 for ; Mon, 13 Apr 2026 02:58:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QEGzIki+1N8cNLyklAPy6pAGy9378thqjB9kewpojWE=; b=XRo9VdKR28FixArj /8Jm/eqTZ66OEQswA1dI5uc2vIzMqk+rXI/syIRcU5ZiKJBFDVoUs1TRG+G21B28 zcD65raBcZmy8y58GSdFMxvnNCNoSsWpC0EZezjsapsvsVMy298bhI2PBMtYDWZ2 HkF08jidQYHouD92lHLMgY6M/CA+IyUFDOfSHFiZXwYvf6A8Y/oe0+dqZmGrXHiZ /j1sDun/PcD0ZDREssAbWeD2cpHJZ2GhCc4G7UxQsca3pcHXwBodSBuupORKI6W3 E8miRuR+41rs7e7CUSiKVDD4y0fYHOjHy8SLbv9o6JFFdsmmKjPlIXr/hfjdRh+t 2WlJXg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dfeyyueta-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Apr 2026 02:58:41 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2b242b9359aso35833175ad.0 for ; Sun, 12 Apr 2026 19:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776049121; x=1776653921; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QEGzIki+1N8cNLyklAPy6pAGy9378thqjB9kewpojWE=; b=T+RHPuKAPZiOfCfWJT3dr3J54Ko3ZWCKBeD1oCQP10088y2LMHAgm22G3ZVPHQPFc6 3+GH7uk8aTleHjhBZDSSqktdAftsU7d7A2sj0hl99xu+y0DeP8Bfio+mBT9ArBMtn2hG A3fB8AdQT8SB3/NswnIPsPMoFsW+4lqeTiwmC7kTgoWueVfOwZlopog94fWQwQazDS20 GOA8OfwAlef/yZ+7Z2gcBPgMheccjf9c8xnF1W/6exhDVOFE20cOepC0uJXxqQmgPBrR +FWpBedaFPuis2yC0YUelISrYqyRc3XDI3mFNTLdxU5DEhU8wHrcuF24nNQefKV8Shgf OKkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776049121; x=1776653921; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QEGzIki+1N8cNLyklAPy6pAGy9378thqjB9kewpojWE=; b=VblUL4GVpY7PvXLJIA+FrsNQ/Tu5kus5Oi+BhxcHPHZq+ui0X3k+iIzJZ/OTSBuEuC YjZDR1gOqqmeGJ1t9aUnVOKY+ONZ5kB0BbefB33M7DiS+EB7Q+ToOcRUYB3Uw7ghENmn DOrHjBSTBstLOE5yvYZfhE9xSlzfDuzrLVB4XWiMVOje66oEroh+rlyrYJ7jQv+BAQgP Ed0H2jB9axXGQ3sxhmsXaFwsXRVLVpPh7Z+rvpwaPe1gRPW4BzOLhROQqu9qe5nfnWeZ BWKJWoV3GBWC0KNwoZz6r0H7zbKUrLImrDjf1c743G6UUqmNyNzEViXi0KeHwiYzIIuC QbHQ== X-Forwarded-Encrypted: i=1; AFNElJ9Jqg0NsEBOkSgxduLNHygGYIx/wurAAz81cRplgOXr1Sx403ytYK9SLkwfBSLr/eELJY+7Tloy3KnqK7g=@vger.kernel.org X-Gm-Message-State: AOJu0YzvOFGwutjSTQ/IKmeMbkp+dJy5h4AP6TAXvXxYp86Vd5uph4+s dox5CvwkRK3/4qtrbBHMF/bGGktH09QAdfKOihsi2p/nVwSFlEfG4levuQm8WRANi2Zpspl8pTe rLiO/uBMruEzikPgWuc1+qfpClVCq+mfz9ynCfihMf7jflfnGncd0wHo+rOJCqvK6dec= X-Gm-Gg: AeBDieuqk6QfOD/z2XyifmkOnqJXkbmsdN1FzdfGRaQNfDeLFdsz+3Va2YbKHL5aCvh /1GpZSdjhnEbaq5kZq1opfjGgKhELjRp55eHVK4FDYIdBpDAH3HcF+pHws0KpTP4JkLSYby15B1 puIBre/vltvP3c/xooXiHjOa1r/IEiqs91jUIbiruQDSLb5LRGhVjeWHPBuUGG9Lc2yTdWhroKK /f0CgzkSuVyF1UFiz7t0v36uA+9agTk3XKCsIfU6Kxk+I7gv2Eu/UT+kfa7l5VL4Wo5VKxHmMdm EwvlzGWcamJlA+hiR67DoWJpsSvD/jXCeKeujsCZlGVDkixbFKa2/+xTg3Be0sj8T5x8kLEg52y TSSAsEOJnWxDLXMCP0U+teOWYgTXYy0PLtuV0AJcvuKC4rTDjEdN26vZDeqLuwZndAwTAEQw2aF JbgWKkBiNkTg== X-Received: by 2002:a17:903:1b6c:b0:2ae:c5fc:b2ea with SMTP id d9443c01a7336-2b2d5a387d0mr115078385ad.30.1776049120772; Sun, 12 Apr 2026 19:58:40 -0700 (PDT) X-Received: by 2002:a17:903:1b6c:b0:2ae:c5fc:b2ea with SMTP id d9443c01a7336-2b2d5a387d0mr115078205ad.30.1776049120211; Sun, 12 Apr 2026 19:58:40 -0700 (PDT) Received: from [10.133.33.35] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4ddb742sm100231215ad.27.2026.04.12.19.58.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Apr 2026 19:58:39 -0700 (PDT) Message-ID: <6ed0ee60-caa2-4a76-9e01-5d2b8c9af701@oss.qualcomm.com> Date: Mon, 13 Apr 2026 10:58:35 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/5] coresight: etm4x: introduce struct etm4_caps To: Yeoreum Yun , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: suzuki.poulose@arm.com, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com, leo.yan@arm.com References: <20260412175506.412301-1-yeoreum.yun@arm.com> <20260412175506.412301-2-yeoreum.yun@arm.com> Content-Language: en-US From: Jie Gan In-Reply-To: <20260412175506.412301-2-yeoreum.yun@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: aNzP-uGF3uX3CglzruPDtLIGTMbsodSm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDEzMDAyNCBTYWx0ZWRfX/OV+8ZuZ4htQ Co0O7bCP8C2QYOdn6ZdEoPzlhRO9n663oKTw7xEU4H8yX8L1FObYeZe453JViu58hIps/PYZrwH JwZDGJU9pllAS9sBlGVAlLLShYjiAKjeGm5g8UKVB7o5nyhAcaNFBQ4dVt8PZjFW3shSOpuaR+i RuJAnOqGqMguMHUripkmxAyg4D6F4KpuhwaJ22CaKvqcTUyVY9VEIqFfmm4wKKiUYnB0lZJqLl1 EwMgVL4isPafxjujFHJ96okxzPcxRCauXXtJgQzd1L3j0hLLuS9BIBuccLxIu1T83e3ewsFWGeh sJi+hSvC1IOF7keFmkmLGHL9Kp79OrG9hv5Sx4CnbV8HceOh1dEYsSnXIM6ObVeV3JiuuCKvDUR LFvyCBuZBScFWB0a48xdCtHtpvAKU4oPRPXOwJsudH8QgKdyDgRaPdRrzATOQuALFXnltNX64Iu ypbm/XBmBf1qffbIwAg== X-Authority-Analysis: v=2.4 cv=FPQrAeos c=1 sm=1 tr=0 ts=69dc5be1 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=7CQSdrXTAAAA:8 a=s9qJF0ULUEalZJ-qjl0A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-ORIG-GUID: aNzP-uGF3uX3CglzruPDtLIGTMbsodSm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-13_01,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604130024 Hi Yeoreum, On 4/13/2026 1:55 AM, Yeoreum Yun wrote: > introduce struct etm4_caps to describe ETMv4 capabilities > and move capabilities information into it. > > Signed-off-by: Yeoreum Yun > --- > .../coresight/coresight-etm4x-core.c | 234 +++++++++--------- > .../coresight/coresight-etm4x-sysfs.c | 190 ++++++++------ > drivers/hwtracing/coresight/coresight-etm4x.h | 175 ++++++------- > 3 files changed, 327 insertions(+), 272 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index d565a73f0042..6443f3717b37 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c <...> > +/** > + * struct etmv4_caps - specifics ETM capabilities > + * @nr_pe: The number of processing entity available for tracing. > + * @nr_pe_cmp: The number of processing entity comparator inputs that are > + * available for tracing. > + * @nr_addr_cmp:Number of pairs of address comparators available > + * as found in ETMIDR4 0-3. > + * @nr_cntr: Number of counters as found in ETMIDR5 bit 28-30. > + * @nr_ext_inp: Number of external input. > + * @numcidc: Number of contextID comparators. @numextinsel: > + * @numvmidc: Number of VMID comparators. > + * @nrseqstate: The number of sequencer states that are implemented. > + * @nr_event: Indicates how many events the trace unit support. > + * @nr_resource:The number of resource selection pairs available for tracing. > + * @nr_ss_cmp: Number of single-shot comparator controls that are available. > + * @trcid_size: Indicates the trace ID width. > + * @ts_size: Global timestamp size field. > + * @ctxid_size: Size of the context ID field to consider. > + * @vmid_size: Size of the VM ID comparator to consider. > + * @ccsize: Indicates the size of the cycle counter in bits. > + * @ccitmin: minimum value that can be programmed in > + * @s_ex_level: In secure state, indicates whether instruction tracing is > + * supported for the corresponding Exception level. > + * @ns_ex_level:In non-secure state, indicates whether instruction tracing is > + * supported for the corresponding Exception level. > + * @q_support: Q element support characteristics. > + * @os_lock_model: OSLock model. > + * @instrp0: Tracing of load and store instructions > + * as P0 elements is supported. > + * @q_filt: Q element filtering support, if Q elements are supported. > + * @trcbb: Indicates if the trace unit supports branch broadcast tracing. > + * @trccond: If the trace unit supports conditional > + * instruction tracing. > + * @retstack: Indicates if the implementation supports a return stack. > + * @trccci: Indicates if the trace unit supports cycle counting > + * for instruction. > + * @trc_error: Whether a trace unit can trace a system > + * error exception. > + * @syncpr: Indicates if an implementation has a fixed > + * synchronization period. > + * @stallctl: If functionality that prevents trace unit buffer overflows > + * is available. > + * @sysstall: Does the system support stall control of the PE? > + * @nooverflow: Indicate if overflow prevention is supported. > + * @atbtrig: If the implementation can support ATB triggers > + * @lpoverride: If the implementation can support low-power state over. > + * @skip_power_up: Indicates if an implementation can skip powering up > + * the trace unit. > + */ > +struct etmv4_caps { > + u8 nr_pe; > + u8 nr_pe_cmp; > + u8 nr_addr_cmp; > + u8 nr_cntr; > + u8 nr_ext_inp; > + u8 numcidc; > + u8 numextinsel; missed kernel_doc. Thanks, Jie > + u8 numvmidc; > + u8 nrseqstate; > + u8 nr_event; > + u8 nr_resource; > + u8 nr_ss_cmp; > + u8 trcid_size; > + u8 ts_size; > + u8 ctxid_size; > + u8 vmid_size; > + u8 ccsize; > + u16 ccitmin; > + u8 s_ex_level; > + u8 ns_ex_level; > + u8 q_support; > + u8 os_lock_model; > + bool instrp0 : 1; > + bool q_filt : 1; > + bool trcbb : 1; > + bool trccond : 1; > + bool retstack : 1; > + bool trccci : 1; > + bool trc_error : 1; > + bool syncpr : 1; > + bool stallctl : 1; > + bool sysstall : 1; > + bool nooverflow : 1; > + bool atbtrig : 1; > + bool lpoverride : 1; > + bool skip_power_up : 1; > +}; > + > /** > * struct etmv4_config - configuration information related to an ETMv4 > * @mode: Controls various modes supported by this ETM. > @@ -819,8 +907,8 @@ enum etm_impdef_type { > * @cfg: Controls the tracing options. > * @eventctrl0: Controls the tracing of arbitrary events. > * @eventctrl1: Controls the behavior of the events that @event_ctrl0 selects. > - * @stallctl: If functionality that prevents trace unit buffer overflows > - * is available. > + * @stall_ctrl: Enables trace unit functionality that prevents trace > + * unit buffer overflows. > * @ts_ctrl: Controls the insertion of global timestamps in the > * trace streams. > * @syncfreq: Controls how often trace synchronization requests occur. > @@ -971,61 +1059,17 @@ struct etmv4_save_state { > * @mode: This tracer's mode, i.e sysFS, Perf or disabled. > * @cpu: The cpu this component is affined to. > * @arch: ETM architecture version. > - * @nr_pe: The number of processing entity available for tracing. > - * @nr_pe_cmp: The number of processing entity comparator inputs that are > - * available for tracing. > - * @nr_addr_cmp:Number of pairs of address comparators available > - * as found in ETMIDR4 0-3. > - * @nr_cntr: Number of counters as found in ETMIDR5 bit 28-30. > - * @nr_ext_inp: Number of external input. > - * @numcidc: Number of contextID comparators. > - * @numvmidc: Number of VMID comparators. > - * @nrseqstate: The number of sequencer states that are implemented. > - * @nr_event: Indicates how many events the trace unit support. > - * @nr_resource:The number of resource selection pairs available for tracing. > - * @nr_ss_cmp: Number of single-shot comparator controls that are available. > + * @caps: ETM capabilities. > * @trcid: value of the current ID for this component. > - * @trcid_size: Indicates the trace ID width. > - * @ts_size: Global timestamp size field. > - * @ctxid_size: Size of the context ID field to consider. > - * @vmid_size: Size of the VM ID comparator to consider. > - * @ccsize: Indicates the size of the cycle counter in bits. > - * @ccitmin: minimum value that can be programmed in > - * @s_ex_level: In secure state, indicates whether instruction tracing is > - * supported for the corresponding Exception level. > - * @ns_ex_level:In non-secure state, indicates whether instruction tracing is > - * supported for the corresponding Exception level. > * @sticky_enable: true if ETM base configuration has been done. > * @boot_enable:True if we should start tracing at boot time. > * @os_unlock: True if access to management registers is allowed. > - * @instrp0: Tracing of load and store instructions > - * as P0 elements is supported. > - * @q_filt: Q element filtering support, if Q elements are supported. > - * @trcbb: Indicates if the trace unit supports branch broadcast tracing. > - * @trccond: If the trace unit supports conditional > - * instruction tracing. > - * @retstack: Indicates if the implementation supports a return stack. > - * @trccci: Indicates if the trace unit supports cycle counting > - * for instruction. > - * @q_support: Q element support characteristics. > - * @trc_error: Whether a trace unit can trace a system > - * error exception. > - * @syncpr: Indicates if an implementation has a fixed > - * synchronization period. > - * @stall_ctrl: Enables trace unit functionality that prevents trace > - * unit buffer overflows. > - * @sysstall: Does the system support stall control of the PE? > - * @nooverflow: Indicate if overflow prevention is supported. > - * @atbtrig: If the implementation can support ATB triggers > - * @lpoverride: If the implementation can support low-power state over. > * @trfcr: If the CPU supports FEAT_TRF, value of the TRFCR_ELx that > * allows tracing at all ELs. We don't want to compute this > * at runtime, due to the additional setting of TRFCR_CX when > * in EL2. Otherwise, 0. > * @config: structure holding configuration parameters. > * @save_state: State to be preserved across power loss > - * @skip_power_up: Indicates if an implementation can skip powering up > - * the trace unit. > * @paused: Indicates if the trace unit is paused. > * @arch_features: Bitmap of arch features of etmv4 devices. > */ > @@ -1037,46 +1081,11 @@ struct etmv4_drvdata { > raw_spinlock_t spinlock; > int cpu; > u8 arch; > - u8 nr_pe; > - u8 nr_pe_cmp; > - u8 nr_addr_cmp; > - u8 nr_cntr; > - u8 nr_ext_inp; > - u8 numcidc; > - u8 numextinsel; > - u8 numvmidc; > - u8 nrseqstate; > - u8 nr_event; > - u8 nr_resource; > - u8 nr_ss_cmp; > + struct etmv4_caps caps; > u8 trcid; > - u8 trcid_size; > - u8 ts_size; > - u8 ctxid_size; > - u8 vmid_size; > - u8 ccsize; > - u16 ccitmin; > - u8 s_ex_level; > - u8 ns_ex_level; > - u8 q_support; > - u8 os_lock_model; > bool sticky_enable : 1; > bool boot_enable : 1; > bool os_unlock : 1; > - bool instrp0 : 1; > - bool q_filt : 1; > - bool trcbb : 1; > - bool trccond : 1; > - bool retstack : 1; > - bool trccci : 1; > - bool trc_error : 1; > - bool syncpr : 1; > - bool stallctl : 1; > - bool sysstall : 1; > - bool nooverflow : 1; > - bool atbtrig : 1; > - bool lpoverride : 1; > - bool skip_power_up : 1; > bool paused : 1; > u64 trfcr; > struct etmv4_config config;