From: Jamie Pryde Date: Wed, 11 Mar 2026 22:06:14 +0000 (+0000) Subject: common: update crc32c to support ISA-L 2.32.0 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f1ffb15b74e1959edf752c1fca4346d4ae0046a5;p=ceph.git common: update crc32c to support ISA-L 2.32.0 With the update of ISA-L from 2.30.0 to 2.32.0, the function crc32_iscsi_00 has been removed in favour of crc32_iscsi_01. crc32_iscsi_01 correctly handles small buffers and so we do not need the guards that existed for crc32_iscsi_00 which could read beyond small buffers and trigger valgrind errors. This commit removes crc32_iscsi_00 from Ceph and uses crc32_iscsi_01 instead. Signed-off-by: Jamie Pryde --- diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 22ea30bf88f6..1634f804b454 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -234,7 +234,6 @@ if(HAVE_INTEL) if(HAVE_NASM_X64) set(CMAKE_ASM_FLAGS "-i ${PROJECT_SOURCE_DIR}/src/isa-l/include/ ${CMAKE_ASM_FLAGS}") list(APPEND crc32_srcs - ${PROJECT_SOURCE_DIR}/src/isa-l/crc/crc32_iscsi_00.asm ${PROJECT_SOURCE_DIR}/src/isa-l/crc/crc32_iscsi_01.asm crc32c_intel_fast_zero_asm.s) endif(HAVE_NASM_X64) diff --git a/src/common/crc32c_intel_fast.c b/src/common/crc32c_intel_fast.c index 3fbb63e2812d..1ce4340589b6 100644 --- a/src/common/crc32c_intel_fast.c +++ b/src/common/crc32c_intel_fast.c @@ -1,7 +1,6 @@ #include "acconfig.h" #include "common/crc32c_intel_baseline.h" -extern unsigned int crc32_iscsi_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_00"); extern unsigned int crc32_iscsi_01(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_01"); extern unsigned int crc32_iscsi_zero_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_zero_00"); @@ -14,10 +13,6 @@ uint32_t ceph_crc32c_intel_fast_pclmul(uint32_t crc, unsigned char const *buffer return crc32_iscsi_zero_00(buffer, len, crc); } - /* Unlike crc32_iscsi_00, crc32_iscsi_01 handles the case where the - * input buffer is less than 8 bytes in its prelude, and does not - * prefetch beyond said buffer. - */ return crc32_iscsi_01(buffer, len, crc); } @@ -31,16 +26,9 @@ uint32_t ceph_crc32c_intel_fast(uint32_t crc, unsigned char const *buffer, unsig return crc32_iscsi_zero_00(buffer, len, crc); } - /* - * the crc32_iscsi_00 method reads past buffer+len (because it - * reads full words) which makes valgrind unhappy. don't do - * that. - */ - if (len < 16) - return ceph_crc32c_intel_baseline(crc, buffer, len); left = ((unsigned long)buffer + len) & 7; len -= left; - v = crc32_iscsi_00(buffer, len, crc); + v = crc32_iscsi_01(buffer, len, crc); if (left) v = ceph_crc32c_intel_baseline(v, buffer + len, left); return v;