public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: andy.chiu@sifive.com, Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH -next v20 20/26] riscv: Add prctl controls for userspace vector management
Date: Wed, 24 May 2023 19:13:10 +0300	[thread overview]
Message-ID: <2621691.14T4csFsIl@basile.remlab.net> (raw)
In-Reply-To: <mhng-52f8af07-f3fc-4674-94ea-abbe2108907a@palmer-ri-x1c9a>

Le keskiviikkona 24. toukokuuta 2023, 3.18.26 EEST Palmer Dabbelt a écrit :
> > I don't think the value of an auxillary vector entry can change in an
> > existing process nor that we need that. If an application starts with V
> > disabled, you can keep the V bit clear even if V gets enabled later on;
> > that won't break existing userspace code, which simply won't use vectors.
> > 
> > What does break existing userspace is setting the V bit whilst vectors are
> > disabled.
> So maybe the right answer is to just not set V at all?

That is one possibility that I can live, although it feels unnecessarily user-
hostile compared to setting it only if the process _started_ with V enabled.

> The
> single-letter extensions are sort of defunct now, there's multi-letter
> sub extensions for most things, but V got ratified with those
> sub-extensions so we could just call it extra-ambiguous?

Maybe; I must admit I have zero visibility to RVI inner workings. At least C, 
D and F bits could work for JIT use cases, I suppose. E and M are totally 
impractical to support. G, I, X and Z cannot are already wasted by the design, 
and I guess we will now waste all 16 others.

But as for V, what is the user-space story for the prctl()? Who is intended to 
enablet V mode? If there is no clear story, it is all but guaranteed that 
random libraries will call it, and just _blindly_ assume that there is enough 
stack space for signal handling. If so, then there is not much point having a 
prctl() in the first place; might as well stick to just a kernel Kconfig with no 
runtime configuration.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




      parent reply	other threads:[~2023-05-24 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230518161949.11203-1-andy.chiu@sifive.com>
     [not found] ` <20230518161949.11203-25-andy.chiu@sifive.com>
2023-05-21  5:20   ` [PATCH -next v20 24/26] riscv: Add documentation for Vector Rémi Denis-Courmont
     [not found] ` <20230518161949.11203-21-andy.chiu@sifive.com>
2023-05-21  5:38   ` [PATCH -next v20 20/26] riscv: Add prctl controls for userspace vector management Rémi Denis-Courmont
2023-05-22  8:28     ` Andy Chiu
2023-05-22  9:58       ` Rémi Denis-Courmont
2023-05-24  0:18         ` Palmer Dabbelt
2023-05-24  9:25           ` Andy Chiu
2023-05-24 16:16             ` Rémi Denis-Courmont
2023-05-30 14:14               ` Andy Chiu
2023-05-24 16:13           ` Rémi Denis-Courmont [this message]

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=2621691.14T4csFsIl@basile.remlab.net \
    --to=remi@remlab.net \
    --cc=andy.chiu@sifive.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.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