-
Notifications
You must be signed in to change notification settings - Fork 2
[PW_SID:1044694] Support for Risc-V CPUs implementing LR/SC but not AMO #1352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: workflow__riscv__fixes
Are you sure you want to change the base?
Conversation
riscv have 3 instruction set extensions related to atomic operations: - "zaamo": atomic instructions like AMOADD - "zalrsc": LR and SC instructions - "a" that is "zaamo" + "zalrsc" Historically, "a" was first, and Linux was relying on "a"; then "zaamo"/"zalrsc" was introduced. It is possible to implement most atomic operations with either AMO or LR/SC. AMO if more efficient however more complex flows are possible with LR/SC only. Platforms supporting only part of atomics starting to appear. Notable is MIPS P8700 CPU [1] having only "zalrsc". Support configurations not having "A" but supporting one of "zaamo"/"zalrsc". The "RISC-V C API" [2] defines architecture extension test macros. It says naming rule for the test macros is __riscv_<ext_name>, where <ext_name> is all lower-case. Alternative to the __riscv_a macro name, __riscv_atomic, is deprecated but used by old toolchains. Fix "-march" compiler flag and use extension test macros in code For decisions use #if defined(__riscv_atomic) || defined(__riscv_zaamo) For the full "A" support, old toolchains set __riscv_atomic while new ones set __riscv_a, __riscv_zaamo and __riscv_zalrsc Add alternative LR/SC implementations for AMO based code fragments, prefer AMO if possible and fallback to LR/SC [1] https://mips.com/products/hardware/p8700/ [2] https://github.com/riscv-non-isa/riscv-c-api-doc Suggested-by: Chao-ying Fu <cfu@wavecomp.com> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
CPU reports extensions supported in "riscv,isa-extensions" property of the CPU node, for atomic operations it is - "a" extension meaning both AMO and LR/SC supported - "zaamo" extension meaning AMO instructions supported - "zalrsc" extension meaning LR/SC supported Code can also be compiled with subset of atomics support Relax requirements for CPU extension support from full "a" to subset compatible with software configuration Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 1: "[v2,1/2] riscv: support ISA extensions "zaamo" and "zalrsc"" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
|
Patch 2: "[v2,2/2] riscv: more accurate check for CPU atomics support" |
05994e3 to
daa8ad1
Compare
PR for series 1044694 applied to workflow__riscv__fixes
Name: Support for Risc-V CPUs implementing LR/SC but not AMO
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1044694
Version: 2