Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: SM4 GFNI needs AVX2 #4494

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Dec 23, 2024

This module uses AVX2 along with GFNI and should note that in its info.txt. Not sure we want to do that in the long-term, though. Perhaps better to implement this as a special case in configure.py, to disable GFNI when AVX2 was explicitly disabled with --disable-avx2? Are there other examples of such dependencies that need some sort of generalization, perhaps?

@coveralls
Copy link

coveralls commented Dec 23, 2024

Coverage Status

coverage: 91.238% (-1.2%) from 92.433%
when pulling 07d0556 on Rohde-Schwarz:fix/no_avx2
into 6471abd on randombit:master.

@randombit
Copy link
Owner

Are there other examples of such dependencies that need some sort of generalization, perhaps

Probably yeah. VAES for instance is defined as VAES+AVX2 bits.

We already handle disabling these at runtime in CPUID cleanly (if you use BOTAN_CLEAR_CPUID=avx2 it clears GFNI, VAES, etc also) but do not have similar logic for build time.

Copy link
Owner

@randombit randombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses the immediate issue so fine with me.

I’ll think about what to do here in the general case.

Copy link
Owner

@randombit randombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize now this doesn’t actually address the real issue

We should have a <dep> on simd_avx2. Otherwise with or without this isa bit, if you do configure.py —disable-modules=simd_avx2 this will fail to build.

@reneme
Copy link
Collaborator Author

reneme commented Dec 23, 2024

Makes sense. Otherwise it won't find the avx-related helper headers that are part of simd_avx2, I reckon. Updated.

@reneme reneme merged commit ed5e77e into randombit:master Dec 23, 2024
37 of 38 checks passed
@reneme reneme deleted the fix/no_avx2 branch December 23, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants