From: Vladimir Kondratiev <Vladimir.Kondratiev@mobileye.com>
To: Conor Dooley <conor@kernel.org>
Cc: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>, Will Deacon <will@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Mark Rutland <mark.rutland@arm.com>, Gary Guo <gary@garyguo.net>,
Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
cfu@wavecomp.com, torvalds@linux-foundation.org, olof@lixom.net,
aleksa.paunovic@htecgroup.com, arikalo@gmail.com,
Boqun Feng <boqun@kernel.org>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] riscv: accept the atomic extensions this kernel was built with
Date: Thu, 5 Nov 2026 14:19:41 +0200 [thread overview]
Message-ID: <06025d29-44b4-4ae3-bc82-84185ad786f1@mobileye.com> (raw)
In-Reply-To: <20261104-saddlebag-starring-4380fcc9293c@spud>
On 11/4/26 23:55, Conor Dooley wrote:
> On Wed, Nov 04, 2026 at 01:23:52PM +0200, Vladimir Kondratiev wrote:
>> On 11/3/26 23:41, Conor Dooley wrote:
>>> That got me thinking though, I feel like this breaks some of the
>>> extension parsing logic in other ways.
>>>
>>> If you putting zalrsc and zaamo in your devicetree, we never do any
>>> backwards processing to set the a extension (we don't do this for any
>>> extensions by design, we only populate "child" extensions based on their
>>> "parent"). If there's some userspace thing that expects to see a in
>>> cpufeature or w/e it'd break. There shouldn't be since a has always been
>>> supported but who knows. You need custom userspace anyway so I honestly
>>> don't give that much of a shit about this going wrong.
>>>
>>> What does "worry" me is hwprobe. Currently you've not modified hwprobe
>>> at all to correctly state that you do not support
>>> RISCV_HWPROBE_BASE_BEHAVIOR_IMA. (and brings up the question of whether
>>> you support RISCV_HWPROBE_BASE_BEHAVIOR_IMA_FD etc!)
>>>
>>> Maybe, again you don't care cos of your custom userspace, but this needs
>>> to be holistic if it is being done at all.
>>> Personally, I don't want to lower the minimum requirements - the people
>>> designing this stuff to run linux should have checked to see what our
>>> requirements were (and have always been...).
>>
>> I will drop this patch and keep advertising "a" because formally it is
>> true - all "a" including amo instructions do work but rather slow. Also,
>> not worth to complicate logic here for (so far) one very special SoC.
>
> By that logic, do not complicate the kernel at all with this zalrsc-only
> stuff and drop patch 1 too. Please do this properly or do not do it at
> all. If we are introducing the ability to configure the kernel so that
> it runs on systems with only zalrsc, people should be able to run the
> kernel on such systems without a) failing to boot or b) incorrectly
> reporting to userspace what the hardware is capable of doing.
I am reading again risc-v spec, and it says here:
https://docs.riscv.org/reference/isa/v20260120/priv/machine.html
"M-mode can also be used to implement features that are too difficult or
expensive to implement in hardware directly."
I read it like the feature implemented in the M-mode trap considered
"implemented".
Thus in case of AMO emulated in M-mode, it should be considered
"implemented" however slow. Indeed AMO instructions are executed
correctly from the S/U modes standpoint. Program compiled with these
instruction will not crash. It will run quite slow but correctly. So
proper wording would be "slow ZAAMO" and not "unsupported ZAAMO"
Is my interpretation of the spec correct?
Also, you accepted patch set introducing this p8700 SoC with "A" marked
as "implemented", here:
https://lore.kernel.org/all/20261103-agent-lagging-d7fe1c9334f1@spud/
I will follow this direction, keeping "A" as "implemented" and offering
choice to use faster atomics implementation for such system
Thanks, Vladimir
next prev parent reply other threads:[~2026-11-05 12:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 12:51 [PATCH v4 0/2] riscv: support CPUs with Zalrsc but not Zaamo Vladimir Kondratiev
2026-11-01 12:51 ` [PATCH v4 1/2] riscv: build kernel atomics from LR/SC when Zaamo is disabled Vladimir Kondratiev
2026-11-03 21:09 ` Conor Dooley
2026-11-04 11:41 ` Vladimir Kondratiev
2026-11-04 21:44 ` Conor Dooley
2026-11-01 12:51 ` [PATCH v4 2/2] riscv: accept the atomic extensions this kernel was built with Vladimir Kondratiev
2026-11-03 21:41 ` Conor Dooley
2026-11-04 11:23 ` Vladimir Kondratiev
2026-11-04 21:55 ` Conor Dooley
2026-11-05 12:19 ` Vladimir Kondratiev [this message]
2026-11-03 22:27 ` [PATCH v4 0/2] riscv: support CPUs with Zalrsc but not Zaamo Palmer Dabbelt
2026-11-05 16:52 ` Vladimir Kondratiev
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=06025d29-44b4-4ae3-bc82-84185ad786f1@mobileye.com \
--to=vladimir.kondratiev@mobileye.com \
--cc=aleksa.paunovic@htecgroup.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=arikalo@gmail.com \
--cc=boqun@kernel.org \
--cc=cfu@wavecomp.com \
--cc=conor@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mark.rutland@arm.com \
--cc=olof@lixom.net \
--cc=palmer@dabbelt.com \
--cc=peterz@infradead.org \
--cc=pjw@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=will@kernel.org \
--cc=yury.norov@gmail.com \
/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®