aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/main.c b/main.c
index af8c773..0a3b1e0 100644
--- a/main.c
+++ b/main.c
@@ -62,17 +62,8 @@ static __always_inline int name(void) \
} while (0)
-declare_it(donna64)
-declare_it(hacl64)
-declare_it(fiat64)
-declare_it(sandy2x)
-declare_it(amd64)
-declare_it(precomp_bmi2)
declare_it(precomp_adx)
declare_it(ever64)
-declare_it(fiat32)
-declare_it(donna32)
-declare_it(tweetnacl)
static int compare_cycles(const void *a, const void *b)
{
@@ -86,22 +77,10 @@ static bool verify(void)
u8 out[CURVE25519_POINT_SIZE];
for (i = 0; i < ARRAY_SIZE(curve25519_test_vectors); ++i) {
- test_it(donna64, {}, {});
- test_it(hacl64, {}, {});
- test_it(fiat64, {}, {});
- if (boot_cpu_has(X86_FEATURE_AVX) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL))
- test_it(sandy2x, kernel_fpu_begin(), kernel_fpu_end());
- if (boot_cpu_has(X86_FEATURE_BMI2))
- test_it(precomp_bmi2, {}, {});
if (boot_cpu_has(X86_FEATURE_BMI2) && boot_cpu_has(X86_FEATURE_ADX)) {
test_it(precomp_adx, {}, {});
test_it(ever64, {}, {});
}
- if (dangerous)
- test_it(amd64, {}, {});
- test_it(fiat32, {}, {});
- test_it(donna32, {}, {});
- test_it(tweetnacl, {}, {});
}
return true;
}
@@ -111,17 +90,8 @@ static int __init mod_init(void)
enum { WARMUP = 6000, TRIALS = 5000, IDLE = 1 * 1000 };
int ret = 0, i;
cycles_t *trial_times;
- cycles_t median_donna64 = 0;
- cycles_t median_hacl64 = 0;
- cycles_t median_fiat64 = 0;
- cycles_t median_sandy2x = 0;
- cycles_t median_amd64 = 0;
- cycles_t median_precomp_bmi2 = 0;
cycles_t median_precomp_adx = 0;
cycles_t median_ever64 = 0;
- cycles_t median_fiat32 = 0;
- cycles_t median_donna32 = 0;
- cycles_t median_tweetnacl = 0;
unsigned long flags;
DEFINE_SPINLOCK(lock);
@@ -135,46 +105,16 @@ static int __init mod_init(void)
msleep(IDLE);
spin_lock_irqsave(&lock, flags);
-
- do_it(donna64);
- do_it(hacl64);
- do_it(fiat64);
- if (boot_cpu_has(X86_FEATURE_AVX) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) {
- kernel_fpu_begin();
- do_it(sandy2x);
- kernel_fpu_end();
- }
- if (boot_cpu_has(X86_FEATURE_BMI2))
- do_it(precomp_bmi2);
if (boot_cpu_has(X86_FEATURE_BMI2) && boot_cpu_has(X86_FEATURE_ADX)) {
do_it(precomp_adx);
do_it(ever64);
}
- if (dangerous)
- do_it(amd64);
- do_it(fiat32);
- do_it(donna32);
- do_it(tweetnacl);
-
spin_unlock_irqrestore(&lock, flags);
- report_it(donna64);
- report_it(hacl64);
- report_it(fiat64);
- if (boot_cpu_has(X86_FEATURE_AVX) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL))
- report_it(sandy2x);
- if (boot_cpu_has(X86_FEATURE_BMI2))
- report_it(precomp_bmi2);
if (boot_cpu_has(X86_FEATURE_BMI2) && boot_cpu_has(X86_FEATURE_ADX)) {
report_it(precomp_adx);
report_it(ever64);
}
- if (dangerous)
- report_it(amd64);
- report_it(fiat32);
- report_it(donna32);
- report_it(tweetnacl);
-
/* Don't let compiler be too clever. */
dummy = ret;
kfree(trial_times);