mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aleksa Paunovic <aleksa.paunovic@htecgroup.com>
To: Paul Walmsley <pjw@kernel.org>,
	Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
Cc: 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>,
	Boqun Feng <boqun.feng@gmail.com>,
	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" <cfu@wavecomp.com>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"olof@lixom.net" <olof@lixom.net>,
	"arikalo@gmail.com" <arikalo@gmail.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 0/2] Support for Risc-V CPUs implementing LR/SC but not AMO
Date: Wed, 8 Apr 2026 11:50:22 +0000	[thread overview]
Message-ID: <e9cd5f28-4736-4257-8cb6-95353264d2ee@htecgroup.com> (raw)
In-Reply-To: <6201870b-b50d-f6e2-814b-7a1fdbf064db@kernel.org>

Hi Paul,

On 1/21/26 19:19, Paul Walmsley wrote:
> Hi Vladimir,
>
> On Tue, 20 Jan 2026, Vladimir Kondratiev wrote:
>
>> Primary goal is to support Mobileye eyeq7h automotive platform
>> based on MIPS P8700 CPU [1] having only "zalrsc" ISA extension but
>> not full "a".
>>
>> Such platforms need userspace to be compiled with correct
>> "-march" flags to generate proper instructions for the atomic types
>> so there's not feasible to use universal userspace for it.
>> Thus there's no point to do same binary kernel suitable for both
>> "full A" and "LRSC only" platform types. Do a compile time
>> alternatives and require CONFIG_NONPORTABLE for this
>>
>> [1] https://mips.com/products/hardware/p8700/
>>
>> Patch 1 do most of work to provide compile-time LR/SC alternatives
>>         for the AMO instructions
>> Patch 2 adjust tests for reported CPU extensions compatibility with
>>         the code
>>
>> Changes in v2: switch from dynamic atomic flavor resolution to
>> compile-time one.
>>
>> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
> Thanks for updating the patches so quickly to deal with Gary's comments. I
> think we should hold off on merging them until common userspace providers
> (like Linux distributions) or distribution builders (like OE/Yocto or
> Buildroot) merge support for this configuration, along with underlying
> projects like glibc.  That way, the rest of us have a way to test our
> patches on this unusual configuration before sending them to the list, or
> sending PRs upstream.  It should be straightforward to get the Zalrsc-only
> userspace support patches tested on existing RISC-V Linux hardware, since
> it supports a superset of this behavior.  I guess the only question is
> whether other projects are interested in committing to carrying forward
> the necessary changes.

Zaamo instructions are emulated on the SBI level, so testing any future patches
on this configuration shouldn't be an issue. We have been using userspaces
with libraries compiled with upstream GCC releases for a while now.  

Of course, a Zalrsc-only userspace would probably work faster on the P8700.

> It also would be good to see publicly available MIPS P8700 boards being
> used on an ongoing basis by at least one active participant on this list,
> who can post Tested-by:s for key series and who can post review feedback
> and Reviewed-by:s for other RISC-V patch series.  That way, we'd have more
> confidence that there actually is an ongoing user population for this
> board who cares about upstream.  This is particularly important for folks
> who care about these MIPS P8700 cores, which don't seem to be a
> from-scratch design for RISC-V, and which don't have AMO support like all
> of the other cores we support.  (For what it's worth, we're trying to
> foster this engagement for other core microarchitectures as well; thanks
> Joel Stanley of TensTorrent, Andrew Jones and Anup Patel of
> Ventana/Qualcomm, and Andreas Korb of Fraunhofer working on the Core-V
> designs for showing how this is done.)

We tested the series on an eight-core QEMU configuration and the Boston board with a single-core MIPS P8700 CPU. 
Most of the testing was done using kselftests (futex, rseq, ptrace, and locking). 
We also ran an overnight locktorture test on the board, which completed without any issues. I should
note that the kernel we used for locktorture testing on the board was non-preemptive. I also ran a
brief rcutorture test on QEMU (a few hours) which showed no issues. 

The kernel was compiled with GCC 15.1.0, using GNU Binutils version 2.45. 

Best regards,
Aleksa Paunovic

      reply	other threads:[~2026-04-08 11:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  7:25 [PATCH] riscv: support CPUs having only "zalrsc" but no "zaamo" Vladimir Kondratiev
2026-01-17  1:50 ` Paul Walmsley
2026-01-19  7:29   ` Vladimir Kondratiev
2026-01-19 17:17     ` Gary Guo
2026-01-19 17:40       ` Linus Torvalds
2026-01-20 14:26       ` [PATCH v2 0/2] Support for Risc-V CPUs implementing LR/SC but not AMO Vladimir Kondratiev
2026-01-20 14:26         ` [PATCH v2 1/2] riscv: support ISA extensions "zaamo" and "zalrsc" Vladimir Kondratiev
2026-01-20 14:26         ` [PATCH v2 2/2] riscv: more accurate check for CPU atomics support Vladimir Kondratiev
2026-01-21 18:19         ` [PATCH v2 0/2] Support for Risc-V CPUs implementing LR/SC but not AMO Paul Walmsley
2026-04-08 11:50           ` Aleksa Paunovic [this message]

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=e9cd5f28-4736-4257-8cb6-95353264d2ee@htecgroup.com \
    --to=aleksa.paunovic@htecgroup.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=arikalo@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=cfu@wavecomp.com \
    --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=vladimir.kondratiev@mobileye.com \
    --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®