Skip to content

Commit

Permalink
linux: Update to version 4.19.1
Browse files Browse the repository at this point in the history
This is a major kernel version update from 4.18 to 4.19 LTS.

While at it, make a few cosmetic improvements to the rdrand-rng
driver:

 - Make the error message more informative -- i.e., make it known that
   the unavailability of RDSEED/RDRAND is tied to the underlying CPU,
   and is not a kernel bug.

 - Also, log the message using pr_info() rather than pr_err(), because
   it is not an error as such -- systems with CPUs that don't support
   RDSEED/RDRAND cannot load this driver, and that is fine.

Change-Id: I06786750ede3977ec94eec03647ed499692d597f
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6118
Tested-by: gerrit-photon <[email protected]>
Reviewed-by: Alexey Makhalov <[email protected]>
  • Loading branch information
srivatsabhat authored and Srivatsa S. Bhat committed Nov 12, 2018
1 parent e690438 commit 1e95c64
Show file tree
Hide file tree
Showing 5 changed files with 3,950 additions and 3,888 deletions.
6 changes: 4 additions & 2 deletions SPECS/linux-api-headers/linux-api-headers.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Summary: Linux API header files
Name: linux-api-headers
Version: 4.18.9
Version: 4.19.1
Release: 1%{?dist}
License: GPLv2
URL: http://www.kernel.org/
Group: System Environment/Kernel
Vendor: VMware, Inc.
Distribution: Photon
Source0: http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
%define sha1 linux=229ed4bedc5b8256bdd761845b1d7e20e1df12d7
%define sha1 linux=5ece7a7149eeef06bba906eeabbc2f29a8ac3952
BuildArch: noarch
%description
The Linux API Headers expose the kernel's API for use by Glibc.
Expand All @@ -25,6 +25,8 @@ find /%{buildroot}%{_includedir} \( -name .install -o -name ..install.cmd \) -de
%defattr(-,root,root)
%{_includedir}/*
%changelog
* Mon Nov 05 2018 Srivatsa S. Bhat (VMware) <[email protected]> 4.19.1-1
- Update to version 4.19.1
* Thu Sep 20 2018 Srivatsa S. Bhat <[email protected]> 4.18.9-1
- Update to version 4.18.9
* Wed Sep 19 2018 Srivatsa S. Bhat <[email protected]> 4.14.67-1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From 0fd09a9a3418124e59cded88699d4c6bcdb811b2 Mon Sep 17 00:00:00 2001
From: "Srivatsa S. Bhat" <[email protected]>
From: "Srivatsa S. Bhat (VMware)" <[email protected]>
Date: Tue, 18 Sep 2018 18:33:06 -0700
Subject: [PATCH] hwrng: rdrand - Add RNG driver based on x86 rdrand
instruction
Expand All @@ -10,16 +10,16 @@ rdrand/rdseed instructions available on modern Intel and AMD CPUs.
This can be used to feed the kernel's entropy pool on entropy-starved
virtual machines.

Signed-off-by: Srivatsa S. Bhat <[email protected]>
Signed-off-by: Srivatsa S. Bhat (VMware) <[email protected]>
---
drivers/char/hw_random/Kconfig | 14 ++++++++
drivers/char/hw_random/Kconfig | 14 +++++++
drivers/char/hw_random/Makefile | 1 +
drivers/char/hw_random/rdrand-rng.c | 72 +++++++++++++++++++++++++++++++++++++
3 files changed, 87 insertions(+)
drivers/char/hw_random/rdrand-rng.c | 73 +++++++++++++++++++++++++++++++++++++
3 files changed, 88 insertions(+)
create mode 100644 drivers/char/hw_random/rdrand-rng.c

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 95a031e..c7e7ce7 100644
index dac895d..e6d4fad 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -60,6 +60,20 @@ config HW_RANDOM_AMD
Expand Down Expand Up @@ -57,16 +57,16 @@ index e35ec3c..eda6b15 100644
obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o
diff --git a/drivers/char/hw_random/rdrand-rng.c b/drivers/char/hw_random/rdrand-rng.c
new file mode 100644
index 0000000..ba017f3
index 0000000..a2011de
--- /dev/null
+++ b/drivers/char/hw_random/rdrand-rng.c
@@ -0,0 +1,72 @@
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * RNG driver that uses the RDRAND/RDSEED instructions (found on modern
+ * Intel and AMD CPUs).
+ *
+ * Author: Srivatsa S. Bhat <[email protected]>
+ * Author: Srivatsa S. Bhat (VMware) <[email protected]>
+ *
+ */
+
Expand Down Expand Up @@ -111,7 +111,8 @@ index 0000000..ba017f3
+ int err = -ENODEV;
+
+ if (!arch_has_random_seed() && !arch_has_random()) {
+ pr_err(PFX "Neither RDSEED nor RDRAND is available.\n");
+ pr_info(PFX "Cannot load module, as your CPU does not "
+ "support RDSEED or RDRAND instructions.\n");
+ return err;
+ }
+
Expand All @@ -130,7 +131,7 @@ index 0000000..ba017f3
+module_init(mod_init);
+module_exit(mod_exit);
+
+MODULE_AUTHOR("Srivatsa S. Bhat <[email protected]>");
+MODULE_AUTHOR("Srivatsa S. Bhat (VMware) <[email protected]>");
+MODULE_DESCRIPTION("H/W RNG driver for x86 CPUs that support RDRAND/RDSEED");
+MODULE_LICENSE("GPL");
--
Expand Down
Loading

0 comments on commit 1e95c64

Please sign in to comment.