public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Holland <samuel.holland@sifive.com>
To: Conor Dooley <conor@kernel.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Rob Herring <robh@kernel.org>, Alex Elder <elder@riscstar.com>,
	Guodong Xu <guodong@riscstar.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>, Yixun Lan <dlan@gentoo.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Anup Patel <anup@brainfault.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Lubomir Rintel <lkundrak@v3.sk>, Yangyu Chen <cyy@cyyself.name>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Kevin Meng Zhang <zhangmeng.kevin@linux.spacemit.com>,
	Andrew Jones <ajones@ventanamicro.com>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, spacemit@lists.linux.dev,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Date: Thu, 8 Jan 2026 13:45:52 -0600	[thread overview]
Message-ID: <4ebbe14b-2579-4ba6-808d-d50c24641d04@sifive.com> (raw)
In-Reply-To: <20251231-grew-abrasion-dc1a9d34e632@spud>

Hi all,

(Also replied to the v1 thread:
https://lore.kernel.org/linux-riscv/9504b2f6-12f5-46c2-ac74-826dba3fb530@sifive.com/)

On 2025-12-31 6:08 PM, Conor Dooley wrote:
>> Should supm be handled in the same way? Add it to the device-tree of
>> RVA23U64 devices. If a kernel does not support pointer masking in user
>> space, hide the extension in cpufeature.c.
> 
> Perhaps.
> Samuel opted not to add supm to dt when he introduced the other relevant
> extensions, so the rationale from him would be helpful but I'd like to
> get more opinions on how to deal with supm specifically. supm doesn't
> really describe hardware capability, since the privilege specific
> instructions are what does that, which makes me question if it should be
> in dt at all. On the other hand, it could be argued that supm describes
> a combination of hardware capability at the dt consumer's privilege level
> and is valid on that basis. Some wording like Zkr will probably be needed,
> specifically mentioning that having supm in the dt means that corresponding
> version sxnpm for the privilege level that the devicetree is provided to
> is supported.

Supm describes a combination of the hardware capability (Smnpm or Ssnpm), the
consumer's privilege level (U), and the software at the next higher privilege
level (M or S).

If the DT is targeting U-mode, then I can see a case for adding Supm to the DT
either at runtime or based on the known capabilities of the
next-higher-privilege-mode software. So it could make sense to add a binding for
Supm. But we still shouldn't add Supm to this particular DT, because 1) this DT
is not targeting U-mode, and 2) this DT is not bound to a particular version of
S-mode software.

> Either way, we are going to need something in cpufeature.c to imply
> supm so that it appears to userspace if the privilege specific extension
> is detected and supm is enabled in the kernel. The kernel already does
> the implication internally it just isn't reported as an extension to
> userspace IIRC.
> If we permit supm in dt, we're also going to have to turn supm off if
> the Kconfig option is disabled, but that's relatively little effort
> since it mostly (or maybe entirely) reuses code from implying supm.

It's currently exposed to hwprobe() but not in /proc/cpuinfo. This was based on
my understanding that hwprobe() was the right way to check for availability of
extensions. I'm okay with adding it to /proc/cpuinfo if there's value in doing
so, but I would recommend that the extension in cpufeature.c is _not_ parsed
from the DT and only enabled synthetically.

Regards,
Samuel


  reply	other threads:[~2026-01-08 19:45 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 13:04 [PATCH v2 00/13] riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board Guodong Xu
2025-12-22 13:04 ` [PATCH v2 01/13] dt-bindings: riscv: add SpacemiT X100 CPU compatible Guodong Xu
2025-12-23 13:48   ` Krzysztof Kozlowski
2025-12-22 13:04 ` [PATCH v2 02/13] dt-bindings: timer: add SpacemiT K3 CLINT Guodong Xu
2025-12-22 13:04 ` [PATCH v2 03/13] dt-bindings: interrupt-controller: add SpacemiT K3 APLIC Guodong Xu
2025-12-22 13:04 ` [PATCH v2 04/13] dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC Guodong Xu
2025-12-23 13:47   ` Krzysztof Kozlowski
2025-12-22 13:04 ` [PATCH v2 05/13] dt-bindings: serial: 8250: add SpacemiT K3 UART compatible Guodong Xu
2025-12-22 13:04 ` [PATCH v2 06/13] dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings Guodong Xu
2025-12-22 13:04 ` [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description Guodong Xu
2025-12-22 21:17   ` Conor Dooley
2025-12-23  6:51     ` Guodong Xu
2025-12-24 23:53       ` Conor Dooley
2025-12-26 21:28       ` Alex Elder
2025-12-28  2:51         ` Guodong Xu
2025-12-28 23:50           ` Alex Elder
2025-12-29  1:08             ` Guodong Xu
2025-12-29  1:26               ` Alex Elder
2025-12-30 17:09         ` Conor Dooley
2025-12-30 17:29           ` Alex Elder
2025-12-30 17:46             ` Conor Dooley
2025-12-30 18:06               ` Alex Elder
2025-12-30 19:21                 ` Conor Dooley
2025-12-22 13:04 ` [PATCH v2 08/13] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm Guodong Xu
2025-12-26 21:28   ` Alex Elder
2025-12-28  4:10     ` Guodong Xu
2025-12-28 23:50       ` Alex Elder
2025-12-30  0:56         ` Guodong Xu
2025-12-22 13:04 ` [PATCH v2 09/13] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl Guodong Xu
2025-12-26 21:28   ` Alex Elder
2025-12-28 12:31     ` Guodong Xu
2025-12-28 23:50       ` Alex Elder
2025-12-22 13:04 ` [PATCH v2 10/13] dt-bindings: riscv: Add Sha and its comprised extensions Guodong Xu
2025-12-26 21:28   ` Alex Elder
2025-12-28 12:43     ` Guodong Xu
2025-12-28 23:50       ` Alex Elder
2025-12-22 13:04 ` [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description Guodong Xu
2025-12-22 20:57   ` Conor Dooley
2025-12-26 21:28   ` Alex Elder
2025-12-30  2:13     ` Rob Herring
2025-12-30  3:14       ` Alex Elder
2025-12-30 15:21         ` Rob Herring
2025-12-30 17:37           ` Conor Dooley
2025-12-30 20:41             ` Heinrich Schuchardt
2026-01-01  0:08               ` Conor Dooley
2026-01-08 19:45                 ` Samuel Holland [this message]
2025-12-30 18:01           ` Alex Elder
2025-12-30 17:22       ` Conor Dooley
2025-12-30 18:06         ` Alex Elder
2025-12-22 13:04 ` [PATCH v2 12/13] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC Guodong Xu
2025-12-22 13:04 ` [PATCH v2 13/13] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree 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=4ebbe14b-2579-4ba6-808d-d50c24641d04@sifive.com \
    --to=samuel.holland@sifive.com \
    --cc=ajones@ventanamicro.com \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=cyy@cyyself.name \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=elder@riscstar.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guodong@riscstar.com \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=xypron.glpk@gmx.de \
    --cc=zhangmeng.kevin@linux.spacemit.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