summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-04-17 12:46:00 +0000
committerAndy Polyakov <appro@openssl.org>2011-04-17 12:46:00 +0000
commit5fabb88a7816f19090384e45bb8f2a22c7f290fb (patch)
tree0a90cb4d459b2d9dd08b334b50f02d479ebbcc72 /doc
parent764ef43962327c7252fd12d309bbf1cd86b95545 (diff)
Multiple assembler packs: add experimental memory bus instrumentation.
Diffstat (limited to 'doc')
-rw-r--r--doc/crypto/OPENSSL_instrument_bus.pod42
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/crypto/OPENSSL_instrument_bus.pod b/doc/crypto/OPENSSL_instrument_bus.pod
new file mode 100644
index 0000000000..539957b0bf
--- /dev/null
+++ b/doc/crypto/OPENSSL_instrument_bus.pod
@@ -0,0 +1,42 @@
+=pod
+
+=head1 NAME
+
+OPENSSL_instrument_bus[2] - instrument references to memory bus
+
+=head1 SYNOPSIS
+
+ #ifdef OPENSSL_CPUID_OBJ
+ size_t OPENSSL_instrument_bus (int *vector,size_t num);
+ size_t OPENSSL_instrument_bus2(int *vector,size_t num,size_t max);
+ #endif
+
+=head1 DESCRIPTION
+
+It was empirically found that timings of references to primary memory
+are subject to irregular, apparently non-deterministic variations. The
+subroutines in question instrument these references for purposes of
+gathering entropy for random number generator. In order to make it
+bus-bound a 'flush cache line' instruction is used between probes. In
+addition probes are added to B<vector> elements in atomic or
+interlocked manner, which should contribute additional noise on
+multi-processor systems. This also means that B<vector[num]> should be
+zeroed upon invocation (if you want to retrieve actual probe values).
+
+OPENSSL_instrument_bus performs B<num> probes and records the number of
+oscillator cycles every probe took.
+
+OPENSSL_instrument_bus2 on the other hand B<accumulates> consecutive
+probes with the same value, i.e. in a way it records duration of
+periods when probe values appeared deterministic. The subroutine
+performs at most B<max> probes in attempt to fill the B<vector[num]>,
+with B<max> value of 0 meaning "as many as it takes."
+
+=head1 RETURN VALUE
+
+Return value of 0 indicates that CPU is not capable of performing the
+benchmark, either because oscillator counter or 'flush cache line' is
+not available on current platform. For reference, on x86 'flush cache
+line' was introduced with the SSE2 extensions.
+
+Otherwise number of recorded values is returned.