OSDN Git Service

hw/i386: pass RNG seed via setup_data entry
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 21 Jul 2022 12:56:36 +0000 (14:56 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Jul 2022 17:26:34 +0000 (19:26 +0200)
commit67f7e426e53833a5db75b0d813e8d537b8a75bd2
tree298a156beaf064924fe109524932123bc0b369eb
parentc287941a4dd5570e4221b0a58590f7231f896e51
hw/i386: pass RNG seed via setup_data entry

Tiny machines optimized for fast boot time generally don't use EFI,
which means a random seed has to be supplied some other way. For this
purpose, Linux (≥5.20) supports passing a seed in the setup_data table
with SETUP_RNG_SEED, specially intended for hypervisors, kexec, and
specialized bootloaders. The linked commit shows the upstream kernel
implementation.

At Paolo's request, we don't pass these to versioned machine types â‰¤7.0.

Link: https://git.kernel.org/tip/tip/c/68b8e9713c8
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Eduardo Habkost <eduardo@habkost.net>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Message-Id: <20220721125636.446842-1-Jason@zx2c4.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/microvm.c
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
hw/i386/x86.c
include/hw/i386/pc.h
include/hw/i386/x86.h
include/standard-headers/asm-x86/bootparam.h