m68k: write bootinfo as rom section and re-randomize on reboot
commit281ac13ecedf8bfe1b83e566f39cb5683e553cb6
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 23 Oct 2022 19:13:41 +0000 (23 21:13 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 24 Oct 2022 08:47:14 +0000 (24 10:47 +0200)
tree06c9f71d6fc14cde5df9d39d523a4cee919b74a2
parent693869a66ed7b49f2c790d88a25fc3d0ec791e0c
m68k: write bootinfo as rom section and re-randomize on reboot

Rather than poking directly into RAM, add the bootinfo block as a proper
ROM, so that it's restored when rebooting the system. This way, if the
guest corrupts any of the bootinfo items, but then tries to reboot,
it'll still be restored back to normal as expected.

Then, since the RNG seed needs to be fresh on each boot, regenerate the
RNG seed in the ROM when reseting the CPU.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Message-Id: <20221023191340.36238-1-Jason@zx2c4.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/m68k/bootinfo.h
hw/m68k/q800.c
hw/m68k/virt.c