summaryrefslogtreecommitdiffstats
path: root/hw/m68k
diff options
context:
space:
mode:
authorJason A. Donenfeld2022-09-26 13:38:59 +0200
committerLaurent Vivier2022-10-21 20:46:10 +0200
commit693869a66ed7b49f2c790d88a25fc3d0ec791e0c (patch)
treec76a93e545ecbfd16edcd87e0dd8c7bedde98970 /hw/m68k
parentMerge tag 'pull-target-arm-20221020' of https://git.linaro.org/people/pmaydel... (diff)
downloadqemu-693869a66ed7b49f2c790d88a25fc3d0ec791e0c.tar.gz
qemu-693869a66ed7b49f2c790d88a25fc3d0ec791e0c.tar.xz
qemu-693869a66ed7b49f2c790d88a25fc3d0ec791e0c.zip
m68k: rework BI_VIRT_RNG_SEED as BI_RNG_SEED
Following a change on the kernel side (see link), pass BI_RNG_SEED instead of BI_VIRT_RNG_SEED. This should have no impact on compatibility, as there will simply be no effect if it's an old kernel, which is how things have always been. We then use this as an opportunity to add this to q800, since now we can, which is a nice improvement. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Laurent Vivier <laurent@vivier.eu> Link: https://lore.kernel.org/lkml/20220923170340.4099226-3-Jason@zx2c4.com/ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Message-Id: <20220926113900.1256630-1-Jason@zx2c4.com> [lv: s/^I/ /g] Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/m68k')
-rw-r--r--hw/m68k/q800.c7
-rw-r--r--hw/m68k/virt.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 101ab0f803..a4590c2cb0 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -23,6 +23,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qemu/datadir.h"
+#include "qemu/guest-random.h"
#include "sysemu/sysemu.h"
#include "cpu.h"
#include "hw/boards.h"
@@ -385,6 +386,7 @@ static void q800_init(MachineState *machine)
NubusBus *nubus;
DeviceState *glue;
DriveInfo *dinfo;
+ uint8_t rng_seed[32];
linux_boot = (kernel_filename != NULL);
@@ -634,6 +636,11 @@ static void q800_init(MachineState *machine)
kernel_cmdline);
}
+ /* Pass seed to RNG. */
+ qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed));
+ BOOTINFODATA(cs->as, parameters_base, BI_RNG_SEED,
+ rng_seed, sizeof(rng_seed));
+
/* load initrd */
if (initrd_filename) {
initrd_size = get_image_size(initrd_filename);
diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c
index 2f3ffc0de6..f7b903ea1b 100644
--- a/hw/m68k/virt.c
+++ b/hw/m68k/virt.c
@@ -248,10 +248,10 @@ static void virt_init(MachineState *machine)
kernel_cmdline);
}
- /* Pass seed to RNG. */
- qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed));
- BOOTINFODATA(cs->as, parameters_base, BI_VIRT_RNG_SEED,
- rng_seed, sizeof(rng_seed));
+ /* Pass seed to RNG. */
+ qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed));
+ BOOTINFODATA(cs->as, parameters_base, BI_RNG_SEED,
+ rng_seed, sizeof(rng_seed));
/* load initrd */
if (initrd_filename) {