-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Refactor CPUID code #11311
Refactor CPUID code #11311
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failures are relevant.
I do wonder if propagating the CPUID is the way to go, would having a series of utility functions which query specific features be more readable? It won't change what needs to be done here but it would avoid magic constants throughout the code. |
Do we want to make the CPUID functions public? Considering that legacy.so links with libcrypto.so, that's what it'll take. Or did you mean utility functions like replacing Anyway, that sounds like an effort for another PR |
The latter. Agreed, it is an enhancement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix works on my local machine.
Travis red cross is relevant |
I figured out one of the failures... it's possible that the other one is fixed as well |
This issue is in a state where it requires action by @openssl/committers but the last update was 30 days ago |
I suppose the travis failure is still relevant, also needs rebase. |
Rebased |
@levitte - travis is running now - it has some issues in liblegacy. |
Hmm, looking at the ppccap.c it seems to me it would make sense to rather refactor the algorithm-specific code out than to add everything to the legacy provider. |
Another option - more ugly but less invasive - #ifdef all the code not needed in the legacy provider so when the .c is built for the legacy provider this code is not compiled. |
This issue is in a state where it requires action by @openssl/committers but the last update was 30 days ago |
This is rather WIP - there are conflicts and issues in Travis jobs in legacy provider. |
Yeah... this has turned out to contain a building problem that I've been avoiding for some time. I'll have to bite that bullet... |
It turns out that some CPUID code requires the presence of some BN assembler code, so we make sure it's included in the same manner as the CPUID code itself.
Rebased on a fresher master. Let's see what can be done with this |
The approval is stale and was made too early
I've done several tests lately, that were failing previously, but that now build and run correctly, given a fresher master. |
I remember the problems were mostly on non x86 architectures. PPC was the most problematic IMO. |
Seems it happened on x86 32bit platform. I remember that Richard had one fix before, I verified it locally and the issue had gone. But that fix seems cause Travis red cross. I will verify it locally to see whether the issue has gone now. |
Yes, and I could reproduce that... then.
Please do. |
Done, the issue has gone with the openssl master branch code, as least the commit: daa86f9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question but approved nonetheless.
@@ -59,6 +59,9 @@ jobs: | |||
arch: s390x | |||
compiler: gcc | |||
env: CONFIG_OPTS="--strict-warnings" | |||
- os: linux-ppc64le |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite possible that this platform demonstrated the issue at the time.
Since we don't do Travis any more, that's a bit hard to test for the moment... I'm not sure if it's even possible to specify specific hardware with GitHub Actions
I also removed the [WIP] from the subject here. |
... because? |
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
Approval dismissed, because there's currently nothing that demonstrates that this fixes the problem at this point in time
After a conversation with the rest of the team, it's been decided to close this for now. If the issue turns out to still be present, we can pick it up then. |
Re-opening this, it's time to get it done, now that there's a workflow to test against (#14753) |
We were using CPUID coded in several modules, but it was unclear how
it actually got there, and could fail randomly.
To remedy that, this change separates the CPUID C code from the rest
of cryptlib.c, and ensures the right modules get both that and the
assembler sources explicitly.
Fixes #11281