[PATCH v3 2/2] riscv: accept the atomic extensions this kernel was built with

Vladimir Kondratiev Vladimir.Kondratiev at mobileye.com
Tue Nov 3 06:31:21 PST 2026


On 11/2/26 20:21, Conor Dooley wrote:
> On Mon, Oct 26, 2026 at 11:20:03AM +0200, Vladimir Kondratiev wrote:
>> riscv_early_of_processor_hartid() rejects a hart unless its
>> riscv,isa-extensions property contains "a". That rejects a Zalrsc-only
>> hart even when the kernel was built to use only LR/SC.
>>
>> Require "a" or "zaamo" when the kernel emits AMO, and "a" or "zalrsc"
>> when it emits LR/SC. A normal build defines both toolchain macros and
>> still requires the full A extension. The legacy "riscv,isa" fallback
>> keeps its rv{32,64}ima check.
>>
>> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev at mobileye.com
>>
> 
> IMO, this should not be a separate patch.

I can squash it with previous patch.
My thought was: it address different aspect. While previous patch allows
compiling code that don't use AMO, this one is about correct
manifestation of the extensions supported by CPU. One can use only
previous patch and declare "a" support in the riscv,isa-extensions. Not
exactly true but works. With this patch, one can say "zalrsc" instead of
"a". This have no effect on how kernel get compiled but let user space
know exact CPU features.

Thanks, Vladimir



More information about the linux-riscv mailing list