Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vikram Singh" <vikram.singh3@oss.qualcomm.com>
Cc: linux-perf-users@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 3/7] riscv: Add Control Transfer Records extension parsing
Date: Wed, 18 Nov 2026 10:02:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-220651@kernel.org> (raw)
In-Reply-To: <20261118095053.3871267-4-vikram.singh3@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] riscv: unused RISCV_ISA_EXT_SSPESA and RISCV_ISA_EXT_SSPLCOFI in
  hwcap.h
- [Low] riscv: non-canonical ordering of smctr and ssctr in
  riscv_isa_ext[]
--

commit 4ae624ba46f94bfad975e230dbad25a6ad5f53d0
Author: Vikram Singh <vikram.singh3@oss.qualcomm.com>

riscv: Add Control Transfer Records extension parsing

This commit adds ISA extension definitions and parsing entries for the
Smctr and Ssctr Control Transfer Records extensions.

Link: https://lore.kernel.org/r/20261106173942.3175069-4-vikram.singh3@oss.qualcomm.com

> diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
> index b5952db9259f8..ee200d8cfccbb 100644
> --- a/arch/riscv/include/asm/hwcap.h
> +++ b/arch/riscv/include/asm/hwcap.h
> @@ -126,6 +126,10 @@
>  #define RISCV_ISA_EXT_ZIC64B		116
>  #define RISCV_ISA_EXT_SV48		117
>  #define RISCV_ISA_EXT_SV57		118
> +#define RISCV_ISA_EXT_SSPESA		119
> +#define RISCV_ISA_EXT_SSPLCOFI		120
> +#define RISCV_ISA_EXT_SMCTR		121
> +#define RISCV_ISA_EXT_SSCTR		122

[Severity: Low]
Are RISCV_ISA_EXT_SSPESA and RISCV_ISA_EXT_SSPLCOFI left over from
another change?  Neither has a corresponding entry in riscv_isa_ext[] or
any reference in the tree, so bits 119 and 120 can never be set and use
up two of the remaining IDs below RISCV_ISA_EXT_MAX (128).

[ ... ]

> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index 72bce616491f1..b3e3c30f4c8bf 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -652,6 +652,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
>  	__RISCV_ISA_EXT_DATA(smmpm, RISCV_ISA_EXT_SMMPM),
>  	__RISCV_ISA_EXT_SUPERSET(smnpm, RISCV_ISA_EXT_SMNPM, riscv_xlinuxenvcfg_exts),
>  	__RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN),
> +	__RISCV_ISA_EXT_DATA(smctr, RISCV_ISA_EXT_SMCTR),
>  	__RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA),
>  	__RISCV_ISA_EXT_DATA_VALIDATE(ssccfg, RISCV_ISA_EXT_SSCCFG, riscv_ext_ssccfg_validate),
>  	__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),
> @@ -659,6 +660,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
>  	__RISCV_ISA_EXT_SUPERSET(ssnpm, RISCV_ISA_EXT_SSNPM, riscv_xlinuxenvcfg_exts),
>  	__RISCV_ISA_EXT_DATA(ssqosid, RISCV_ISA_EXT_SSQOSID),
>  	__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),
> +	__RISCV_ISA_EXT_DATA(ssctr, RISCV_ISA_EXT_SSCTR),
>  	__RISCV_ISA_EXT_DATA(svade, RISCV_ISA_EXT_SVADE),

[Severity: Low]
Should smctr and ssctr be placed in alphabetical order (after smcsrind
and sscsrind, respectively)?  print_isa() walks riscv_isa_ext[] in array
order to format /proc/cpuinfo, which expects machine-level and
supervisor-level extensions to be sorted alphabetically for canonical ISA
strings.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118095053.3871267-1-vikram.singh3@oss.qualcomm.com?part=3

  reply	other threads:[~2026-11-18 10:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  9:50 [PATCH v5 0/7] riscv: pmu: Add support for Control Transfer Records Ext Vikram Singh
2026-11-18  9:50 ` [PATCH v5 1/7] perf: Increase the maximum number of branches remove_loops() can process Vikram Singh
2026-11-18  9:58   ` sashiko-bot
2026-11-18  9:50 ` [PATCH v5 2/7] riscv: pmu: Add Control transfer records CSR definations Vikram Singh
2026-11-18 10:00   ` sashiko-bot
2026-11-18  9:50 ` [PATCH v5 3/7] riscv: Add Control Transfer Records extension parsing Vikram Singh
2026-11-18 10:02   ` sashiko-bot [this message]
2026-11-18  9:50 ` [PATCH v5 4/7] riscv: pmu: Add infrastructure for Control Transfer Record Vikram Singh
2026-11-18 10:09   ` sashiko-bot
2026-11-18  9:50 ` [PATCH v5 5/7] riscv: pmu: Add driver for Control Transfer Records Ext Vikram Singh
2026-11-18  9:50 ` [PATCH v5 6/7] riscv: pmu: Integrate CTR Ext support in riscv_pmu_dev driver Vikram Singh
2026-11-18  9:50 ` [PATCH v5 7/7] dt-bindings: riscv: add Sxctr ISA extension description Vikram Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-220651@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vikram.singh3@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox