mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Radim Krčmář" <radim.krcmar@oss.qualcomm.com>
To: "Guodong Xu" <guodong.xu@oss.qualcomm.com>
Cc: <linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Samuel Holland" <samuel.holland@sifive.com>,
	"Andy Chiu" <andybnac@gmail.com>, "Zong Li" <zong.li@sifive.com>,
	"Charlie Jenkins" <thecharlesjenkins@gmail.com>
Subject: Re: [PATCH 4/6] riscv: hwprobe: Report Supm only when available
Date: Mon, 09 Nov 2026 14:41:55 +0100	[thread overview]
Message-ID: <DMQQ2772H45H.16UW0C0P9NCTN@oss.qualcomm.com> (raw)
In-Reply-To: <4879567e977e3f5023c6e7ddca133b1a.guodong.xu@oss.qualcomm.com>

2026-11-08T06:24:53-05:00, Guodong Xu <guodong.xu@oss.qualcomm.com>:
> Hi Radim,
>
> On Tue, 6 Oct 2026 09:53:01 +0200, Radim Krcmar wrote:
>> The RISC-V ISA defines Supm as
>>
>>   "An extension that indicates that there is pointer-masking support
>>   available in user mode, with some facility provided in the application
>>   execution environment to control pointer masking."
>>
>> Our facility always returns -EINVAL unless Supm support is configured,
>> the pointer masking ISA extension is globally present, and the user-mode
>> is running in 64-bit mode.
>>
>> Hiding Supm in compat tasks would add complexity that doesn't seem
>> justified as 32-bit code has no reason to look at Supm anyway.
>> Reporting based on the a global sysctl toggle isn't done.
>>
>> Do not report Supm when some harts lack the extension, because it's not
>> available on any hart in that case.
>>
>> (Reporting Supm when only PMLEN=0 is supported isn't great, but doesn't
>>  violate the text of the extension and we ought to have Supm7 and Supm16
>>  extensions if we care about precision.)
>
> Since the kernel already knows whether that is the case, could this
> block use riscv_have_user_pmlen() instead (55458c7347a3 "riscv: Add a
> getter for user PMLEN support")? It exposes the have_user_pmlen_* flags
> that set_tagged_addr_ctrl() consults, so hwprobe would report Supm only
> when the prctl can actually enable a non-zero PMLEN:
>
> 	/* PMM=0 is "disabled"; Supm is usable only with a non-zero PMLEN. */
> 	if (riscv_have_user_pmlen(7) || riscv_have_user_pmlen(16))
> 		pair->value |= RISCV_HWPROBE_EXT_SUPM;

I'll use that in v2, thanks.

  reply	other threads:[~2026-11-09 13:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  7:52 [PATCH 0/6] riscv: hwprobe: do not report disabled extensions Radim Krčmář
2026-10-06  7:52 ` [PATCH 1/6] riscv: hwprobe: Report FP extensions only when available Radim Krčmář
2026-10-06 23:54   ` Charlie Jenkins
2026-10-07  7:46     ` Radim Krčmář
2026-10-07  8:05       ` Charlie Jenkins
2026-11-08  4:16       ` guodong.xu
2026-11-09 13:40         ` Radim Krčmář
2026-10-16 21:04   ` Andy Chiu
2026-10-06  7:52 ` [PATCH 2/6] riscv: hwprobe: Report Zicbom and Zicboz " Radim Krčmář
2026-10-16  4:28   ` Charlie Jenkins
2026-10-16 21:06   ` Andy Chiu
2026-11-08 10:45   ` Guodong Xu
2026-10-06  7:53 ` [PATCH 3/6] riscv: hwprobe: Report Zicfilp and Zicfiss " Radim Krčmář
2026-10-16  4:28   ` Charlie Jenkins
2026-10-16 21:09   ` Andy Chiu
2026-11-08 10:05   ` Guodong Xu
2026-10-06  7:53 ` [PATCH 4/6] riscv: hwprobe: Report Supm " Radim Krčmář
2026-10-16  4:28   ` Charlie Jenkins
2026-10-16 21:26   ` Andy Chiu
2026-10-16 21:45     ` Andy Chiu
2026-10-20 10:00       ` Radim Krčmář
2026-11-08 11:24   ` [PATCH 4/6] " Guodong Xu
2026-11-09 13:41     ` Radim Krčmář [this message]
2026-10-06  7:53 ` [PATCH 5/6] riscv: hwprobe: Report XTheadVector " Radim Krčmář
2026-10-06 23:54   ` Charlie Jenkins
2026-10-07  7:59     ` Radim Krčmář
2026-10-07  8:07       ` Charlie Jenkins
2026-11-08 14:00         ` Guodong Xu
2026-10-16 21:48   ` Andy Chiu
2026-10-06  7:53 ` [PATCH 6/6] riscv: hwprobe: Report SiFive vector extensions " Radim Krčmář
2026-10-16 21:55   ` Andy Chiu

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=DMQQ2772H45H.16UW0C0P9NCTN@oss.qualcomm.com \
    --to=radim.krcmar@oss.qualcomm.com \
    --cc=alex@ghiti.fr \
    --cc=andybnac@gmail.com \
    --cc=guodong.xu@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=thecharlesjenkins@gmail.com \
    --cc=zong.li@sifive.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

all inboxes | Powered by JetHome®