From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>
Cc: "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [PATCH RESEND] hw/microblaze: pass random seed to fdt
Date: Wed, 21 Sep 2022 12:32:37 +0200 [thread overview]
Message-ID: <CAHmME9rQWr5CTePKBT5nRi8OZXaBaRWQYDyNeSiSPwdzqBx2Hw@mail.gmail.com> (raw)
In-Reply-To: <20220908094030.189665-1-Jason@zx2c4.com>
On Thu, Sep 8, 2022 at 11:40 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to
> initialize early. Set this using the usual guest random number
> generation function. This FDT node is part of the DT specification.
>
> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> hw/microblaze/boot.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
> index 8b92a9801a..25ad54754e 100644
> --- a/hw/microblaze/boot.c
> +++ b/hw/microblaze/boot.c
> @@ -30,6 +30,7 @@
> #include "qemu/option.h"
> #include "qemu/config-file.h"
> #include "qemu/error-report.h"
> +#include "qemu/guest-random.h"
> #include "sysemu/device_tree.h"
> #include "sysemu/reset.h"
> #include "hw/boards.h"
> @@ -75,6 +76,7 @@ static int microblaze_load_dtb(hwaddr addr,
> int fdt_size;
> void *fdt = NULL;
> int r;
> + uint8_t rng_seed[32];
>
> if (dtb_filename) {
> fdt = load_device_tree(dtb_filename, &fdt_size);
> @@ -83,6 +85,9 @@ static int microblaze_load_dtb(hwaddr addr,
> return 0;
> }
>
> + qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed));
> + qemu_fdt_setprop(fdt, "/chosen", "rng-seed", rng_seed, sizeof(rng_seed));
> +
> if (kernel_cmdline) {
> r = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs",
> kernel_cmdline);
> --
> 2.37.3
>
Bumping this patch. Could somebody queue this up?
next prev parent reply other threads:[~2022-09-21 10:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 12:23 [PATCH] hw/microblaze: pass random seed to fdt Jason A. Donenfeld
2022-07-20 7:13 ` Edgar E. Iglesias
2022-07-21 16:43 ` Jason A. Donenfeld
2022-07-21 18:43 ` Edgar E. Iglesias
2022-07-27 1:49 ` Jason A. Donenfeld
2022-07-27 3:13 ` Richard Henderson
2022-07-27 11:51 ` Jason A. Donenfeld
2022-09-08 9:40 ` [PATCH RESEND] " Jason A. Donenfeld
2022-09-21 10:32 ` Jason A. Donenfeld [this message]
2022-09-21 20:27 ` Edgar E. Iglesias
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=CAHmME9rQWr5CTePKBT5nRi8OZXaBaRWQYDyNeSiSPwdzqBx2Hw@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=edgar.iglesias@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).