All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: Yao Zi <ziyao@disroot.org>
Cc: Rick Chen <rick@andestech.com>, Tom Rini <trini@konsulko.com>,
	"Chia-Wei, Wang" <chiawei_wang@aspeedtech.com>,
	Simon Glass <sjg@chromium.org>, <u-boot@lists.denx.de>
Subject: Re: [PATCH v2 1/3] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc
Date: Thu, 18 Sep 2025 20:07:05 +0800	[thread overview]
Message-ID: <aMv16YIAJm1T51GR@swlinux02> (raw)
In-Reply-To: <20250902081932.21103-2-ziyao@disroot.org>

On Tue, Sep 02, 2025 at 08:19:30AM +0000, Yao Zi wrote:
> Ratified on Apr. 2024, the original RISC-V "A" extension is now split
> into two separate extensions, "Zaamo" for atomic operations and "Zalrsc"
> for load-reserved/store-conditional instructions.
> 
> For now, we've already seen real-world designs implement the Zalrsc
> extension only[2]. As U-Boot mainly runs with only one HART, we could
> easily support these designs by not using AMO instructions in the
> hard-written assembly if necessary, for which this patch introduces two
> new Kconfig options to indicate the availability of "Zaamo" and "Zalrsc".
> 
> Note that even with this patch, "A" extension is specified in the ISA
> string passed to the compiler as long as one of "Zaamo" or "Zalrsc" is
> available, since they're only recognized with a quite recent version of
> GCC/Clang. The compiler usually doesn't automatically generate atomic
> instructions unless the source explicitly instructs it to do so, thus
> this should be safe.
> 
> Link: https://github.com/riscv/riscv-zaamo-zalrsc/commit/d94c64c63e9120d56bdeb540caf2e5dae60a8126 # [1]
> Link: https://lore.kernel.org/u-boot/20250729162035.209849-9-uros.stajic@htecgroup.com/ # [2]
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> ---
>  arch/riscv/Kconfig  | 17 +++++++++++++++++
>  arch/riscv/Makefile |  7 ++++++-
>  2 files changed, 23 insertions(+), 1 deletion(-)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

  reply	other threads:[~2025-09-18 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  8:19 [PATCH v2 0/3] Support SMP on RISC-V cores with Zalrsc only Yao Zi
2025-09-02  8:19 ` [PATCH v2 1/3] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc Yao Zi
2025-09-18 12:07   ` Leo Liang [this message]
2025-09-02  8:19 ` [PATCH v2 2/3] configs: ibex-ast2700: Explicitly disable Zaamo and Zalrsc extension Yao Zi
2025-09-18 12:07   ` Leo Liang
2025-09-02  8:19 ` [PATCH v2 3/3] riscv: Add a Zalrsc-only alternative for synchronization in start.S Yao Zi
2025-09-18 12:08   ` Leo Liang

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=aMv16YIAJm1T51GR@swlinux02 \
    --to=ycliang@andestech.com \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=rick@andestech.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=ziyao@disroot.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.