From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8D9BC001E0 for ; Thu, 3 Aug 2023 07:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233833AbjHCHXW (ORCPT ); Thu, 3 Aug 2023 03:23:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjHCHXS (ORCPT ); Thu, 3 Aug 2023 03:23:18 -0400 Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D770B30C7; Thu, 3 Aug 2023 00:23:14 -0700 (PDT) Received: from [192.168.0.2] (ip5f5aeffd.dynamic.kabel-deutschland.de [95.90.239.253]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id D8BAA61E5FE05; Thu, 3 Aug 2023 09:22:43 +0200 (CEST) Message-ID: Date: Thu, 3 Aug 2023 09:22:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [PATCH 3/3] tpm: Drop CONFIG_HW_RANDOM_TPM To: Mario Limonciello Cc: jarkko@kernel.org, peterhuewe@gmx.de, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, Jason@zx2c4.com, dragonn@op.pl References: <20230803015015.915-1-mario.limonciello@amd.com> <20230803015015.915-4-mario.limonciello@amd.com> Content-Language: en-US From: Paul Menzel In-Reply-To: <20230803015015.915-4-mario.limonciello@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mario, Thank you for the patch. Am 03.08.23 um 03:50 schrieb Mario Limonciello: > As the behavior of whether a TPM is registered for hwrng can be controlled > by command line, drop the kernel configuration option. Shouldn’t this be left in to be able to set the default without having to change the Linux kernel command line? Kind regards Paul > Cc: Mateusz Schyboll > Signed-off-by: Mario Limonciello > --- > drivers/char/tpm/Kconfig | 11 ----------- > drivers/char/tpm/tpm-chip.c | 6 +++--- > 2 files changed, 3 insertions(+), 14 deletions(-) > > diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig > index 927088b2c3d3f..69aaa730dc208 100644 > --- a/drivers/char/tpm/Kconfig > +++ b/drivers/char/tpm/Kconfig > @@ -27,17 +27,6 @@ menuconfig TCG_TPM > > if TCG_TPM > > -config HW_RANDOM_TPM > - bool "TPM HW Random Number Generator support" > - depends on TCG_TPM && HW_RANDOM && !(TCG_TPM=y && HW_RANDOM=m) > - default y > - help > - This setting exposes the TPM's Random Number Generator as a hwrng > - device. This allows the kernel to collect randomness from the TPM at > - boot, and provides the TPM randomines in /dev/hwrng. > - > - If unsure, say Y. > - > config TCG_TIS_CORE > tristate > help > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c > index 8fb42232bd7a5..0d69335743469 100644 > --- a/drivers/char/tpm/tpm-chip.c > +++ b/drivers/char/tpm/tpm-chip.c > @@ -533,7 +533,7 @@ static int tpm_add_hwrng(struct tpm_chip *chip) > if (!trust_tpm) > chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; > > - if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM) || tpm_is_firmware_upgrade(chip) || > + if (tpm_is_firmware_upgrade(chip) || > chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED) > return 0; > > @@ -639,7 +639,7 @@ int tpm_chip_register(struct tpm_chip *chip) > return 0; > > out_hwrng: > - if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip) && > + if (!tpm_is_firmware_upgrade(chip) && > !(chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)) > hwrng_unregister(&chip->hwrng); > out_ppi: > @@ -665,7 +665,7 @@ EXPORT_SYMBOL_GPL(tpm_chip_register); > void tpm_chip_unregister(struct tpm_chip *chip) > { > tpm_del_legacy_sysfs(chip); > - if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip) && > + if (!tpm_is_firmware_upgrade(chip) && > !(chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)) > hwrng_unregister(&chip->hwrng); > tpm_bios_log_teardown(chip);