[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] pc: add property for Linux setup_data random number seed
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH v2] pc: add property for Linux setup_data random number seed |
Date: |
Fri, 5 Aug 2022 04:19:53 -0400 |
On Fri, Aug 05, 2022 at 10:16:37AM +0200, Paolo Bonzini wrote:
> On 8/5/22 09:01, Michael S. Tsirkin wrote:
> > > - if (!legacy_no_rng_seed) {
> > > + if (x86ms->linuxboot_randomness != ON_OFF_AUTO_OFF &&
> > > + (protocol >= 0x209 || x86ms->linuxboot_randomness ==
> > > ON_OFF_AUTO_ON)) {
> > Hmm so if user requested "on" but protocol is too old then we just
> > ignore it silently? I'd rather we failed initialization.
> > So:
> >
> > if (x86ms->linuxboot_randomness == ON_OFF_AUTO_ON &&
> > protocol < 0x209) {
> > fprintf(stderr, "qemu: Linux kernel too old to load a dtb\n");
> > exit(1);
> > }
>
> It doesn't ignore the "on" setting; it passes the seed anyway even if the
> protocol is too old. Basically, a kernel that is too old to support setup
> data is treated the same as a kernel that supports setup data but doesn't
> know about the seed datum.
Oh it's an || not an &&. You are right. I needed more coffee.
> It seemed the more sensible implementation because anyway you cannot know if
> the kernel will use the datum.
>
> Paolo
OK then.
--
MST