Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp904872lqc; Fri, 8 Mar 2024 15:53:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX5dXBHNtbRGZlXRKy55GHGbNlf3S5umYz89jxFZLq60boVcbqXjlVJd/flZKgxUa+9R5+Xp27oqxDuc99l14My4cy+/zmKhnYGsTsAEw== X-Google-Smtp-Source: AGHT+IGBUgbf0l0hhfGybiB46JHQ4kmLZuZ2L3IS4V0QEbs9U+EP3QZq8hjCtLPzDH04gHCK2Grs X-Received: by 2002:a05:6a20:6697:b0:1a1:44fe:345b with SMTP id o23-20020a056a20669700b001a144fe345bmr207169pzh.22.1709941999039; Fri, 08 Mar 2024 15:53:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709941999; cv=pass; d=google.com; s=arc-20160816; b=gpiJJpvuPvfakmSSG/WUf2Di/h5Lidykpo6W/qoYkXYN7yqt2SDZmzJyswRXv+QZHV ooyT4hSY2pZawZajKafZ5RUhq8wQemzjg4gYzK9595afdN61lsj3Sy3fY5SzyrZwmTgN n3RJRYDg+VwLRjH/z6pwk9hlccR+UCLGQWIIR/O6RGPUG7wgZwtOxrdHqd6JWriIUSLm TXWQNIS8e1fERqRhCPQzXqdPgDJTRDh/V78nWMeP3AXqcxMPx7PllVg24dQffME/BWoj rL0QyeCdSZi+qn0N8/NnPIHAkvsU8nW0p76ty46g1SuwgjTq99Zse49Pa8PUg6zjHR9N VcDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=qAaAtnWUg1rxpdk1BKsVfiXox0rISjedblr07JGTkYA=; fh=4bOQ1x4TDxO+m4kOPGJMDkeLx4OHz/asv3jEQyBLZs8=; b=E4/932iHe0dDYjhlhu+VZGPozv4sIOAl94v7qPmXz/NwiI+qqod3NWBVlW+OmDg/C8 DK4GDiSG/i8t382faaDz06PqqOG+YYQgpQanMnpfkte9bJeAACbhub7tWx6UaLFFbRy3 lselVotRCXpW9Vurrudk8OW4Jmop9P85pwyQx1miQ2SOLxb8m2ENP7zUB2UNf+j5FacQ K4fZAp6wJELnGeHInLmKAf99uNUi/nK8WwEMoUAsrgVQyKCPLOiiTTJ3yRgOS813flrM fld/BkC2kQPvHBHE/+FMX1qC5NXaYCSdPNinoKWkPbfKfCibsbiRQ/cQwSy5pn7v8iqc +omA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-97698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ei14-20020a056a0080ce00b006e66b29068dsi451128pfb.41.2024.03.08.15.53.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 15:53:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-97698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3C7BCB21EDE for ; Fri, 8 Mar 2024 23:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E1AC3FB82; Fri, 8 Mar 2024 23:53:10 +0000 (UTC) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A8B623769; Fri, 8 Mar 2024 23:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709941989; cv=none; b=mEsCvpZO/xGxHdy54eTcpxT9qN8sraMn1Cs5lZa2/8ykPFAEnWsbN0vaJ4NVgCLfDdBJrQ3XLOhMw+GMDe0L/TbOy0zeJqm+0/9WcaSaZ1Awhkw+Cr0hTZIA8UL7sKRoRqAcE6o4r9C73S2AkZZihEBDMBq2KLptrv2Dd0YqGb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709941989; c=relaxed/simple; bh=t8OA91R3kyR2UyyWnJ2g3tEc5o5p3PwzgyzGpkHmokU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SuRbDiUIYOX9Ps5JO0FjehJ4zPdugp8aTf8K/m6oyjM6S2WQUwVl/kUL/0q8H5Ukmvoh80xREkX/kqRlGMF+XSh/io0VmBSMorI8EidpOe+hBCEPAGmH/ScPieA/V0oynobYsWOds2zoJ0fo2pn2TxpywcGJqB46QDnvzD1roYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso2154395a12.3; Fri, 08 Mar 2024 15:53:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709941988; x=1710546788; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qAaAtnWUg1rxpdk1BKsVfiXox0rISjedblr07JGTkYA=; b=IDgKU9tNmT0Ao7TVwJZGynHeYEsQpbEvgk4C9AZk7O4NcxU4TH8sVaWgwdN3ErLqw8 jjUm3TvSX97sHxUhZVFcCjS1b4j70K3nmVhUdW6Jj1N8YxdHsLOAktGTT8cY3rylMyPh BowQ74/w7Zk5C9/7c9tTHsRXrDfIvq9N5AsNdDmqiG9VYkNIOdyMTTupcD/lxEDuYv3y K5WsVXWRwCWYcrFoJ0rY4NHHMREN7l0MQOR4dvq/am4LTbrHhTppn5xNXWB2qx/qoXXy c+/fiSHE/1Cf8fxnFMSol/DYUReKP1YbhkCeY3P2Glao0GYQQoC7pm+Pv5ohqJWEVsto cglg== X-Forwarded-Encrypted: i=1; AJvYcCWP5TAuy+NeQ7TRVXuav/21idlIT6CnYpEOErjLOcFpCz0AJtWxZi+gc0yROTwEubM+Uiaa5aDmAZp3wKlvi0fGEbQkfAVE48Cs7onUEy4L7Ut8uLlFbSrgAgDUMjZNffV2d9LP5vJt236C3SVWUDc3h2R5jhYDmSGEi5W6IhNqcSFvN92LhQ== X-Gm-Message-State: AOJu0YyiqhcnNIaHFNMjMAKXdaQ/e+ezStIt1XfcMgEqecgdvBhfOC1Y fGXxFllgO7smG6vspWyDpyJ3JfaIzwrNhoqK4hHaNTHJU9yCLM96 X-Received: by 2002:a05:6a20:3424:b0:1a1:2fda:e785 with SMTP id i36-20020a056a20342400b001a12fdae785mr223595pzd.23.1709941987631; Fri, 08 Mar 2024 15:53:07 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id u9-20020a62d449000000b006e57a3bf0e9sm263058pfl.82.2024.03.08.15.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 15:53:07 -0800 (PST) Date: Fri, 8 Mar 2024 23:53:02 +0000 From: Wei Liu To: Michael Kelley Cc: "wei.liu@kernel.org" , "haiyangz@microsoft.com" , "decui@microsoft.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "arnd@arndb.de" , "tytso@mit.edu" , "Jason@zx2c4.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-arch@vger.kernel.org" , Saurabh Singh Sengar , Long Li Subject: Re: [PATCH 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random number generator Message-ID: References: <20240122160003.348521-1-mhklinux@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 06, 2024 at 05:43:41PM +0000, Michael Kelley wrote: > From: wei.liu@kernel.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.