-
Notifications
You must be signed in to change notification settings - Fork 664
Support for x86 and ppc64le architectures #1037
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
Conversation
|
Thanks very much for this PR! From reading through the patch and the ALT Linux test logs, it looks clear enough and I'd approve it -- but you see in the discussions on #1019 that we wonder how we could keep confirming these architectures via a |
|
We are using rpm-based Tests were passing when these commits applied over I see there is commit 17d3e0b with heavy BIKE update. Maybe it requires additional porting effort. |
Btw, it says |
Yes, when I disable BIKE similar to how it's disabled for 32-bit ARM in 17d3e0b tests are passing again. Patch: diff --git a/.CMake/alg_support.cmake b/.CMake/alg_support.cmake
index 51094bcf..ae695014 100644
--- a/.CMake/alg_support.cmake
+++ b/.CMake/alg_support.cmake
@@ -28,7 +28,7 @@ endif()
endif()
# BIKE is not supported on Windows and 32-bit ARM
-cmake_dependent_option(OQS_ENABLE_KEM_BIKE "Enable BIKE algorithm family" ON "NOT WIN32; NOT ARCH_ARM32v7" OFF)
+cmake_dependent_option(OQS_ENABLE_KEM_BIKE "Enable BIKE algorithm family" ON "NOT WIN32; NOT ARCH_ARM32v7; NOT ARCH_X86" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_bike1_l1_cpa "" ON "OQS_ENABLE_KEM_BIKE" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_bike1_l1_fo "" ON "OQS_ENABLE_KEM_BIKE" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_bike1_l3_cpa "" ON "OQS_ENABLE_KEM_BIKE" OFF)I will force-push the updated version of the commits. But, it's pity BIKE is not working (anymore?) on 32-bit arches. |
|
Btw, I may try to [experimentally] create ps. I noticed such CI method in ispc project. |
OK, thanks for the explanation: So you have such physical machines somewhere and "simply" build/test on them (?)
FWIW, the oqs-demos and profiling subprojects also do that -- but when looking at Github Actions, I'm not seeing a way to run things other than x86, ARM64/32 even using self-hosted runners -- even leaving the security downside of a public project aside. So that indeed would call for emulated ppc64le or s390x -- which arguably is way too slow, no? |
Yes. They are integrated into our build system and considered to be the main architectures.
It will be slower than native or KVM virtualization, but faster than full https://ahmedkrmn.github.io/TCG-Continuous-Benchmarking/Measuring-QEMU-Emulation-Efficiency/ The only public ppc64le instances I know are Travis-CI and GCC Compile Farm (perhaps not suitable for automatic testing). |
|
FYI. For the sake of curiosity, I tested |
|
Code looks good to me for now. But I'd like to get at least an x86 CI build before merging. |
|
Thanks @vt-alt for preparing this. I've set up simplistic TravisCI config for ppc64le on top of the PR to build and run the ninja tests (still running the constant-time tests on another machine). See We can add the TravisCI build if we want to make exception and slightly expand the CI zoo again. The plus points are that it's free for ppc64le (and s390x). For more advanced workflow like triggering downstream builds it could become more complex however. I think if we limit to build&test it should be manageable. It might also make sense to push the SIKE changes to upstream. |
I'd be OK with this if it's clear that Travis (and ppc64l4 and s390x) are "second-grade" citizens until corresponding downstream CI checks have been added -- at the very least in those downstream projects for which this work has been initiated: Could you comment which ones those are, @vt-alt ? Was it |
|
Thanks @bhess for creating the ppc64le Travis testing. The CI configuration looks sufficiently straightforward that I'm not worried about it expanding the CI zoo much. |
Thanks. I will create PR there.
I build |
|
While porting to PQCrypto-SIDH I realized that I had incorrect assumptions (about the generic implementation of SIKE) and will force push slightly corrected ppc64le commit here. (No data or behavior change, just remove redundant |
|
FYI. I created a pull request there microsoft/PQCrypto-SIDH#50 Force pushed mentioned above change here: diff --git a/src/kem/sike/external/config.h b/src/kem/sike/external/config.h
index 97a9b8bf..591f1cd5 100644
--- a/src/kem/sike/external/config.h
+++ b/src/kem/sike/external/config.h
@@ -88,8 +88,6 @@ typedef uint64_t uint128_t[2];
typedef unsigned uint128_t __attribute__((mode(TI)));
#elif (TARGET == TARGET_ARM64 && OS_TARGET == OS_NIX)
typedef unsigned uint128_t __attribute__((mode(TI)));
-#elif (TARGET == TARGET_PPC64LE && OS_TARGET == OS_NIX)
-typedef unsigned uint128_t __attribute__((mode(TI)));
#elif (TARGET == TARGET_AMD64 && OS_TARGET == OS_WIN)
typedef uint64_t uint128_t[2];
#endif
@@ -228,7 +226,7 @@ static __inline unsigned int is_digit_lessthan_ct(digit_t x, digit_t y) { // Is
ADC128(addend, product, carry, result); \
}
-#elif ((TARGET == TARGET_AMD64 || TARGET == TARGET_ARM64 || TARGET == TARGET_PPC64LE) && OS_TARGET == OS_NIX)
+#elif ((TARGET == TARGET_AMD64 || TARGET == TARGET_ARM64) && OS_TARGET == OS_NIX)
// Digit multiplication
#define MUL(multiplier, multiplicand, hi, lo) \This is because these |
|
This all looks good -- only issue remaining before merge seems to be
@dstebila : Do you still want this -- or is the ppc64le test via Travis enough? |
|
I've added the TravisCI config for ppc64le to #1048 (needs to be rebased after this merges). |
No processor extensions support. Tests are passed. Signed-off-by: Vitaly Chikunov <[email protected]>
No (AltiVec/VSX) processor extensions support is detected. Tests are passed. Note that `secure_cmp32` may require additional treatment for this architecture. Signed-off-by: Vitaly Chikunov <[email protected]>
|
Thanks @bhess. I've rebased onto main and am just waiting for the build to pass then it can be merged. |
As requested in #1019 (comment)
Two commits to support builds on x86 (
i686) and ppc64le, all algorithms are supposed to build as generic implementations.Tested and all tests are passing on ALT Linux. Our build logs (with tests run):
ps. These two commits are just
cherry-pick'ed from our downstream repo, with some conflict resolved for the second one.