diff mbox series

x86: geode: use kernel [hwrng] to provide randomness

Message ID 20220121091905.3308-1-fercerpav@gmail.com
State Rejected
Delegated to: Petr Štetiar
Headers show
Series x86: geode: use kernel [hwrng] to provide randomness | expand

Commit Message

Paul Fertser Jan. 21, 2022, 9:19 a.m. UTC
Following the idea from 7747b3fa36d3 ("generic: add bcm2835-rng quality
patch") and 9dc84018eeef ("bcm27xx: remove urngd package") this patch
allows kernel to directly use HW RNG and provide enough entropy from
/dev/random without urngd and/or rng-tools.

I am not sending this upstream as I have no idea how to estimate quality
properly.

Tested-by: timur_davletshin
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
 target/linux/x86/geode/target.mk                     |  1 +
 .../960-hwrng-geode-set-quality-to-1000.patch        | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch

Comments

Alexey Smirnov Jan. 24, 2022, 10:58 a.m. UTC | #1
I wonder, does it applicable for all targets with HW RNG support?
Is it necessary to have quality of HW RNG not less than 1000 for kernel
to use /dev/hwrng directly without user space tools like rng-tools?
Petr Štetiar Feb. 19, 2022, 10:22 a.m. UTC | #2
Paul Fertser <fercerpav@gmail.com> [2022-01-21 12:19:05]:

Hi,

> I am not sending this upstream as I have no idea how to estimate quality
> properly.

ok, but please note, that until then, it's not even good enough material for OpenWrt either.
For example, check this https://patchwork.kernel.org/project/linux-crypto/patch/20200727124552.4336-1-ceggers@arri.de/

Cheers,

Petr
diff mbox series

Patch

diff --git a/target/linux/x86/geode/target.mk b/target/linux/x86/geode/target.mk
index a64d2baaeec2..1ca0de2fbe49 100644
--- a/target/linux/x86/geode/target.mk
+++ b/target/linux/x86/geode/target.mk
@@ -1,5 +1,6 @@ 
 BOARDNAME:=AMD Geode based systems
 FEATURES += pci usb gpio
+DEFAULT_PACKAGES := $(filter-out urngd,$(DEFAULT_PACKAGES))
 
 define Target/Description
 	Build firmware images for AMD Geode GX/LX based systems (net5501, alix, geos)
diff --git a/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch b/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch
new file mode 100644
index 000000000000..de1435b20bc9
--- /dev/null
+++ b/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch
@@ -0,0 +1,12 @@ 
+Index: linux-5.10.92/drivers/char/hw_random/geode-rng.c
+===================================================================
+--- linux-5.10.92.orig/drivers/char/hw_random/geode-rng.c
++++ linux-5.10.92/drivers/char/hw_random/geode-rng.c
+@@ -80,6 +80,7 @@ static struct hwrng geode_rng = {
+ 	.name		= "geode",
+ 	.data_present	= geode_rng_data_present,
+ 	.data_read	= geode_rng_data_read,
++	.quality	= 1000,
+ };
+ 
+