View previous topic :: View next topic |
Author |
Message |
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Nov 07, 2021 4:37 pm Post subject: Problems with urandom, haveged, and rng-tools |
|
|
I'm splitting this off from [solved] ACPI error, how to fix?
because it really is a separate topic. CPU is an AMD A8-7600 APU on a Gigabyte F2A88X-D3HP motherboard.
Urandom is used before initialization. Specifically udevd is using it.
Code: | # dmesg|grep random
[ 0.000000] random: get_random_u32 called from bsp_init_amd+0x173/0x218 with crng_init=0
[ 3.874664] random: fast init done
[ 4.143378] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.143867] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.221362] random: udevd: uninitialized urandom read (16 bytes read)
[ 5.850624] urandom_read: 2 callbacks suppressed
[ 5.850626] random: dd: uninitialized urandom read (512 bytes read)
[ 5.856097] random: mktemp: uninitialized urandom read (10 bytes read)
[ 7.289861] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.293168] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.424440] random: xdm: uninitialized urandom read (40 bytes read)
[ 9.772066] random: crng init done
|
I've tried haveged in both runlevel boot and default and rng-tools in runlevel boot (not at the same time).
Code: | # dmesg|grep random
[ 0.000000] random: get_random_u32 called from bsp_init_amd+0x173/0x218 with crng_init=0
[ 3.874664] random: fast init done
[ 4.143378] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.143867] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.221362] random: udevd: uninitialized urandom read (16 bytes read)
[ 5.850624] urandom_read: 2 callbacks suppressed
[ 5.850626] random: dd: uninitialized urandom read (512 bytes read)
[ 5.856097] random: mktemp: uninitialized urandom read (10 bytes read)
[ 7.289861] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.293168] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.424440] random: xdm: uninitialized urandom read (40 bytes read)
[ 9.772066] random: crng init done
| Full dmesg at http://dpaste.com/3KD3AT6V3
kernel config at http://dpaste.com/3KD3AT6V3
No initramfs, latest stable kernel 5.10.76 |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Sun Nov 07, 2021 4:46 pm Post subject: |
|
|
And what is your question ?
Those messages are interesting for kernel devs and volunteers who like to improve kernel boot phase. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6103 Location: Dallas area
|
Posted: Sun Nov 07, 2021 4:51 pm Post subject: |
|
|
for rng-tools I pass it the "-q" option via /etc/conf.d/rngd
Code: | $ tail -5 /etc/conf.d/rngd
# Any extra arguments for rngd
#
EXTRA_ARGS="-q" |
_________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Nov 07, 2021 6:10 pm Post subject: |
|
|
Added EXTRA_ARGS
Code: | ~ # dmesg|grep random
[ 0.000000] random: get_random_u32 called from bsp_init_amd+0x173/0x218 with crng_init=0
[ 3.865616] random: fast init done
[ 4.123751] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.124233] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.242734] random: udevd: uninitialized urandom read (16 bytes read)
[ 5.939040] urandom_read: 2 callbacks suppressed
[ 5.939051] random: mktemp: uninitialized urandom read (10 bytes read)
[ 5.942990] random: dd: uninitialized urandom read (512 bytes read)
[ 7.394760] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.397935] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[ 7.526383] random: xdm: uninitialized urandom read (40 bytes read)
[ 9.901947] random: crng init done
|
Code: | # zgrep RANDOM /proc/config.gz
# CONFIG_SLAB_FREELIST_RANDOM is not set
CONFIG_ARCH_RANDOM=y
# CONFIG_RANDOMIZE_BASE is not set
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_INTEL=y
CONFIG_HW_RANDOM_AMD=y
# CONFIG_HW_RANDOM_BA431 is not set
CONFIG_HW_RANDOM_VIA=y
# CONFIG_HW_RANDOM_XIPHERA is not set
CONFIG_RANDOM_TRUST_CPU=y
CONFIG_RANDOM_TRUST_BOOTLOADER=y
# CONFIG_RANDOM32_SELFTEST is not set
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
| I think I should drop that INTEL & VIA stuff. What other changes? |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6103 Location: Dallas area
|
Posted: Sun Nov 07, 2021 6:26 pm Post subject: |
|
|
Code: | $ grep RANDOM /usr/src/linux/.config
# CONFIG_SLAB_FREELIST_RANDOM is not set
CONFIG_ARCH_RANDOM=y
CONFIG_RANDOMIZE_BASE=y
CONFIG_RANDOMIZE_MEMORY=y
CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0x0
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_BA431 is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
CONFIG_HW_RANDOM_TPM=y
CONFIG_RANDOM_TRUST_CPU=y
CONFIG_RANDOM_TRUST_BOOTLOADER=y
# CONFIG_RANDOM32_SELFTEST is not set
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set |
The MB I use claims to have a tpm unit, so that's why I have that flag enabled.
Edit to add: use flags that I use on rng-tools
Code: | $ emerge -pv rng-tools
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild U ] sys-apps/rng-tools-6.14-r2::gentoo [6.14-r1::gentoo] USE="jitterentropy nistbeacon pkcs11 -rtlsdr (-selinux)" |
_________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sun Nov 07, 2021 9:55 pm Post subject: |
|
|
toralf wrote: | And what is your question ? |
This is Tony0945's crng:
Code: | [ 9.772066] random: crng init done |
And this is my crng:
Code: | [ 0.163516] random: crng done (trusting CPU's manufacturer) |
9.7 seconds is too long. The question is: how can Tony0945 lower his crng init time? |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6103 Location: Dallas area
|
Posted: Sun Nov 07, 2021 10:43 pm Post subject: |
|
|
Probably entropy related, if it gets low enough the system "hangs" until sufficient entropy is created.
If you think entropy might be the problem then doing something like hitting random keys on the keyboard or moving the mouse (a lot) while booting, will make it boot faster. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
|