Skip to content

Support SMP on RISC-V cores with Zalrsc only

Yao Zi u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Split changes to ibex-ast2700_defconfig into a separate patch
- Fix several typos
- Improve help text of CONFIG_RISCV_ISA_{ZAAMO,ZALRSC}
- Improve commit message for PATCH 3
- Link to v1: https://lore.kernel.org/all/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3riscv: Add Kconfig options to distinguish Zaamo and Zalrscarch/riscv/Kconfig arch/riscv/Makefile+23 -11 reply
2/3configs: ibex-ast2700: Explicitly disable Zaamo and Zalrsc extensionconfigs/ibex-ast2700_defconfig+2 -11 reply
3/3riscv: Add a Zalrsc-only alternative for synchronization in start.Sarch/riscv/cpu/start.S+25 -11 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchLeo Yu-Chi Liang
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Support SMP on RISC-V cores with Zalrsc only

Previously, we use AMO instructions to synchronize cores at start when SMP is used, which requires Zaamo extension to present. This series implements an alternative implementation of synchronization with LR/SC instructions and add Kconfig options to use them, make it possible to enable SMP on cores without Zaamo extension.

This is tested on both TH1520 Lichee Pi 4A board and QEMU. With QEMU, building and testing looks lile,

	$ make qemu-riscv64_defconfig
	$ ./scripts/config -d CONFIG_RISCV_ISA_ZAAMO
	$ make
	$ qemu-system-riscv64 -M virt \
		-cpu rv64,a=off,zaamo=off,zawrs=off,zalrsc=on   \
		-nographic -bios u-boot-nodtb.bin -smp 8

U-Boot 2025.07-rc4-00456-g2a74e084d720-dirty (Sep 02 2025 - 08:07:58 +0000)

CPU: riscv
Model: riscv-virtio,qemu
DRAM: 128 MiB
using memory 0x86ea1000-0x876c1000 for malloc()
Core: 34 devices, 13 uclasses, devicetree: board
Flash: 32 MiB
Loading Environment from nowhere... OK
In: serial,usbkbd
Out: serial,vidconsole
Err: serial,vidconsole
No USB controllers found
Net: No ethernet found.

Changed from v1
- Split changes to ibex-ast2700_defconfig into a separate patch
- Fix several typos
- Improve help text of CONFIG_RISCV_ISA_{ZAAMO,ZALRSC}
- Improve commit message for PATCH 3
- Link to v1: https://lore.kernel.org/all/[email protected]/

Yao Zi (3):
riscv: Add Kconfig options to distinguish Zaamo and Zalrsc
configs: ibex-ast2700: Explicitly disable Zaamo and Zalrsc extension
riscv: Add a Zalrsc-only alternative for synchronization in start.S

 arch/riscv/Kconfig             | 17 +++++++++++++++++
 arch/riscv/Makefile            |  7 ++++++-
 arch/riscv/cpu/start.S         | 26 +++++++++++++++++++++++++-
 configs/ibex-ast2700_defconfig |  3 ++-
 4 files changed, 50 insertions(+), 3 deletions(-)
Signature · 1 line
2.50.1