Message ID | 20230822231510.2263255-1-jarkko@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp134204vqm; Tue, 22 Aug 2023 16:34:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGplKRLric2vfZX3LgHs0kcyu4L60OGdcSLTM2d4j6YIbrDe2JJohB9HnBTZiEasgPIBODq X-Received: by 2002:a05:6a21:3288:b0:147:6ea2:ecf0 with SMTP id yt8-20020a056a21328800b001476ea2ecf0mr15209701pzb.18.1692747261764; Tue, 22 Aug 2023 16:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692747261; cv=none; d=google.com; s=arc-20160816; b=uWjkTpuWxM2rzPh0uoFNzjT7onbzBbES2pFWuJ9XlPJOfxR/KTFIywojurwv0R30so NuXQgFrs6St4lrRYVH0xezDOHoNVJxHty2tmS2+GY+MDdcCwxTChFh1HUSHF91dLja3S /64r1INxwHhY1KTvItJnGl25HkY55bkQKGDgyoz0bJL1sm2ZVuU+hA5hOJrD0HC5WAD2 L6SnODfATdwrN4sarA4BOEGURLI6q/bVHC5gLWHGMkpDkJ+HzwHf7Xe0frZyXJq1M1xb q0T0Rs7/AkpM8Opni+lpwsAF0L8+8soBml+D4SfySEje7fE4mV5z+EoN61AIeR1+f+5A qJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=w49utNZPupD2mLI0T/LHkcS3QamLRa1r1HwNWjVEfSE=; fh=fCJmREXsysz+kxiTqbIrMpjgFMx4tohmu4cyCYuv770=; b=qxTHETHWvN0VswgGKO1k1oSwE31h7iHIx717RQ6zY2twwUcsuuv1NOxMtgdinKu940 xbUSB2qOBWkD7w/l39ova5IAhuEgFHZKZ3H1bdci3Md7nfsOhw0CPY3D1jbsj8WqYsCD vBVxQPbpTlV6u2/hrmNXOIZiuDIjISEEZyvfEAeoCY4K85Ffw8xTsB2YG2EfErMl6nbd E9eGRQ14jyvWReVVldw4GVE3ZX+DijiicPXu+qVz80BGNmp85Kuymeu4itjT32Qbxu9t lxLwoJOuvEmYnvEx9uL3CFm9y0wsMy2hAHmluHez448FHZRYAZxobjJTlh4yNnlj+vrX 5zsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="k/at1DXh"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a632501000000b0055adfd70273si9717038pgl.538.2023.08.22.16.34.08; Tue, 22 Aug 2023 16:34:21 -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="k/at1DXh"; 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 S231646AbjHVXP0 (ORCPT <rfc822;llinux791@gmail.com> + 99 others); Tue, 22 Aug 2023 19:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbjHVXPZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Aug 2023 19:15:25 -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 E3356CE9; Tue, 22 Aug 2023 16:15:23 -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 76673611AF; Tue, 22 Aug 2023 23:15:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60173C433C8; Tue, 22 Aug 2023 23:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692746122; bh=nV+IFIjcUjUr5NTuen91t3f//+1v/zufLJTVPhd3Ra4=; h=From:To:Cc:Subject:Date:From; b=k/at1DXhhWgueWlzkp5tYKsA4+wV/WV74HgVexY4xp8Cmli5rPBbHtJHDqgNOv/s3 foOK4vRVHs9vRI0ILIcR4p4FFYJi3pupv5UVAmTMmcqGzDnfnzDJj8eRWzCxO4UmX6 SrylOnSZZ7RiojGrCLVYj8G2Y0SyYjgxr4Boe+E6N7oGE7yEWMU3Wim18KQJCaMJVe E3L2bIOm/M1sn/7cWZya1DgTGizkIS8F1nExGHfj92zIX2ahAFLPMcZ/tsp7Eimq3q otmIGupevfZNlYuJDZIf979hqhO6+tWqLlI/rMzoRgjD94CwWkTL7AfxEOXzgSBCFl 8CWvRBfB87pxQ== From: Jarkko Sakkinen <jarkko@kernel.org> To: linux-integrity@vger.kernel.org Cc: Jerry Snitselaar <jsnitsel@redhat.com>, Jarkko Sakkinen <jarkko@kernel.org>, stable@vger.kernel.org, Todd Brandt <todd.e.brandt@intel.com>, Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>, Mario Limonciello <mario.limonciello@amd.com>, linux-kernel@vger.kernel.org Subject: [PATCH v3] tpm: Enable hwrng only for Pluton on AMD CPUs Date: Wed, 23 Aug 2023 02:15:10 +0300 Message-Id: <20230822231510.2263255-1-jarkko@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774966432434035552 X-GMAIL-MSGID: 1774974152762092702 |
Series |
[v3] tpm: Enable hwrng only for Pluton on AMD CPUs
|
|
Commit Message
Jarkko Sakkinen
Aug. 22, 2023, 11:15 p.m. UTC
The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. On the
reported systems the TPM doesn't reply at bootup and returns back the
command code. This makes the TPM fail probe.
Since only Microsoft Pluton is the only known combination of AMD CPU and
fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin
aware of this, print also info message to the klog.
Cc: stable@vger.kernel.org
Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
v3:
* Forgot to amend config flags.
v2:
* CONFIG_X86
* Removed "Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>"
* Removed "Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>"
---
drivers/char/tpm/tpm_crb.c | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
Comments
Dear Jarkko, Thank you for your patch. Am 23.08.23 um 01:15 schrieb Jarkko Sakkinen: > The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for > all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. On the > reported systems the TPM doesn't reply at bootup and returns back the > command code. This makes the TPM fail probe. > > Since only Microsoft Pluton is the only known combination of AMD CPU and > fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin > aware of this, print also info message to the klog. > > Cc: stable@vger.kernel.org > Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs") > Reported-by: Todd Brandt <todd.e.brandt@intel.com> > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804 > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Mario’s patch also had the three reporters below listed: Reported-by: Patrick Steinhardt <ps@pks.im> Reported-by: Ronan Pigott <ronan@rjp.ie> Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > --- > v3: > * Forgot to amend config flags. > v2: > * CONFIG_X86 > * Removed "Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>" > * Removed "Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>" > --- > drivers/char/tpm/tpm_crb.c | 33 ++++++++------------------------- > 1 file changed, 8 insertions(+), 25 deletions(-) > > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c > index 65ff4d2fbe8d..ea085b14ab7c 100644 > --- a/drivers/char/tpm/tpm_crb.c > +++ b/drivers/char/tpm/tpm_crb.c > @@ -463,28 +463,6 @@ static bool crb_req_canceled(struct tpm_chip *chip, u8 status) > return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE; > } > > -static int crb_check_flags(struct tpm_chip *chip) > -{ > - u32 val; > - int ret; > - > - ret = crb_request_locality(chip, 0); > - if (ret) > - return ret; > - > - ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL); > - if (ret) > - goto release; > - > - if (val == 0x414D4400U /* AMD */) > - chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; > - > -release: > - crb_relinquish_locality(chip, 0); > - > - return ret; > -} > - > static const struct tpm_class_ops tpm_crb = { > .flags = TPM_OPS_AUTO_STARTUP, > .status = crb_status, > @@ -827,9 +805,14 @@ static int crb_acpi_add(struct acpi_device *device) > if (rc) > goto out; > > - rc = crb_check_flags(chip); > - if (rc) > - goto out; > +#ifdef CONFIG_X86 > + /* A quirk for https://www.amd.com/en/support/kb/faq/pa-410 */ > + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && > + priv->sm != ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON) { > + dev_info(dev, "Disabling hwrng\n"); A more elaborate log message would be helpful for the user. Maybe: Disabling hwrng in AMD's fTPM to avoid stutter (AMD article PA 410) > + chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; > + } > +#endif /* CONFIG_X86 */ > > rc = tpm_chip_register(chip); > Kind regards, Paul
On Wed, 2023-08-23 at 21:24 +0200, Paul Menzel wrote: > [Cc: +Andy, +Joe] > > > Dear Jarkko, dear Andy, dear Joe, > > > Am 23.08.23 um 19:40 schrieb Jarkko Sakkinen: > > On Wed Aug 23, 2023 at 11:23 AM EEST, Paul Menzel wrote: > > > > Am 23.08.23 um 01:15 schrieb Jarkko Sakkinen: > > > > The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for > > > > all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. On the > > > > reported systems the TPM doesn't reply at bootup and returns back the > > > > command code. This makes the TPM fail probe. > > > > > > > > Since only Microsoft Pluton is the only known combination of AMD CPU and > > > > fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin > > > > aware of this, print also info message to the klog. > > > > > > > > Cc: stable@vger.kernel.org > > > > Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs") > > > > Reported-by: Todd Brandt <todd.e.brandt@intel.com> > > > > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804 > > > > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > > > > > > Mario’s patch also had the three reporters below listed: > > > > > > Reported-by: Patrick Steinhardt <ps@pks.im> > > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > The problem here is that checkpatch throws three warnings: > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #19: > > Reported-by: Patrick Steinhardt <ps@pks.im> > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #20: > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #21: > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > > > > Since bugzilla is not part of the documented process afaik, I used this > > field as the guideline: > > > > Reported: 2023-08-17 20:59 UTC by Todd Brandt > > > > How otherwise I should interpret kernel bugzilla? > > How is the proper process to add more than one reporter (so they are > noted and also added to CC), so that checkpatch.pl does not complain? > > > Kind regards, > > Paul > > > > In any case new version is still needed as the commit message must > > contain a mention of "Lenovo Legion Y540" as the stimulus for doing > > this code change in the first place. > > > > BR, Jarkko Well, if it's really desired to allow multiple consecutive reported-by: lines, maybe: --- scripts/checkpatch.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 528f619520eb9..5b5c11ad04087 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3179,6 +3179,8 @@ sub process { if (!defined $lines[$linenr]) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n"); + } elsif ($rawlines[$linenr] =~ /^\s*reported(?:|-and-tested)-by:/i) { + ; } elsif ($rawlines[$linenr] !~ /^closes:\s*/i) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
On Wed Aug 23, 2023 at 10:24 PM EEST, Paul Menzel wrote: > [Cc: +Andy, +Joe] > > > Dear Jarkko, dear Andy, dear Joe, > > > Am 23.08.23 um 19:40 schrieb Jarkko Sakkinen: > > On Wed Aug 23, 2023 at 11:23 AM EEST, Paul Menzel wrote: > > >> Am 23.08.23 um 01:15 schrieb Jarkko Sakkinen: > >>> The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for > >>> all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. On the > >>> reported systems the TPM doesn't reply at bootup and returns back the > >>> command code. This makes the TPM fail probe. > >>> > >>> Since only Microsoft Pluton is the only known combination of AMD CPU and > >>> fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin > >>> aware of this, print also info message to the klog. > >>> > >>> Cc: stable@vger.kernel.org > >>> Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs") > >>> Reported-by: Todd Brandt <todd.e.brandt@intel.com> > >>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804 > >>> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > >> > >> Mario’s patch also had the three reporters below listed: > >> > >> Reported-by: Patrick Steinhardt <ps@pks.im> > >> Reported-by: Ronan Pigott <ronan@rjp.ie> > >> Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > The problem here is that checkpatch throws three warnings: > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #19: > > Reported-by: Patrick Steinhardt <ps@pks.im> > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #20: > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > #21: > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > > > > Since bugzilla is not part of the documented process afaik, I used this > > field as the guideline: > > > > Reported: 2023-08-17 20:59 UTC by Todd Brandt > > > > How otherwise I should interpret kernel bugzilla? > > How is the proper process to add more than one reporter (so they are > noted and also added to CC), so that checkpatch.pl does not complain? I have no idea. I actually tried all sorts of combinations with no luck. Since it exists and is out there, the process documentation should really bring up some clarity to the kernel bugzilla. BR, Jarkko
On Thu Aug 24, 2023 at 7:43 AM EEST, Joe Perches wrote: > On Wed, 2023-08-23 at 21:24 +0200, Paul Menzel wrote: > > [Cc: +Andy, +Joe] > > > > > > Dear Jarkko, dear Andy, dear Joe, > > > > > > Am 23.08.23 um 19:40 schrieb Jarkko Sakkinen: > > > On Wed Aug 23, 2023 at 11:23 AM EEST, Paul Menzel wrote: > > > > > > Am 23.08.23 um 01:15 schrieb Jarkko Sakkinen: > > > > > The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for > > > > > all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. On the > > > > > reported systems the TPM doesn't reply at bootup and returns back the > > > > > command code. This makes the TPM fail probe. > > > > > > > > > > Since only Microsoft Pluton is the only known combination of AMD CPU and > > > > > fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin > > > > > aware of this, print also info message to the klog. > > > > > > > > > > Cc: stable@vger.kernel.org > > > > > Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs") > > > > > Reported-by: Todd Brandt <todd.e.brandt@intel.com> > > > > > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804 > > > > > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > > > > > > > > Mario’s patch also had the three reporters below listed: > > > > > > > > Reported-by: Patrick Steinhardt <ps@pks.im> > > > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > > > The problem here is that checkpatch throws three warnings: > > > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > > #19: > > > Reported-by: Patrick Steinhardt <ps@pks.im> > > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > > #20: > > > Reported-by: Ronan Pigott <ronan@rjp.ie> > > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > > > > WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report > > > #21: > > > Reported-by: Raymond Jay Golo <rjgolo@gmail.com> > > > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> > > > > > > Since bugzilla is not part of the documented process afaik, I used this > > > field as the guideline: > > > > > > Reported: 2023-08-17 20:59 UTC by Todd Brandt > > > > > > How otherwise I should interpret kernel bugzilla? > > > > How is the proper process to add more than one reporter (so they are > > noted and also added to CC), so that checkpatch.pl does not complain? > > > > > > Kind regards, > > > > Paul > > > > > > > In any case new version is still needed as the commit message must > > > contain a mention of "Lenovo Legion Y540" as the stimulus for doing > > > this code change in the first place. > > > > > > BR, Jarkko > > Well, if it's really desired to allow multiple consecutive reported-by: > lines, maybe: > --- > scripts/checkpatch.pl | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 528f619520eb9..5b5c11ad04087 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3179,6 +3179,8 @@ sub process { > if (!defined $lines[$linenr]) { > WARN("BAD_REPORTED_BY_LINK", > "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n"); > + } elsif ($rawlines[$linenr] =~ /^\s*reported(?:|-and-tested)-by:/i) { > + ; > } elsif ($rawlines[$linenr] !~ /^closes:\s*/i) { > WARN("BAD_REPORTED_BY_LINK", > "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); Kind of opposing this because: 1. Bugzilla has a reporter field. 2. The request is now, if I understood this correctly, to add reported-by field to all people who have left a comment. 3. There is a field for the reporter, which points out to a single person. Why all the possible commenters and not the creator of the report? BR, Jarkko
On Tue Sep 5, 2023 at 3:01 PM EEST, Thorsten Leemhuis wrote: > On 05.09.23 00:32, Jarkko Sakkinen wrote: > > On Fri Sep 1, 2023 at 11:49 AM EEST, Thorsten Leemhuis wrote: > >> On 29.08.23 10:38, Linux regression tracking (Thorsten Leemhuis) wrote: > >>> On 28.08.23 02:35, Mario Limonciello wrote: > >>>> On 8/27/2023 13:12, Jarkko Sakkinen wrote: > >>>>> On Wed Aug 23, 2023 at 9:58 PM EEST, Mario Limonciello wrote: > >>>>>> On 8/23/2023 12:40, Jarkko Sakkinen wrote: > >>>>>>> On Wed Aug 23, 2023 at 11:23 AM EEST, Paul Menzel wrote: > >>>>>>>> Am 23.08.23 um 01:15 schrieb Jarkko Sakkinen: > >>>>>>>>> The vendor check introduced by commit 554b841d4703 ("tpm: Disable > >>>>>>>>> RNG for > >>>>>>>>> all AMD fTPMs") doesn't work properly on a number of Intel fTPMs. > >>>>>>>>> On the > >>>>>>>>> reported systems the TPM doesn't reply at bootup and returns back the > >>>>>>>>> command code. This makes the TPM fail probe. > > [...] > >> Hmmm. Quite a bit progress to fix the issue was made in the first week > >> after Todd's report; Jarkko apparently even applied the earlier patch > >> from Mario to his master branch: > >> https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/commit/?id=b1a62d41bdc1d15b0641759717e8c3651f0a810c > >> But since then (aka in the past week) there was not much progress. > > Jarkko, many thx for picking this up and submitting it to Linus, much > appreciated. Sorry again for prodding things, but I felt I had to. Hope > you didn't mind too much. > > > Could it be possible to extend the actual kernel documentation > > to give at least some guidelines how a maintainer should deal > > with the bugzilla? > > I guess it's best if that is done by somebody that cares about bugzilla > (I don't fall into that group[1]) and knows the official status. > > But FWIW, I wonder what you actually want to see documented. From > https://lore.kernel.org/all/CVAC8VQPD3PK.1CBS5QTWDSS2C@suppilovahvero/ > it sounds like you had trouble with Link:/Closes: tag and Reported-by. > From what I can see I don't think bugzilla.kernel.org needs special > documentation in that area: > > * just use Link:/Closes: to reports to public reports that might be > helpful later in case somebody wants to look at the backstory of a > commit, wherever those reports may be (lore, bugzilla.kernel.org, > https://gitlab.freedesktop.org/drm/intel/-/issues, > https://github.com/thesofproject/linux/issues, ...) > > * use Reported-by: to give credit to anyone that deserves it, as it is > a nice way to say thx while motivate people to help again in the future. > That usually will include the initial reporter, but might also include > people that replied to a report from somebody else and helped > perceptible with debugging or fixing. I *kind of* agree with this but checkpatch.pl disagrees with this :-/ And it is an actual issue that bugzilla is hosted in kernel.org domain, and at the same time it is undocumented process. AFAIK anything that is not part of the process can be ignored in the process so *theoretically* anything put to kernel bugzilla ca be ignored. This is how it is with e.g. patchwork - some people use it, some people don't. Personally I think bugzilla, being user approachable system, should be better defined but *theoretically*, at least by the process, it can be fully ignored. This is where the main source of confusion inherits from, when you put your maintainer hat on. > Ciao, Thorsten > > [1] I only sometimes help people that report regressions to > bugzilla.kernel.org that otherwise would likely would fall through the > cracks (among others because many reports are never forwarded to the > proper developers otherwise). BR, Jarkko
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 65ff4d2fbe8d..ea085b14ab7c 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -463,28 +463,6 @@ static bool crb_req_canceled(struct tpm_chip *chip, u8 status) return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE; } -static int crb_check_flags(struct tpm_chip *chip) -{ - u32 val; - int ret; - - ret = crb_request_locality(chip, 0); - if (ret) - return ret; - - ret = tpm2_get_tpm_pt(chip, TPM2_PT_MANUFACTURER, &val, NULL); - if (ret) - goto release; - - if (val == 0x414D4400U /* AMD */) - chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; - -release: - crb_relinquish_locality(chip, 0); - - return ret; -} - static const struct tpm_class_ops tpm_crb = { .flags = TPM_OPS_AUTO_STARTUP, .status = crb_status, @@ -827,9 +805,14 @@ static int crb_acpi_add(struct acpi_device *device) if (rc) goto out; - rc = crb_check_flags(chip); - if (rc) - goto out; +#ifdef CONFIG_X86 + /* A quirk for https://www.amd.com/en/support/kb/faq/pa-410 */ + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && + priv->sm != ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON) { + dev_info(dev, "Disabling hwrng\n"); + chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED; + } +#endif /* CONFIG_X86 */ rc = tpm_chip_register(chip);