All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH resend v3] hw/i386: pass RNG seed via setup_data entry
Date: Thu, 21 Jul 2022 11:47:29 +0200	[thread overview]
Message-ID: <YtkgsdmYbjnX5ZE0@zx2c4.com> (raw)
In-Reply-To: <06e60181-2f77-6f02-5015-fd14153efff3@redhat.com>

Hi Paolo,

Thanks for your review.

On Thu, Jul 21, 2022 at 11:19:40AM +0200, Paolo Bonzini wrote:
> The issue with live migration is that the setup data changes from before 
> to after the patches.  This means that a live migration exactly _in the 
> middle_ of reading the Linux boot data could fail badly.  For example, 
> you could migrate in the middle of reading the DTB, and it would be 
> shifted by the ~50 bytes of the setup_data and seed.  The size would 
> also not match so, even though probably things would mostly work if you 
> place the seed last, that's not really optimal either.

This doesn't really make sense to me, as I don't think the machine can
even be migrated during x86_load_linux(), and a migration will skip this
whole step anyway since this is mutable memory that a live kernel does
mutate.

However, what I'll do is reverse the order of these, so that the DTB is
added first, and I'll only set up the links in the right order so that
there's no potential race. I'll send a v+1 doing this shortly.

I would really very much prefer *not* adding a useless knob for this
feature, especially not one that's off by default. The idea is to
finally fix randomness for VMs globally in a non-invasive way, and
fixing the [implausible] race mentioned above seems like it'll do the
trick.

> variables of x86_load_linux into a struct for sharing.  As I said, it 
> snowballs a bit, but I should be sending out patches later today.

I'll send a patch, as mentioned above.

> As an aside, QEMU tends to only include code after Linux supports it, 
> but it's in your rng tree so the timing is right

This one is actually in "tip", which is the x86 tree, so it'll certainly
be in 5.20.

Jason


  reply	other threads:[~2022-07-21  9:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 14:54 [PATCH v3] hw/i386: pass RNG seed via setup_data entry Jason A. Donenfeld
2022-07-19 11:53 ` [PATCH resend " Jason A. Donenfeld
2022-07-20 13:03   ` Jason A. Donenfeld
2022-07-21  9:19     ` Paolo Bonzini
2022-07-21  9:47       ` Jason A. Donenfeld [this message]
2022-07-21  9:56         ` Jason A. Donenfeld
2022-07-21 10:09           ` [PATCH v4] " Jason A. Donenfeld
2022-07-21 10:35             ` Michael S. Tsirkin
2022-07-21 10:42               ` Jason A. Donenfeld
2022-07-21 10:47                 ` [PATCH v5] " Jason A. Donenfeld
2022-07-21 10:49                   ` [PATCH v6] " Jason A. Donenfeld
2022-07-21 11:00                     ` Michael S. Tsirkin
2022-07-21 11:00                       ` Jason A. Donenfeld
2022-07-21 11:47                       ` Paolo Bonzini
2022-07-21 12:16                         ` Jason A. Donenfeld
2022-07-21 12:27                           ` Daniel P. Berrangé
2022-07-21 12:41                             ` Paolo Bonzini
2022-07-21 12:52                               ` Jason A. Donenfeld
2022-07-21 12:56                                 ` [PATCH v7] " Jason A. Donenfeld
2022-07-21 13:00                                   ` Paolo Bonzini
2022-07-21 13:00                                   ` Paolo Bonzini
2022-07-21 13:04                                     ` Jason A. Donenfeld
2022-07-22  6:10                                       ` Paolo Bonzini

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=YtkgsdmYbjnX5ZE0@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=pbonzini@redhat.com \
    --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.