]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: update crc32c to support ISA-L 2.32.0
authorJamie Pryde <jamiepry@uk.ibm.com>
Wed, 11 Mar 2026 22:06:14 +0000 (22:06 +0000)
committerJamie Pryde <jamiepry@uk.ibm.com>
Wed, 11 Mar 2026 22:21:32 +0000 (22:21 +0000)
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 <jamiepry@uk.ibm.com>
src/common/CMakeLists.txt
src/common/crc32c_intel_fast.c

index 22ea30bf88f60993d9607c62979bd4294f445531..1634f804b45496d67da9655b7ca4f027d905ff0b 100644 (file)
@@ -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)
index 3fbb63e2812da62bff09eac901e74da9683eb683..1ce4340589b601ac2b09dc8fb8722e675bcc5c7d 100644 (file)
@@ -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;