From: Conor Dooley <conor.dooley@microchip.com>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: "Conor Dooley" <conor@kernel.org>,
"Heiko Stübner" <heiko@sntech.de>,
palmer@dabbelt.com, linux-riscv@lists.infradead.org,
paul.walmsley@sifive.com, kito.cheng@sifive.com,
jrtc27@jrtc27.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
Subject: Re: [PATCH 4/4] RISC-V: add support for vendor-extensions via AT_BASE_PLATFORM and xthead
Date: Fri, 28 Apr 2023 15:25:31 +0100 [thread overview]
Message-ID: <20230428-versus-shady-d20735a19d41@wendy> (raw)
In-Reply-To: <d6lqggv2bbtmv7exalcqqwgbntibdxotsswataxqxhx6kmf4rg@5kgb3axdwgst>
[-- Attachment #1.1: Type: text/plain, Size: 4793 bytes --]
On Fri, Apr 28, 2023 at 12:28:24PM +0200, Andrew Jones wrote:
> On Thu, Apr 27, 2023 at 07:28:49PM +0100, Conor Dooley wrote:
> > On Thu, Apr 27, 2023 at 07:15:58PM +0200, Heiko Stübner wrote:
> > > Am Mittwoch, 26. April 2023, 14:29:16 CEST schrieb Conor Dooley:
> > > > On Mon, Apr 24, 2023 at 09:49:11PM +0200, Heiko Stuebner wrote:
> > > > > From: Heiko Stuebner <heiko.stuebner@vrull.eu>
> ...
> > > > What do you mean by virtualisation here? It's the job of the hypervisor
> > > > etc to make sure that what it passes to its guest contains only what it
> > > > wants the guest to see, right?
> > > > IIUC, that's another point against doing what this patch does.
> > >
> > > I guess I'm still seeing Zbb and friends - with just computational
> > > instructions as always good to have. But I guess you're right that the
> > > hypervisor should be able to control itself which extensions.
> >
> > Yah, there may not be any obvious downsides to something like Zbb, but I
> > think that taking control away from the hypervisors etc isn't a good
> > idea.
>
> If there's any chance that a VM will need to migrate from a host with,
> e.g. Zbb, to one without it, then the VM will need Zbb disabled from the
> start.
(Almost) Everything is obvious to someone :)
> > Having a simple policy of blocking things that are known to misbehave
> > would require less maint. than a list of things that are okay to pass
> > through, but both are probably cans-of-worms.
> > I think we need to think carefully about what policy is chosen here.
> > Allowlist will be slower, but at least we'll not tell userspace
> > something that is not usable. Blocklist will be easier to manage, but
> > can only be reactive.
>
> I have experience [trying] to maintain deny-lists for CPU features,
> both for x86 Xen guests and Arm KVM guests. I don't recommend it. To
> do it right, you need to be proactive, tracking upcoming CPU features
> to add the ones that can't be supported by virt or aren't ready to
> be supported by virt to the deny-list before somebody trips over them.
> In practice, usually somebody trips over it first, causing fires which
> have to be put out. If an allow-list is used, then, when a new feature
> is missed, no fires are started. The worst that can happen is somebody
> expected the feature and didn't see it, so they complain, at which
> point you add it.
Right. Blocking-unless-known is what I suggested when canvassed for an
opinion last week but the complaint was that the kernel having to
maintain a list would be a significant speed-bump for people.
With a lighter-weight method of forwarding to userspace extensions that
the kernel doesn't need to care about (no integration with
.._has_extension[un]likely() etc) hopefully the roadblock would be a
speedbump instead.
I think I would rather speed-bumps & complaints about things being slow,
than having to fight fires.
> > Also, in a world where we do do some sort of passing, should we only
> > forward the vendor extensions, or should we forward the standard ones
> > too?
>
> I guess we need to forward anything userspace can and should use.
That, combined with what we have now, would mean that userspace would
get told both what the kernel supports and additional other things that
the kernel may not support, but userspace can use without that support
being present.
I think that is a reasonable thing to do, although it'd muddy the waters
a bit with what the output in /proc/cpuinfo means. (I'm kinda taking the
particular bit of the series in isolation, as if /proc/cpuinfo is the
only place in which this information will be exposed.)
> > What about supervisor mode only stuff?
>
> That's not something userspace can use. If we want to expose which
> supervisor mode features the CPU has to userspace, for information
> purposes, then I think proc or sysfs would be sufficient for that.
Yeah, as above I'm kinda looking at it from a really naive "only
/proc/cpuinfo exists" point of view for the sake of simplicity.
Depending on implementation, reporting supervisor-only stuff that the
kernel supports may make life easier & there's probably some value to
someone in passing that information to userspace too.
> The downside of using an allow-list for what extensions get exposed
> to userspace is that even extensions the kernel can't/won't use
> will need a kernel patch before userspace can use them. But, as
> I stated above, that downside (people complaining a feature they
> expect is missing), is, IMO, better than the alternative of exposing
> things that shouldn't be.
Yeah, I would be in that camp too, but gotta suggest the various options
for the sake of stirring discussion :)
Thanks,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-04-28 14:26 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 19:49 [PATCH 0/4] Expose the isa-string via the AT_BASE_PLATFORM aux vector 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 [this message]
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
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
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=20230428-versus-shady-d20735a19d41@wendy \
--to=conor.dooley@microchip.com \
--cc=ajones@ventanamicro.com \
--cc=arnd@arndb.de \
--cc=christoph.muellner@vrull.eu \
--cc=conor@kernel.org \
--cc=greentime.hu@sifive.com \
--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