Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1975078rwo; Thu, 3 Aug 2023 02:53:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHm3cGgt6AySyrvMxBha/mAg0EPmz2fjvuubQNKDq9MQr4ckOrcx9ySRs+ceXy8qhrGzWYw X-Received: by 2002:a05:6a20:7353:b0:137:bc72:9c08 with SMTP id v19-20020a056a20735300b00137bc729c08mr18598678pzc.16.1691056412658; Thu, 03 Aug 2023 02:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691056412; cv=none; d=google.com; s=arc-20160816; b=0UVwZh8u92pb26aYvedII6TRMqtY0Qiu3m31FeO+Tp52AQ8IwY7h3WvDjdfXNPbZog MY9HyKpOGRQV6QVDpbVMwmwLRcmMJR2iigjs8VkWXcU2EoDHH+Fyni+3v+yOo9HxPQEv otwBAnm2GR2QlUhSR9JUxlLKNz8hTWH+hinXGCWuwKKZKt8JEFtrULaAR7vhURt/RTsH 0TmKN0uUUmvIozxtAR+cKFhyvqRalLJr9MqAqA3fsuQl5AKySHxD/vl465SjT0uN+vnJ bn0dWWziwn1bP7ASvUCKfbRkL2GiZF5ldPLo1qDi97WTQgkxskInChomGlsUTCpm1xhy F+zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:from:subject:cc:to :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=4UdpfOJFd2YR04Z0ltoIBa4XOa7Q2/afmS0aAibZNmk=; fh=xgSdZXtpTpFDSQRHzT5PQvADrWeHXMSlcHqTdkiRy7o=; b=H8SvLHGEOQ9zLM5/G5xDpw0oFCh/Yqy996Pk7qOmVqXohfVmsv9jY/d03gOXchxmhA bq+qH+UiimCgXDHP1wKtWAPUvq539G/cs0mD77bimM+W8pn7a5zqO2LNqGWKBm5dR/IU +G2xL5m3u+CFQaSiEVO1Kiyup3YI2sN2sYof3ZleCo8evloloCLu27PqMGXGvIRokOe9 FdYi2hlcRAhWil0Q5/5HK5eOfXZfSogT2jy09kCn1KhH4sw6zE2PUJXXiBkRJSShRPmt SH1cisKYiyN0hAj3imq0k66izUwH9z9Qd2tjJ3P3XZHU3yg0yl2yPbe7M3rCFb0kzlDR +fzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oaiKDNF0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a656a82000000b0056477be59ecsi3699919pgu.286.2023.08.03.02.53.20; Thu, 03 Aug 2023 02:53:32 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oaiKDNF0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235013AbjHCJCl (ORCPT + 99 others); Thu, 3 Aug 2023 05:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234973AbjHCJC2 (ORCPT ); Thu, 3 Aug 2023 05:02:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5782C3AA8; Thu, 3 Aug 2023 02:02:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 217C961CEC; Thu, 3 Aug 2023 09:02:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAF5AC433C7; Thu, 3 Aug 2023 09:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691053323; bh=sqPG+ysOgyUlqjDwjPLXOytpQBtxbeKvqrxIv64ng80=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=oaiKDNF0aYuwG4Q9bZZWRNR+xJdDLcKjbEWIVEOI0tgb+Kd8LoX6mD2xGimBL++vg haTuZ9DxtLjbyA/+ut+afO3S7dMjgxrhxlIMc/OUVI8GtgOu7s8o9chDnnoGtarLo/ kRek1OKsFMnb2RAAF8oAxYEx1K3L9vi5GpUul2e3zlnJgEGdHYL0zIzdFauwe9LQc4 fTUcxEyH3YA7+12CC3j+r4+A8cPwn7ux2v7vc7tuKS0s1+vMwRtruJXKKqKGCGx9Om 7ZNvHLg/TY5LJD3gjkAUOHi1I4AWUBfqDFOavpATZWOiO2RG46rcWsf3oSld//IaAF CiqS1SDodAt0A== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 03 Aug 2023 12:01:59 +0300 Message-Id: To: "Mario Limonciello" , Cc: , , , Subject: Re: [PATCH 3/3] tpm: Drop CONFIG_HW_RANDOM_TPM From: "Jarkko Sakkinen" X-Mailer: aerc 0.14.0 References: <20230803015015.915-1-mario.limonciello@amd.com> <20230803015015.915-4-mario.limonciello@amd.com> In-Reply-To: <20230803015015.915-4-mario.limonciello@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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 On Thu Aug 3, 2023 at 4:50 AM EEST, Mario Limonciello wrote: > As the behavior of whether a TPM is registered for hwrng can be controlle= d > by command line, drop the kernel configuration option. > > 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 > =20 > if TCG_TPM > =20 > -config HW_RANDOM_TPM > - bool "TPM HW Random Number Generator support" > - depends on TCG_TPM && HW_RANDOM && !(TCG_TPM=3Dy && HW_RANDOM=3Dm) > - 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 |=3D TPM_CHIP_FLAG_HWRNG_DISABLED; > =20 > - 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; > =20 > @@ -639,7 +639,7 @@ int tpm_chip_register(struct tpm_chip *chip) > return 0; > =20 > 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); > --=20 > 2.34.1 I don't understand this but please take it a way from patch set, which should only contain critical fixes, which this definitely is not. BR, Jarkko