20250816-cpuid_get_flags_ex-optimize#9107
Merged
SparkiDev merged 1 commit intoAug 18, 2025
Merged
Conversation
…t to a regular word32, and use non-atomics for general flag checking, with a new implementation of cpuid_get_flags_ex() that is threadsafe by idempotency; rename strictly-threadsafe cpuid_get_flags_ex() as cpuid_get_flags_atomic() (strictly accurate return value), and add cpuid_flags_atomic_t and WC_CPUID_ATOMIC_INITIALIZER, used only for internal manipulation of flags in cpuid.c where atomicity matters.
This comment was marked as spam.
This comment was marked as spam.
Contributor
Author
|
retest this please |
SparkiDev
approved these changes
Aug 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wolfcrypt/src/cpuid.c,wolfssl/wolfcrypt/cpuid.h: changecpuid_flags_tto aregular
word32, and use non-atomics for general flag checking, with a newimplementation of
cpuid_get_flags_ex()that is threadsafe by idempotency;rename strictly-threadsafe
cpuid_get_flags_ex()ascpuid_get_flags_atomic()(strictly accurate return value), and add
cpuid_flags_atomic_tandWC_CPUID_ATOMIC_INITIALIZER, used only for internal manipulation of flags incpuid.cwhere atomicity matters.fixes 15% performance regression on SHA256-based XMSS.
tested with
wolfssl-multi-test.sh ... check-source-text benchmark-wolfcrypt-intelasm-sp-asm-all quantum-safe-wolfssl-all-intelasm-sp-asm-helgrind