diff options
author | Palmer Dabbelt <palmer@rivosinc.com> | 2024-04-08 10:55:03 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2024-04-28 14:50:33 -0700 |
commit | 300ce44cbe2924aa83330fc5f24e035665f51b03 (patch) | |
tree | 20a5af5c56b6627f38c5b6b6bbd64a3b1b199102 /Documentation/rust | |
parent | 542124fc0d5cccea273bccf2ee58545ac17aad3f (diff) | |
parent | a8ed2b7a2c13cb8a613cc9a8862688a1385b942d (diff) | |
download | linux-300ce44cbe2924aa83330fc5f24e035665f51b03.tar.gz linux-300ce44cbe2924aa83330fc5f24e035665f51b03.tar.bz2 linux-300ce44cbe2924aa83330fc5f24e035665f51b03.zip |
Merge patch series "Rework & improve riscv cmpxchg.h and atomic.h"
Leonardo Bras <leobras@redhat.com> says:
While studying riscv's cmpxchg.h file, I got really interested in
understanding how RISCV asm implemented the different versions of
{cmp,}xchg.
When I understood the pattern, it made sense for me to remove the
duplications and create macros to make it easier to understand what exactly
changes between the versions: Instruction sufixes & barriers.
Also, did the same kind of work on atomic.c.
After that, I noted both cmpxchg and xchg only accept variables of
size 4 and 8, compared to x86 and arm64 which do 1,2,4,8.
Now that deduplication is done, it is quite direct to implement them
for variable sizes 1 and 2, so I did it. Then Guo Ren already presented
me some possible users :)
I did compare the generated asm on a test.c that contained usage for every
changed function, and could not detect any change on patches 1 + 2 + 3
compared with upstream.
Pathes 4 & 5 were compiled-tested, merged with guoren/qspinlock_v11 and
booted just fine with qemu -machine virt -append "qspinlock".
(tree: https://gitlab.com/LeoBras/linux/-/commits/guo_qspinlock_v11)
Latest tests happened based on this tree:
https://github.com/guoren83/linux/tree/qspinlock_v12
* b4-shazam-lts:
riscv/cmpxchg: Implement xchg for variables of size 1 and 2
riscv/cmpxchg: Implement cmpxchg for variables of size 1 and 2
riscv/atomic.h : Deduplicate arch_atomic.*
riscv/cmpxchg: Deduplicate cmpxchg() asm and macros
riscv/cmpxchg: Deduplicate xchg() asm functions
Link: https://lore.kernel.org/r/20240103163203.72768-2-leobras@redhat.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'Documentation/rust')
0 files changed, 0 insertions, 0 deletions