From: "Björn Töpel" <bjorn@kernel.org>
To: Heiko Stuebner <heiko@sntech.de>,
palmer@dabbelt.com, linux-riscv@lists.infradead.org,
paul.walmsley@sifive.com
Cc: heiko@sntech.de, kito.cheng@sifive.com, jrtc27@jrtc27.com,
conor.dooley@microchip.com, matthias.bgg@gmail.com,
heinrich.schuchardt@canonical.com, greentime.hu@sifive.com,
nick.knight@sifive.com, christoph.muellner@vrull.eu,
philipp.tomsich@vrull.eu, richard.henderson@linaro.org,
arnd@arndb.de, linux-kernel@vger.kernel.org,
Heiko Stuebner <heiko.stuebner@vrull.eu>
Subject: Re: [PATCH 0/4] Expose the isa-string via the AT_BASE_PLATFORM aux vector
Date: Mon, 01 May 2023 21:55:10 +0200 [thread overview]
Message-ID: <87ednz7roh.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20230424194911.264850-1-heiko.stuebner@vrull.eu>
Heiko Stuebner <heiko@sntech.de> writes:
> From: Heiko Stuebner <heiko.stuebner@vrull.eu>
>
> The hwprobing infrastructure was merged recently [0] and contains a
> mechanism to probe both extensions but also microarchitecural features
> on a per-core level of detail.
>
> While discussing the solution internally we identified some possible issues,
> tried to understand the underlying issue and come up with a solution for it.
> All these deliberations overlapped with hwprobing being merged, but that
> shouldn't really be an issue, as both have their usability - see below.
> Also please see the "Things to consider" at the bottom!
>
>
> Possible issues:
> - very much limited to Linux
> - schedulers run processes on all cores by default, so will need
> the common set of extensions in most cases
...which hwprobe has support for via the CPU mask. no?
> - each new extensions requires an uapi change, requiring at least
> two pieces of software to be changed
> - adding another extension requires a review process (only known
> extensions can be exposed to user-space)
> - vendor extensions have special needs and therefore possibly
> don’t fit well
>
>
> Limited to Linux:
> -----------------
>
> The syscall and its uapi is Linux-specific and other OSes probably
> will not defer to our review process and requirements just to get
> new bits in. Instead most likely they'll build their own systems,
> leading to fragmentation.
There are a number of examples where multiple OSs have followed what
Linux does, and vice versa. I'd say the opposite -- today system
builders do not do their own solution, but review what's out there and
mimics existing ones.
Personally I think this argument is moot, and will not matter much for
fragmentation.
> Feature on all cores:
> ---------------------
>
> Arnd previously ([1]) commented in the discussion, that there
> should not be a need for optimization towards hardware with an
> asymmetric set of features. We believe so as well, especially
> when talking about an interface that helps processes to identify
> the optimized routines they can execute.
>
> Of course seeing it with this finality might not take into account
> the somewhat special nature of RISC-V, but nevertheless it describes
> the common case for programs very well.
>
> For starters the scheduler in its default behaviour, will try to use any
> available core, so the standard program behaviour will always need the
> intersection of available extensions over all cores.
>
>
> Limiting program execution to specific cores will likely always be a
> special use case and already requires Linux-specific syscalls to
> select the set of cores.
>
> So while it can come in handy to get per-core information down the road
> via the hwprobing interface, most programs will just want to know if
> they can use a extension on just any core.
>
>
> Review process:
> ---------------
>
> There are so many (multi-letter-)extensions already with even more in
> the pipeline. To expose all of them, each will require a review process
> and uapi change that will make defining all of them slow as the
> kernel needs patching after which userspace needs to sync in the new
> api header.
>
>
> Vendor-extensions:
> ------------------
>
> Vendor extensions are special in their own right.
> Userspace probably will want to know about them, but we as the kernel
> don't want to care about them too much (except as errata), as they're
> not part of the official RISC-V ISA spec.
>
> Getting vendor extensions from the dt to userspace via hwprobe would
> require coordination efforts and as vendors have the tendency to invent
> things during their development process before trying to submit changes
> upstream this likely would result in conflicts with assigned ids down
> the road. Which in turn then may create compatibility-issues with
> userspace builds built on top of the mainline kernel or a pre-
> existing vendor kernel.
>
> The special case also is that vendor A could in theory implement an
> extension from vendor B. So this would require to actually assign
> separate hwprobe keys to vendors (key for xthead extensions, key for
> xventana extensions, etc). This in turn would require vendors to
> come to the mainline kernel to get assigned a key (which in reality
> probably won't happen), which would then make the kernel community
> sort of an id authority.
>
>
>
>
> To address these, the attached patch series adds a second interface
> for the common case and "just" exposes the isa-string via the
> AT_BASE_PLATFORM aux vector.
*A second interface* introduced the second hwprobe landed. Really?
Start a discussion on how to extend hwprobe instead.
Björn
next prev parent reply other threads:[~2023-05-01 19:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 19:49 Heiko Stuebner
2023-04-24 19:49 ` [PATCH 1/4] RISC-V: create ISA string separately - not as part of cpuinfo Heiko Stuebner
2023-04-24 23:06 ` kernel test robot
2023-04-25 8:45 ` kernel test robot
2023-04-26 9:26 ` Andrew Jones
2023-04-26 9:44 ` Andrew Jones
2023-05-01 14:52 ` Palmer Dabbelt
2023-04-24 19:49 ` [PATCH 2/4] RISC-V: don't parse dt isa string to get rv32/rv64 Heiko Stuebner
2023-04-26 9:37 ` Andrew Jones
2023-05-01 14:51 ` Palmer Dabbelt
2023-04-24 19:49 ` [PATCH 3/4] RISC-V: export the ISA string of the running machine in the aux vector Heiko Stuebner
2023-04-25 8:13 ` kernel test robot
2023-04-25 8:13 ` kernel test robot
2023-04-26 9:40 ` Andrew Jones
2023-04-24 19:49 ` [PATCH 4/4] RISC-V: add support for vendor-extensions via AT_BASE_PLATFORM and xthead Heiko Stuebner
2023-04-26 9:42 ` Andrew Jones
2023-04-26 12:29 ` Conor Dooley
2023-04-27 17:15 ` Heiko Stübner
2023-04-27 18:28 ` Conor Dooley
2023-04-28 7:53 ` Conor Dooley
2023-04-28 10:28 ` Andrew Jones
2023-04-28 14:25 ` Conor Dooley
2023-04-28 14:57 ` [PATCH 0/4] Expose the isa-string via the AT_BASE_PLATFORM aux vector Palmer Dabbelt
2023-04-28 18:48 ` Christoph Müllner
2023-04-28 18:59 ` Philipp Tomsich
2023-04-28 19:28 ` Palmer Dabbelt
2023-04-28 19:52 ` Palmer Dabbelt
2023-04-30 7:32 ` Shengyu Qu
2023-05-01 19:55 ` Björn Töpel [this message]
2023-05-01 20:08 ` Jessica Clarke
2023-05-02 5:48 ` Björn Töpel
2023-05-02 7:03 ` Philipp Tomsich
2023-05-02 7:58 ` Björn Töpel
2023-05-02 9:13 ` Philipp Tomsich
2023-05-02 10:09 ` Björn Töpel
2023-05-02 17:15 ` Palmer Dabbelt
2023-05-03 10:30 ` Heiko Stübner
2023-05-08 16:49 ` Evan Green
[not found] ` <CAAeLtUDgWwT0wxhFANagBX4ExA_HkyqM-ZdPn==+_atGV3vTww@mail.gmail.com>
2023-05-08 17:34 ` Philipp Tomsich
2023-05-08 17:38 ` Jessica Clarke
2023-05-09 17:23 ` Evan Green
2023-05-02 14:55 ` Palmer Dabbelt
[not found] <CABpcLcSTEegLcbWvs7NCvThvnpo8BQ1Gn9kRdEfe_ZobvYG1jg@mail.gmail.com>
2023-04-28 20:23 ` Palmer Dabbelt
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=87ednz7roh.fsf@all.your.base.are.belong.to.us \
--to=bjorn@kernel.org \
--cc=arnd@arndb.de \
--cc=christoph.muellner@vrull.eu \
--cc=conor.dooley@microchip.com \
--cc=greentime.hu@sifive.com \
--cc=heiko.stuebner@vrull.eu \
--cc=heiko@sntech.de \
--cc=heinrich.schuchardt@canonical.com \
--cc=jrtc27@jrtc27.com \
--cc=kito.cheng@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nick.knight@sifive.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=philipp.tomsich@vrull.eu \
--cc=richard.henderson@linaro.org \
/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®