summaryrefslogtreecommitdiffstats
path: root/patches/boot_time_opt/0118-give-rdrand-some-credit.patch
diff options
context:
space:
mode:
authorMartin Borg <martin.borg@enea.com>2018-03-23 14:01:03 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2018-03-26 09:57:31 +0200
commitc4bd5f6e084a6ced2c7a2f76798d0a34947ffeb7 (patch)
treee46d5f9bceca1947817b7739d366aa44faea9be1 /patches/boot_time_opt/0118-give-rdrand-some-credit.patch
parentdfc8946f58bbf4aa3a345c4fb5d5895502936edd (diff)
downloadenea-kernel-cache-c4bd5f6e084a6ced2c7a2f76798d0a34947ffeb7.tar.gz
boot_time_opt: update host boot time optimization patches for 4.14
The new patches are based on: https://github.com/clearlinux-pkgs/linux-lts commit 5595fe425a52af6734235a1a953b6b03210060ec Signed-off-by: Martin Borg <martin.borg@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'patches/boot_time_opt/0118-give-rdrand-some-credit.patch')
-rw-r--r--patches/boot_time_opt/0118-give-rdrand-some-credit.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/boot_time_opt/0118-give-rdrand-some-credit.patch b/patches/boot_time_opt/0118-give-rdrand-some-credit.patch
new file mode 100644
index 0000000..a7abd53
--- /dev/null
+++ b/patches/boot_time_opt/0118-give-rdrand-some-credit.patch
@@ -0,0 +1,30 @@
1From 7b90a7bba60360a4585cf317b092e266e6a81e76 Mon Sep 17 00:00:00 2001
2From: Arjan van de Ven <arjan@linux.intel.com>
3Date: Fri, 29 Jul 2016 19:10:52 +0000
4Subject: [PATCH 118/126] give rdrand some credit
5
6try to credit rdrand/rdseed with some entropy
7
8In VMs but even modern hardware, we're super starved for entropy, and while we can
9and do wear a tin foil hat, it's very hard to argue that
10rdrand and rdtsc add zero entropy.
11---
12 drivers/char/random.c | 2 ++
13 1 file changed, 2 insertions(+)
14
15diff --git a/drivers/char/random.c b/drivers/char/random.c
16index 8ad92707e45f..1729d2e733e5 100644
17--- a/drivers/char/random.c
18+++ b/drivers/char/random.c
19@@ -1666,6 +1666,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--
292.15.0
30