lkml.org 
[lkml]   [2019]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v5 PATCH] RISC-V: Fix unsupported isa string info.
On Fri, Aug 16, 2019 at 07:21:52PM +0000, Atish Patra wrote:
> > > + if (isa[0] != '\0') {
> > > + /* Add remainging isa strings */
> > > + for (e = isa; *e != '\0'; ++e) {
> > > +#if !defined(CONFIG_VIRTUALIZATION)
> > > + if (e[0] != 'h')
> > > +#endif
> > > + seq_write(f, e, 1);
> > > + }
> > > + }
> >
> > This one I don't get. Why do we want to check CONFIG_VIRTUALIZATION?
> >
>
> If CONFIG_VIRTUALIZATION is not enabled, it shouldn't print that
> hypervisor extension "h" in isa extensions.

CONFIG_VIRTUALIZATION doesn't change anything in the kernels
capabilities, it just enables other config options. But more
importantly the 'h' extension is only relevant for S-mode software
anyway.

> This is just an information to the userspace that some of the mandatory
> ISA extensions ("mafdcsu") are not supported in kernel which may lead
> to undesirable results.

I think we need to sit down decide what the purpose of /proc/cpuinfo
is. IIRC on other architectures is just prints what the hardware
supports, not what you can actually make use of. How else would you
find out that you'd need to enable more kernel options to fully
utilize the hardware?

Also printing this warning to the kernel log when someone reads the
procfs file is very strange.

\
 
 \ /
  Last update: 2019-08-18 20:17    [W:0.086 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site