Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1868328rwo; Thu, 3 Aug 2023 00:33:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEK3E3MgIgFKBD12ASpQaR3KRHZThvMmCPFIYzEs0JVBREexC5mkJ7kZ33MmoH5dAIQVbV/ X-Received: by 2002:a17:906:3281:b0:97d:2bcc:47d5 with SMTP id 1-20020a170906328100b0097d2bcc47d5mr6103570ejw.49.1691048033610; Thu, 03 Aug 2023 00:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691048033; cv=none; d=google.com; s=arc-20160816; b=HF6SG8ix4DJl3njPX10LjqB6Uyo0/1zjD4Xdyw/liSbQdl7h7uq5JcTSOO5Ix0sSQP RmIrdCFdiMqFab4ZO23dw3Fbp7QsUj1tYMvB2cFgyDrpVBUuiL7Hp87Sh8sX5XE+EGP+ FVJwG6eEnCJLSLxJb0hSb+heVGy5n9cc9GTpfRGUKMBh+uqnM15L0ZDRW43MGZzJU2du R/VRCueaY2FC3Cqg8qNwiYWdry58nmZh/bHde+jx3PM2+9m3Fs4cHpxVPAwQ1l5kpfQA vHnrietoh4lXfHGD4jBhiHnxYDMZdFAV4U1NJ3fiKn1KZWjTHNnxgQUXkQb86TOg/cH5 qtvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=bQ5RkueqBjeENRKXkDBBfwQVqaHDwgLZtnFa3ATN1wc=; fh=nEYj0EQalJ7eEWsueDow5l9wo3Ro+DpZN1ecBAs9Fes=; b=O1LcbsmSNdozrCj8TsJQaMHTPyLHN7tErsSZfa7bHCo4asQDy6Of3qSiX52du8u8wX 191tntmNQmydAYhBOTZROUXunzp2X+LdQtknA0yUqaH4K1ppOszRG1mkucu4iVncyMT4 RgGHtuovX8D2VHPFM1IQzNTV8b8As8NoDcF13olUQbh2/Qz4pxim4hxYTft4ma2CJ0p8 hyos/hY2H9OfgyYOHnSnBdc0QPOzH7e+9kO/rm3ovshUsWWWzjNY19fzhL9/uw/zs6Mx ZnzXbxM11RF4cMZJ59Pocc3x9/030WceGYSqHWc50ufABtNoIWLoIVnvACNYs8Sewom1 oC4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg21-20020a170906f89500b00991bd84725asi644987ejb.227.2023.08.03.00.33.27; Thu, 03 Aug 2023 00:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233828AbjHCHXV (ORCPT + 99 others); Thu, 3 Aug 2023 03:23:21 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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);