]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
src/arch: fix hwprobe include path and ZBC/ZVBC offsets for riscv64 68047/head
authorWenLei <lei.wen2@zte.com.cn>
Fri, 27 Mar 2026 08:40:14 +0000 (16:40 +0800)
committerWenLei <lei.wen2@zte.com.cn>
Sat, 28 Mar 2026 02:56:18 +0000 (10:56 +0800)
commit3ccfff1acd6fa5babc7de035271b7f91fccabb8c
tree0882cc1333457c8a6249777baa8c18d8f06f838b
parentc69f7d45db4a3ffe9f9cf9762b05e9bbbcd5b27c
src/arch: fix hwprobe include path and ZBC/ZVBC offsets for riscv64

Signed-off-by: WenLei <lei.wen2@zte.com.cn>
Fix runtime detection of RISC-V ZBC and ZVBC crypto extensions.

Problems fixed:
- <sys/hwprobe.h> only exists in glibc >= 2.40 (released 2024-07-22).
  Many production RISC-V distros still use older glibc (Ubuntu 22.04: 2.35,
  Debian 12: 2.36, etc.) and would fail to compile.
  Therefore we switch to the kernel UAPI header <asm/hwprobe.h>,
  which works with all current glibc versions.
  Proof:
  - Absent in glibc 2.39:
    https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h;hb=refs/tags/glibc-2.39
  - Present in glibc 2.40:
    https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h;hb=refs/tags/glibc-2.40
  - Introducing commit:
    https://sourceware.org/git/?p=glibc.git;a=commit;h=426d0e1aa8f17426d13707594111df712d2b8911

- Incorrect fallback bit positions:
  - RISCV_HWPROBE_EXT_ZBC was (1ULL << 15) → should be (1ULL << 7)
  - RISCV_HWPROBE_EXT_ZVBC was (1ULL << 20) → should be (1ULL << 18)

Signed-off-by: WenLei <lei.wen2@zte.com.cn>
src/arch/riscv.c