git: DragonFly_RELEASE_5_8 kernel - Reduce excessive rdrand harvesting

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Feb 28 09:16:46 PST 2020


commit ebd76cafb468afc4c0e08404c2c50f9c6a8735c2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Feb 13 21:39:17 2020 -0800

    kernel - Reduce excessive rdrand harvesting
    
    * Our rdrand driver harvests 512 bytes on each cpu thread at a rate
      of 10hz.  Ryzen CPUs appear to burn about 0.73uS per word, creating
      an overhead of about 460uS/sec on EACH cpu thread in the system.
    
      When added to the even higher overhead of the add_buffer_randomness()
      call, the result was a roughly 3% loss of performance across the board.
    
    * Reduce the harvest size to 16 bytes, which honestly is still plenty
      of entropy to inject.
    
    * Change some symbolic branch targets to local branch targets in the
      rdrand and padlock code to avoid generating symbols that can cause
      weird output in our PC sampler (I was getting 'loop+N' and 'out+N'
      while testing the above).

Summary of changes:
 sys/dev/crypto/padlock/rng_harvest_x86_64.S   |  8 ++++----
 sys/dev/crypto/rdrand/rdrand.c                | 14 +++++++++++++-
 sys/dev/crypto/rdrand/rdrand_harvest_x86_64.S |  8 ++++----
 3 files changed, 21 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ebd76cafb468afc4c0e08404c2c50f9c6a8735c2


-- 
DragonFly BSD source repository



More information about the Commits mailing list