All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: peter.maydell@linaro.org, pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 5/8] rx: re-randomize rng-seed on reboot
Date: Mon, 17 Oct 2022 22:50:18 +0900	[thread overview]
Message-ID: <87k04ylftx.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20221011204645.1160916-6-Jason@zx2c4.com>

On Wed, 12 Oct 2022 05:46:42 +0900,
Jason A. Donenfeld wrote:
> 
> 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..198d048964 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(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.37.3
> 

Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>

-- 
Yosinori Sato


  reply	other threads:[~2022-10-17 13:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 20:46 [PATCH v2 0/8] rerandomize RNG seeds on reboot and handle record&replay Jason A. Donenfeld
2022-10-11 20:46 ` [PATCH v2 1/8] device-tree: add re-randomization helper function Jason A. Donenfeld
2022-10-12  5:03   ` Alistair Francis
2022-10-11 20:46 ` [PATCH v2 2/8] arm: re-randomize rng-seed on reboot Jason A. Donenfeld
2022-10-11 20:46 ` [PATCH v2 3/8] riscv: " Jason A. Donenfeld
2022-10-12  5:04   ` Alistair Francis
2022-10-11 20:46 ` [PATCH v2 4/8] openrisc: " Jason A. Donenfeld
2022-10-11 20:46 ` [PATCH v2 5/8] rx: " Jason A. Donenfeld
2022-10-17 13:50   ` Yoshinori Sato [this message]
2022-10-11 20:46 ` [PATCH v2 6/8] mips: " Jason A. Donenfeld
2022-10-11 20:46 ` [PATCH v2 7/8] reset: allow registering handlers that aren't called by snapshot loading Jason A. Donenfeld
2022-10-11 20:50 ` [PATCH v2 8/8] reset: do not re-randomize RNG seed on snapshot load Jason A. Donenfeld
2022-10-13 18:13 ` [PATCH v2 0/8] rerandomize RNG seeds on reboot and handle record&replay Richard Henderson
2022-10-14  1:44   ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k04ylftx.wl-ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=Jason@zx2c4.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.