diff options
author | Adrian Calianu <adrian.calianu@enea.com> | 2017-05-22 08:43:50 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2017-05-23 14:58:35 +0200 |
commit | 16b0e3313f53566481c106ace9992e477f8efe9b (patch) | |
tree | 5ec03a62db7836d2fb59813cb0c912751556c378 /patches/boot_time_opt/0120-give-rdrand-some-credit.patch | |
parent | 28da254d1c5ae012a6e064671aa14850c2a21a25 (diff) | |
download | enea-kernel-cache-16b0e3313f53566481c106ace9992e477f8efe9b.tar.gz |
patches: Boot time optimizations with ClearLinux patches
Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'patches/boot_time_opt/0120-give-rdrand-some-credit.patch')
-rw-r--r-- | patches/boot_time_opt/0120-give-rdrand-some-credit.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/boot_time_opt/0120-give-rdrand-some-credit.patch b/patches/boot_time_opt/0120-give-rdrand-some-credit.patch new file mode 100644 index 0000000..4b1669c --- /dev/null +++ b/patches/boot_time_opt/0120-give-rdrand-some-credit.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 5cc978db25b2c92707f68b15098ac39901fb5aac Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Fri, 29 Jul 2016 19:10:52 +0000 | ||
4 | Subject: [PATCH 120/124] give rdrand some credit | ||
5 | |||
6 | try to credit rdrand/rdseed with some entropy | ||
7 | |||
8 | In VMs but even modern hardware, we're super starved for entropy, and while we can | ||
9 | and do wear a tin foil hat, it's very hard to argue that | ||
10 | rdrand and rdtsc add zero entropy. | ||
11 | --- | ||
12 | drivers/char/random.c | 2 ++ | ||
13 | 1 file changed, 2 insertions(+) | ||
14 | |||
15 | diff --git a/drivers/char/random.c b/drivers/char/random.c | ||
16 | index d6876d506220..fca09af81b2c 100644 | ||
17 | --- a/drivers/char/random.c | ||
18 | +++ b/drivers/char/random.c | ||
19 | @@ -1638,6 +1638,8 @@ static void init_std_data(struct entropy_store *r) | ||
20 | if (!arch_get_random_seed_long(&rv) && | ||
21 | !arch_get_random_long(&rv)) | ||
22 | rv = random_get_entropy(); | ||
23 | + else | ||
24 | + credit_entropy_bits(r, 1); | ||
25 | mix_pool_bytes(r, &rv, sizeof(rv)); | ||
26 | } | ||
27 | mix_pool_bytes(r, utsname(), sizeof(*(utsname()))); | ||
28 | -- | ||
29 | 2.11.1 | ||
30 | |||