Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-checksums for openSUSE:Factory checked in at 2025-04-22 17:30:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-checksums (Old) and /work/SRC/openSUSE:Factory/.aws-checksums.new.30101 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "aws-checksums" Tue Apr 22 17:30:26 2025 rev:8 rq:1271849 version:0.2.7 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-checksums/aws-checksums.changes 2025-04-10 22:01:11.825482799 +0200 +++ /work/SRC/openSUSE:Factory/.aws-checksums.new.30101/aws-checksums.changes 2025-04-22 17:31:00.861965173 +0200 @@ -1,0 +2,6 @@ +Sun Apr 20 12:53:24 UTC 2025 - Andreas Stieger <andreas.stie...@gmx.de> + +- update to 0.2.7: + * remove thread unsafe false positives + +------------------------------------------------------------------- Old: ---- v0.2.5.tar.gz New: ---- v0.2.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-checksums.spec ++++++ --- /var/tmp/diff_new_pack.ripvH1/_old 2025-04-22 17:31:01.653998442 +0200 +++ /var/tmp/diff_new_pack.ripvH1/_new 2025-04-22 17:31:01.653998442 +0200 @@ -2,6 +2,7 @@ # spec file for package aws-checksums # # Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 Andreas Stieger <andreas.stie...@gmx.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +20,7 @@ %define library_version 1.0.0 %define library_soversion 1 Name: aws-checksums -Version: 0.2.5 +Version: 0.2.7 Release: 0 Summary: Checksums package for AWS SDK for C License: Apache-2.0 @@ -75,7 +76,8 @@ %build %define __builder ninja %cmake \ - -DCMAKE_BUILD_TYPE=Release + -DCMAKE_BUILD_TYPE=Release \ + %{nil} %make_jobs %check @@ -85,10 +87,10 @@ %install %cmake_install -%post -n lib%{name}%{library_soversion} -p /sbin/ldconfig -%postun -n lib%{name}%{library_soversion} -p /sbin/ldconfig +%ldconfig_scriptlets -n lib%{name}%{library_soversion} %files -n %{name}-bin +%license LICENSE %{_bindir}/checksum-profile %files -n lib%{name}%{library_soversion} @@ -98,6 +100,7 @@ %{_libdir}/*.so.%{library_version} %files -n lib%{name}-devel +%license LICENSE %{_libdir}/cmake/%{name}/ %{_libdir}/*.so %{_includedir}/* ++++++ v0.2.5.tar.gz -> v0.2.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/bin/benchmark/main.c new/aws-checksums-0.2.7/bin/benchmark/main.c --- old/aws-checksums-0.2.5/bin/benchmark/main.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/bin/benchmark/main.c 2025-04-11 00:13:13.000000000 +0200 @@ -5,7 +5,7 @@ #include <aws/checksums/crc.h> #include <aws/checksums/private/crc64_priv.h> -#include <aws/checksums/private/crc_priv.h> +#include <aws/checksums/private/crc32_priv.h> #include <aws/common/allocator.h> #include <aws/common/byte_buf.h> @@ -55,6 +55,23 @@ (void)crc; } +static void s_runcrc64_multi(struct aws_byte_cursor checksum_this) { + if (checksum_this.len <= 8 * 1024) { + uint64_t crc = aws_checksums_crc64nvme(checksum_this.ptr, (int)checksum_this.len, 0); + (void)crc; + } else { + uint64_t crc = 0; + for (size_t offset = 0; offset < checksum_this.len; offset += 8 * 1024) { + // Calculate size of this chunk (handles last chunk if not full 8KB) + size_t chunk_size = ((offset + 8 * 1024) > checksum_this.len) ? + (checksum_this.len - offset) : 8 * 1024; + + crc = aws_checksums_crc64nvme(checksum_this.ptr + offset, (int)chunk_size, crc); + } + (void)crc; + } +} + #define KB_TO_BYTES(kb) ((kb) * 1024) #define MB_TO_BYTES(mb) ((mb) * 1024 * 1024) #define GB_TO_BYTES(gb) ((gb) * 1024 * 1024 * 1024ULL) @@ -86,6 +103,7 @@ {.profile_run = s_runcrc32c, .name = "crc32c with hw optimizations"}, {.profile_run = s_runcrc64_sw, .name = "crc64nvme C only"}, {.profile_run = s_runcrc64, .name = "crc64nvme with hw optimizations"}, + {.profile_run = s_runcrc64_multi, .name = "crc64nvme with hw optimizations(multi)"}, }; const size_t allocators_array_size = AWS_ARRAY_SIZE(allocators); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/include/aws/checksums/private/crc32_priv.h new/aws-checksums-0.2.7/include/aws/checksums/private/crc32_priv.h --- old/aws-checksums-0.2.5/include/aws/checksums/private/crc32_priv.h 1970-01-01 01:00:00.000000000 +0100 +++ new/aws-checksums-0.2.7/include/aws/checksums/private/crc32_priv.h 2025-04-11 00:13:13.000000000 +0200 @@ -0,0 +1,50 @@ +#ifndef AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H +#define AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_CRC32_SIZE_BYTES 4 +#include <aws/checksums/exports.h> +#include <aws/common/common.h> + +#include <aws/common/config.h> +#include <stdint.h> + +AWS_EXTERN_C_BEGIN + +/* Computes CRC32 (Ethernet, gzip, et. al.) using a (slow) reference implementation. */ +AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_sw(const uint8_t *input, int length, uint32_t previousCrc32); + +/* Computes the Castagnoli CRC32c (iSCSI) using a (slow) reference implementation. */ +AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_sw(const uint8_t *input, int length, uint32_t previousCrc32c); + +#if defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_ARM64) +uint32_t aws_checksums_crc32_armv8(const uint8_t *input, int length, uint32_t previous_crc32); +uint32_t aws_checksums_crc32c_armv8(const uint8_t *input, int length, uint32_t previous_crc32c); +#elif defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_INTEL) +# if defined(AWS_ARCH_INTEL_X64) +typedef uint64_t *slice_ptr_type; +typedef uint64_t slice_ptr_int_type; +# define crc_intrin_fn _mm_crc32_u64 + +# if !defined(_MSC_VER) +uint32_t aws_checksums_crc32c_clmul_sse42(const uint8_t *data, int length, uint32_t previous_crc32c); +# endif + +# else +typedef uint32_t *slice_ptr_type; +typedef uint32_t slice_ptr_int_type; +# define crc_intrin_fn _mm_crc32_u32 +# endif +uint32_t aws_checksums_crc32c_intel_avx512_with_sse_fallback( + const uint8_t *input, + int length, + uint32_t previous_crc32c); + +#endif + +AWS_EXTERN_C_END + +#endif /* AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/include/aws/checksums/private/crc_priv.h new/aws-checksums-0.2.7/include/aws/checksums/private/crc_priv.h --- old/aws-checksums-0.2.5/include/aws/checksums/private/crc_priv.h 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/include/aws/checksums/private/crc_priv.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,50 +0,0 @@ -#ifndef AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H -#define AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#define AWS_CRC32_SIZE_BYTES 4 -#include <aws/checksums/exports.h> -#include <aws/common/common.h> - -#include <aws/common/config.h> -#include <stdint.h> - -AWS_EXTERN_C_BEGIN - -/* Computes CRC32 (Ethernet, gzip, et. al.) using a (slow) reference implementation. */ -AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_sw(const uint8_t *input, int length, uint32_t previousCrc32); - -/* Computes the Castagnoli CRC32c (iSCSI) using a (slow) reference implementation. */ -AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_sw(const uint8_t *input, int length, uint32_t previousCrc32c); - -#if defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_ARM64) -uint32_t aws_checksums_crc32_armv8(const uint8_t *input, int length, uint32_t previous_crc32); -uint32_t aws_checksums_crc32c_armv8(const uint8_t *input, int length, uint32_t previous_crc32c); -#elif defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_INTEL) -# if defined(AWS_ARCH_INTEL_X64) -typedef uint64_t *slice_ptr_type; -typedef uint64_t slice_ptr_int_type; -# define crc_intrin_fn _mm_crc32_u64 - -# if !defined(_MSC_VER) -uint32_t aws_checksums_crc32c_clmul_sse42(const uint8_t *data, int length, uint32_t previous_crc32c); -# endif - -# else -typedef uint32_t *slice_ptr_type; -typedef uint32_t slice_ptr_int_type; -# define crc_intrin_fn _mm_crc32_u32 -# endif -uint32_t aws_checksums_crc32c_intel_avx512_with_sse_fallback( - const uint8_t *input, - int length, - uint32_t previous_crc32c); - -#endif - -AWS_EXTERN_C_END - -#endif /* AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/include/aws/checksums/private/crc_util.h new/aws-checksums-0.2.7/include/aws/checksums/private/crc_util.h --- old/aws-checksums-0.2.5/include/aws/checksums/private/crc_util.h 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/include/aws/checksums/private/crc_util.h 2025-04-11 00:13:13.000000000 +0200 @@ -6,6 +6,7 @@ */ #include <aws/common/byte_order.h> +#include <aws/common/cpuid.h> #include <aws/common/stdint.h> #include <limits.h> #include <stdlib.h> @@ -76,4 +77,52 @@ */ void aws_checksums_crc64_init(void); +/** + * Note: this is slightly different from our typical pattern. + * This check is currently performed in a tight loop, so jumping through + * some hoops with inlining to avoid perf regressions, which forces + * below functions to be declared in a header. + */ +extern bool s_detection_performed; +extern bool s_detected_sse42; +extern bool s_detected_avx512; +extern bool s_detected_clmul; +extern bool s_detected_vpclmulqdq; + +static inline void aws_checksums_init_detection_cache(void) { + s_detected_clmul = aws_cpu_has_feature(AWS_CPU_FEATURE_CLMUL); + s_detected_sse42 = aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_2); + s_detected_avx512 = aws_cpu_has_feature(AWS_CPU_FEATURE_AVX512); + s_detected_clmul = aws_cpu_has_feature(AWS_CPU_FEATURE_CLMUL); + s_detected_vpclmulqdq = aws_cpu_has_feature(AWS_CPU_FEATURE_VPCLMULQDQ); +} + +static inline bool aws_cpu_has_clmul_cached(void) { + if (AWS_UNLIKELY(!s_detection_performed)) { + aws_checksums_init_detection_cache(); + } + return s_detected_clmul; +} + +static inline bool aws_cpu_has_sse42_cached(void) { + if (AWS_UNLIKELY(!s_detection_performed)) { + aws_checksums_init_detection_cache(); + } + return s_detected_sse42; +} + +static inline bool aws_cpu_has_avx512_cached(void) { + if (AWS_UNLIKELY(!s_detection_performed)) { + aws_checksums_init_detection_cache(); + } + return s_detected_avx512; +} + +static inline bool aws_cpu_has_vpclmulqdq_cached(void) { + if (AWS_UNLIKELY(!s_detection_performed)) { + aws_checksums_init_detection_cache(); + } + return s_detected_vpclmulqdq; +} + #endif /* AWS_CHECKSUMS_PRIVATE_CRC_UTIL_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/arm/crc32c_arm.c new/aws-checksums-0.2.7/source/arm/crc32c_arm.c --- old/aws-checksums-0.2.5/source/arm/crc32c_arm.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/arm/crc32c_arm.c 2025-04-11 00:13:13.000000000 +0200 @@ -5,7 +5,7 @@ /* No instrics defined for 32-bit MSVC */ #if (defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) -# include <aws/checksums/private/crc_priv.h> +# include <aws/checksums/private/crc32_priv.h> # ifdef _M_ARM64 # include <arm64_neon.h> # define PREFETCH(p) __prefetch(p) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/checksums.c new/aws-checksums-0.2.7/source/checksums.c --- old/aws-checksums-0.2.5/source/checksums.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/checksums.c 2025-04-11 00:13:13.000000000 +0200 @@ -6,6 +6,12 @@ #include <aws/checksums/checksums.h> #include <aws/checksums/private/crc_util.h> +bool s_detection_performed = false; +bool s_detected_sse42 = false; +bool s_detected_avx512 = false; +bool s_detected_clmul = false; +bool s_detected_vpclmulqdq = false; + static bool s_checksums_library_initialized = false; void aws_checksums_library_init(struct aws_allocator *allocator) { @@ -14,6 +20,7 @@ aws_common_library_init(allocator); + aws_checksums_init_detection_cache(); aws_checksums_crc32_init(); aws_checksums_crc64_init(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/crc32.c new/aws-checksums-0.2.7/source/crc32.c --- old/aws-checksums-0.2.5/source/crc32.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/crc32.c 2025-04-11 00:13:13.000000000 +0200 @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0. */ #include <aws/checksums/crc.h> -#include <aws/checksums/private/crc_priv.h> +#include <aws/checksums/private/crc32_priv.h> #include <aws/checksums/private/crc_util.h> #include <aws/common/cpuid.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/crc_sw.c new/aws-checksums-0.2.7/source/crc_sw.c --- old/aws-checksums-0.2.5/source/crc_sw.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/crc_sw.c 2025-04-11 00:13:13.000000000 +0200 @@ -2,7 +2,7 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ -#include <aws/checksums/private/crc_priv.h> +#include <aws/checksums/private/crc32_priv.h> #include <aws/checksums/private/crc_util.h> #include <stddef.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/intel/asm/crc32c_sse42_asm.c new/aws-checksums-0.2.7/source/intel/asm/crc32c_sse42_asm.c --- old/aws-checksums-0.2.5/source/intel/asm/crc32c_sse42_asm.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/intel/asm/crc32c_sse42_asm.c 2025-04-11 00:13:13.000000000 +0200 @@ -3,9 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include <aws/checksums/private/crc_priv.h> - -#include <aws/common/cpuid.h> +#include <aws/checksums/private/crc32_priv.h> +#include <aws/checksums/private/crc_util.h> /* clang-format off */ @@ -273,9 +272,6 @@ return crc; } -static bool detection_performed = false; -static bool detected_clmul = false; - /* * Computes the Castagnoli CRC32c (iSCSI) of the specified data buffer using the Intel CRC32Q (64-bit quad word) and * PCLMULQDQ machine instructions (if present). @@ -285,14 +281,6 @@ */ uint32_t aws_checksums_crc32c_clmul_sse42(const uint8_t *input, int length, uint32_t previousCrc32) { - if (AWS_UNLIKELY(!detection_performed)) { - detected_clmul = aws_cpu_has_feature(AWS_CPU_FEATURE_CLMUL); - /* Simply setting the flag true to skip HW detection next time - Not using memory barriers since the worst that can - happen is a fallback to the non HW accelerated code. */ - detection_performed = true; - } - /* this is called by a higher-level shim and previousCRC32 is already ~ */ uint32_t crc = ~previousCrc32; @@ -321,7 +309,7 @@ } /* Using likely to keep this code inlined */ - if (AWS_LIKELY(detected_clmul)) { + if (AWS_LIKELY(aws_cpu_has_clmul_cached())) { while (AWS_LIKELY(length >= 3072)) { /* Compute crc32c on each block, chaining each crc result */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/source/intel/intrin/crc32c_sse42_avx512.c new/aws-checksums-0.2.7/source/intel/intrin/crc32c_sse42_avx512.c --- old/aws-checksums-0.2.5/source/intel/intrin/crc32c_sse42_avx512.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/source/intel/intrin/crc32c_sse42_avx512.c 2025-04-11 00:13:13.000000000 +0200 @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include <aws/checksums/private/crc_priv.h> +#include <aws/checksums/private/crc32_priv.h> +#include <aws/checksums/private/crc_util.h> #include <aws/common/assert.h> -#include <aws/common/cpuid.h> #include <aws/common/macros.h> #include <emmintrin.h> @@ -154,25 +154,7 @@ } #endif /* #if defined(AWS_HAVE_AVX512_INTRINSICS) && (INTPTR_MAX == INT64_MAX) */ -static bool detection_performed = false; -static bool detected_sse42 = false; -static bool detected_avx512 = false; -static bool detected_clmul = false; -static bool detected_vpclmulqdq = false; - uint32_t aws_checksums_crc32c_intel_avx512_with_sse_fallback(const uint8_t *input, int length, uint32_t previous_crc) { - if (AWS_UNLIKELY(!detection_performed)) { - detected_sse42 = aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_2); - detected_avx512 = aws_cpu_has_feature(AWS_CPU_FEATURE_AVX512); - detected_clmul = aws_cpu_has_feature(AWS_CPU_FEATURE_CLMUL); - detected_vpclmulqdq = aws_cpu_has_feature(AWS_CPU_FEATURE_VPCLMULQDQ); - - /* Simply setting the flag true to skip HW detection next time - Not using memory barriers since the worst that can - happen is a fallback to the non HW accelerated code. */ - detection_performed = true; - } - /* this is the entry point. We should only do the bit flip once. It should not be done for the subfunctions and * branches.*/ uint32_t crc = ~previous_crc; @@ -202,7 +184,7 @@ #if defined(AWS_HAVE_AVX512_INTRINSICS) && defined(AWS_ARCH_INTEL_X64) int chunk_size = length & ~63; - if (detected_avx512 && detected_vpclmulqdq && detected_clmul) { + if (aws_cpu_has_avx512_cached() && aws_cpu_has_vpclmulqdq_cached() && aws_cpu_has_clmul_cached()) { if (length >= 256) { crc = s_checksums_crc32c_avx512_impl(input, length, crc); /* check remaining data */ @@ -218,7 +200,7 @@ #endif #if defined(AWS_ARCH_INTEL_X64) && !defined(_MSC_VER) - if (detected_sse42 && detected_clmul) { + if (aws_cpu_has_sse42_cached() && aws_cpu_has_clmul_cached()) { // this function is an entry point on its own. It inverts the crc passed to it // does its thing and then inverts it upon return. In order to keep // aws_checksums_crc32c_sse42 a standalone function (which it has to be due diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-checksums-0.2.5/tests/crc_test.c new/aws-checksums-0.2.7/tests/crc_test.c --- old/aws-checksums-0.2.5/tests/crc_test.c 2025-03-27 19:22:55.000000000 +0100 +++ new/aws-checksums-0.2.7/tests/crc_test.c 2025-04-11 00:13:13.000000000 +0200 @@ -5,7 +5,7 @@ #include <aws/checksums/checksums.h> #include <aws/checksums/crc.h> -#include <aws/checksums/private/crc_priv.h> +#include <aws/checksums/private/crc32_priv.h> #include <aws/checksums/private/crc_util.h> #include <aws/common/device_random.h>