Re: [PATCH] riscv: cmpxchg: Use .option arch for Zacas and Zabha
Paul Walmsley <[email protected]>
| Newsgroups | org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 17 Jul 2026, Vivian Wang wrote:
> Instead of adding these to -march globally, use .option arch to use
> instructions from these extensions only in code paths where we know they
> are available, like how it is done for most other extensions.
> TOOLCHAIN_HAS_{ZACAS,ZABHA} already depend on AS_HAS_OPTION_ARCH, so
> this is not a functionality regression even on older assemblers.
>
> Although the compiler is unlikely to generate atomics on its own accord,
> this aligns handling of Zacas and Zabha with most other extensions and
> improves consistency on how assembly code requiring extra extensions is
> written in kernel code.
>
> This is analogous to the use of __LSE_PREAMBLE or .arch_extension lse in
> arm64 code.
>
> Signed-off-by: Vivian Wang <[email protected]>
Thanks, queued for v7.3.
- Paul
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv