All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Guodong Xu" <guodong.xu@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v6 09/11] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection
Date: Wed, 12 Aug 2026 23:52:45 +0000	[thread overview]
Message-ID: <20260812235246.4FC211F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260812-rva23u64-hwprobe-v2-v6-9-c985af3256b8@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] RVA23U64 detection relies on the non-standard `RISCV_ISA_EXT_B` pseudo-extension instead of the mandated `Zba`, `Zbb`, and `Zbs` sub-extensions, causing conformant hardware to fail detection.
--

--- Patch [9]: [PATCH v6 09/11] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection ---
commit 96d9cbf0b8923400be62f448ef68daf8ad09dfb6
Author: Guodong Xu <guodong.xu@oss.qualcomm.com>

riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection

This commit introduces a per-hart and host-wide bitmap for ISA bases, such
as IMA and RVA23U64, computed during subsystem init. It provides a cached
detection mechanism to ensure system-wide consistency for subsequent
consumers like hwprobe and /proc/cpuinfo.

> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index de7cff5f48c34..2ad8a16a0eff3 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c

[ ... ]

> @@ -1334,3 +1337,90 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin,
> +static void riscv_set_isa_bases(unsigned long *bases, const unsigned long *isa_bitmap)
> +{
> +	const unsigned long *isa = isa_bitmap ? isa_bitmap : riscv_isa;
> +	DECLARE_BITMAP(ext_mask, RISCV_ISA_EXT_MAX) = { 0 };

[ ... ]

> +	/* RVA23U64 */
> +
> +	/* Supm with PMLEN=7 */
> +	if (!riscv_have_user_pmlen(7))
> +		return;
> +
> +	__set_bit(RISCV_ISA_EXT_F, ext_mask);
> +	__set_bit(RISCV_ISA_EXT_D, ext_mask);
> +	__set_bit(RISCV_ISA_EXT_C, ext_mask);
> +	__set_bit(RISCV_ISA_EXT_B, ext_mask);

[Severity: High]
Does this cause conformant hardware to fail detection?

The RVA23U64 profile mandates the individual bit-manipulation extensions
Zba, Zbb, and Zbs. If a device tree explicitly lists these standard
extensions in riscv,isa-extensions without the unratified B pseudo-extension,
the device tree parser will set the individual extension bits but not
RISCV_ISA_EXT_B.

Since this mandate mask checks for the B pseudo-extension, bitmap_subset()
will fail for conformant hardware, breaking any system or userspace behavior
relying on this hwprobe base detection.

Should this check for RISCV_ISA_EXT_ZBA, RISCV_ISA_EXT_ZBB, and
RISCV_ISA_EXT_ZBS instead?

> +	__set_bit(RISCV_ISA_EXT_ZICSR, ext_mask);

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-rva23u64-hwprobe-v2-v6-0-c985af3256b8@oss.qualcomm.com?part=9

  reply	other threads:[~2026-08-12 23:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 23:33 [PATCH v6 00/11] riscv: hwprobe: Expose RVA23U64 base behavior Guodong Xu
2026-08-12 23:33 ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 01/11] riscv: Add B to hwcap and hwprobe Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 02/11] dt-bindings: riscv: Require block-size for Zicbom, Zicbop, and Zicboz Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 03/11] dt-bindings: riscv: Add Zic64b extension description Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 04/11] riscv: Add Zic64b to cpufeature and hwprobe Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 05/11] riscv: dts: spacemit: k3: Add Zic64b ISA extension Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 06/11] riscv: dts: spacemit: k1: " Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 07/11] riscv: dts: sophgo: sg2044: " Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 08/11] riscv: Add a getter for user PMLEN support Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 09/11] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:52   ` sashiko-bot [this message]
2026-08-12 23:33 ` [PATCH v6 10/11] riscv: cpu: Output isa bases lines in cpuinfo Guodong Xu
2026-08-12 23:33   ` Guodong Xu
2026-08-12 23:33 ` [PATCH v6 11/11] riscv: hwprobe: Introduce rva23u64 base behavior Guodong Xu
2026-08-12 23:33   ` Guodong Xu

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=20260812235246.4FC211F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guodong.xu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.