[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 11/11] rx: re-randomize rng-seed on reboot
From: |
Jason A. Donenfeld |
Subject: |
[PATCH v4 11/11] rx: re-randomize rng-seed on reboot |
Date: |
Tue, 25 Oct 2022 02:43:27 +0200 |
When the system reboots, the rng-seed that the FDT has should be
re-randomized, so that the new boot gets a new seed. Since the FDT is in
the ROM region at this point, we add a hook right after the ROM has been
added, so that we have a pointer to that copy of the FDT.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
hw/rx/rx-gdbsim.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
index 8ffe1b8035..47c17026c7 100644
--- a/hw/rx/rx-gdbsim.c
+++ b/hw/rx/rx-gdbsim.c
@@ -25,6 +25,7 @@
#include "hw/rx/rx62n.h"
#include "sysemu/qtest.h"
#include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
#include "hw/boards.h"
#include "qom/object.h"
@@ -148,6 +149,8 @@ static void rx_gdbsim_init(MachineState *machine)
dtb_offset = ROUND_DOWN(machine->ram_size - dtb_size, 16);
rom_add_blob_fixed("dtb", dtb, dtb_size,
SDRAM_BASE + dtb_offset);
+ qemu_register_reset_nosnapshotload(qemu_fdt_randomize_seeds,
+ rom_ptr(SDRAM_BASE + dtb_offset, dtb_size));
/* Set dtb address to R1 */
RX_CPU(first_cpu)->env.regs[1] = SDRAM_BASE + dtb_offset;
}
--
2.38.1
- [PATCH v4 04/11] arm: re-randomize rng-seed on reboot, (continued)
- [PATCH v4 04/11] arm: re-randomize rng-seed on reboot, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 05/11] riscv: re-randomize rng-seed on reboot, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 07/11] m68k/q800: do not re-randomize RNG seed on snapshot load, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 08/11] mips/boston: re-randomize rng-seed on reboot, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 09/11] mips/malta: pass RNG seed via env var and re-randomize on reboot, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 06/11] m68k/virt: do not re-randomize RNG seed on snapshot load, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 10/11] openrisc: re-randomize rng-seed on reboot, Jason A. Donenfeld, 2022/10/24
- [PATCH v4 11/11] rx: re-randomize rng-seed on reboot,
Jason A. Donenfeld <=
- Re: [PATCH v4 00/11] rerandomize RNG seeds on reboot and handle record&replay, Peter Maydell, 2022/10/25