[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zeuk3ixlvMFg1CDo@liuwe-devbox-debian-v2>
Date: Fri, 8 Mar 2024 23:53:02 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Michael Kelley <mhklinux@...look.com>
Cc: "wei.liu@...nel.org" <wei.liu@...nel.org>,
"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
"decui@...rosoft.com" <decui@...rosoft.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"hpa@...or.com" <hpa@...or.com>, "arnd@...db.de" <arnd@...db.de>,
"tytso@....edu" <tytso@....edu>,
"Jason@...c4.com" <Jason@...c4.com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Saurabh Singh Sengar <ssengar@...rosoft.com>,
Long Li <longli@...rosoft.com>
Subject: Re: [PATCH 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random
number generator
On Wed, Mar 06, 2024 at 05:43:41PM +0000, Michael Kelley wrote:
> From: wei.liu@...nel.org @ 2024-03-04 6:57 UTC
> >
> > > +void __init ms_hyperv_late_init(void)
> > > +{
> > > + struct acpi_table_header *header;
> > > + acpi_status status;
> > > + u8 *randomdata;
> > > + u32 length, i;
> > > +
> > > + /*
> > > + * Seed the Linux random number generator with entropy provided by
> > > + * the Hyper-V host in ACPI table OEM0. It would be nice to do this
> > > + * even earlier in ms_hyperv_init_platform(), but the ACPI subsystem
> > > + * isn't set up at that point. Skip if booted via EFI as generic EFI
> > > + * code has already done some seeding using the EFI RNG protocol.
> > > + */
> > > + if (!IS_ENABLED(CONFIG_ACPI) || efi_enabled(EFI_BOOT))
> > > + return;
> > > +
> > > + status = acpi_get_table("OEM0", 0, &header);
> > > + if (ACPI_FAILURE(status) || !header) {
> > > + pr_info("Hyper-V: ACPI table OEM0 not found\n");
> >
> > I would like this to be a pr_debug() instead of pr_info(), considering
> > using the negative case may cause users to think not having this table
> > can be problematic.
> >
> > Alternatively, we can remove this message here, and then ...
> >
> > > + return;
> > > + }
> > > +
> >
> > ... add a pr_debug() here to indicate that the table was found.
> >
> > pr_info("Hyper-V: Seeding randomness with data from ACPI table OEM0\n");
>
> You wrote the code as "pr_info()" but your comment suggests "pr_debug()".
> I'm assuming pr_debug() is better because we don't really need any output
Yes, I meant to use pr_debug() here. Sorry for the confusion. The
pr_info() was a c&p error.
Thanks,
Wei.
Powered by blists - more mailing lists