[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5923b26c-d73e-4b20-8431-fbc091bdb58a@rivosinc.com>
Date: Fri, 19 Jul 2024 10:34:03 +0200
From: Clément Léger <cleger@...osinc.com>
To: Conor Dooley <conor@...nel.org>
Cc: Andrew Jones <ajones@...tanamicro.com>,
Samuel Holland <samuel.holland@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>, linux-riscv@...ts.infradead.org,
Albert Ou <aou@...s.berkeley.edu>, Andy Chiu <andy.chiu@...ive.com>,
Charlie Jenkins <charlie@...osinc.com>, Evan Green <evan@...osinc.com>,
Paul Walmsley <paul.walmsley@...ive.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -fixes] riscv: cpufeature: Do not drop Linux-internal
extensions
On 19/07/2024 10:25, Conor Dooley wrote:
> On Fri, Jul 19, 2024 at 09:11:20AM +0200, Clément Léger wrote:
>>
>>
>> On 18/07/2024 23:57, Andrew Jones wrote:
>>> On Thu, Jul 18, 2024 at 02:29:59PM GMT, Samuel Holland wrote:
>>>> The Linux-internal Xlinuxenvcfg ISA extension is omitted from the
>>>> riscv_isa_ext array because it has no DT binding and should not appear
>>>> in /proc/cpuinfo. The logic added in commit 625034abd52a ("riscv: add
>>>> ISA extensions validation callback") assumes all extensions are included
>>>> in riscv_isa_ext, and so riscv_resolve_isa() wrongly drops Xlinuxenvcfg
>>>> from the final ISA string. Instead, accept such Linux-internal ISA
>>>> extensions as if they have no validation callback.
>>>
>>> This assumes we'll never need a validation callback for a Linux-internal
>>> ISA extension. We can make that assumption now and change our mind
>>> later, but we could also add Xlinuxenvcfg to riscv_isa_ext now and
>>> modify the places where it matters (just print_isa?). If we add
>>> Xlinuxenvcfg to the array with a NULL name then we could do something
>>> like
>>>
>>> print_isa()
>>> {
>>> for (...) {
>>> ...
>>> if (!riscv_isa_ext[i].name)
>>> continue;
>>> }
>>> }
>>
>> I would rather add it to the riscv_isa_ext[] array and avoid handling it
>> differently. There is already the xandespmu extension in this array so
>> xlinuxenvcfg can be added as well.
>
> xandespmu and xlinuxenvcfg are fundamentally different, the former is
> parsed from devicetree and is a real extension. xlinuxengcfg is an
> internal flag. I don't think we should be printing it.
Sorry, I did not meant it was to be displayed. Only added to
riscv_isa_ext[] as pointed out by Andrew.
Powered by blists - more mailing lists