]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/crc32c: stop using gp/tp as scratch in RISC-V Zbc CRC32C 69908/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Thu, 2 Jul 2026 09:26:59 +0000 (02:26 -0700)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Thu, 2 Jul 2026 10:45:26 +0000 (18:45 +0800)
commit0338ed302a8c09155d221d2a98516dfdc053fcf5
tree3704d32612a9de13fc3ac60515aa9906a064418f
parent3b9dfd04eb04d6af459678da47e3594288cd5c93
common/crc32c: stop using gp/tp as scratch in RISC-V Zbc CRC32C

crc32c_zbc's fold-by-four loop used gp (x3) and tp (x4) as scratch for
two folding temporaries. Save/restore around the loop is not enough:
they are ABI-reserved, so a signal delivered mid-loop runs its handler
with a corrupted tp, and the first TLS access there faults.

On riscv64 this reliably crashes the crimson/seastore unittests
unittest-transaction-manager and unittest-omap-manager, where seastar's
stall-detector timer fires often: the process dies with SIGSEGV in the
linker's TLS path with garbage in gp/tp.

Fixes: https://tracker.ceph.com/issues/77904
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/common/crc32c_riscv_zbc_asm.h