Linux-Sgx Archive mirror
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Jerry Snitselaar" <jsnitsel@redhat.com>
Cc: <linux-sgx@vger.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-integrity@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tpm: Enable hwrng only for Pluton on AMD CPUs
Date: Wed, 23 Aug 2023 02:16:02 +0300	[thread overview]
Message-ID: <CUZGFNUNLO3W.1669MKELG1XIL@suppilovahvero> (raw)
In-Reply-To: <ubwdpgalqja6c3ggp4rjapqhts7m3pxgrdvm7ytwxitaasbjhd@32tbbipd2vfn>

On Wed Aug 23, 2023 at 12:28 AM EEST, Jerry Snitselaar wrote:
> On Tue, Aug 22, 2023 at 11:39:12PM +0300, Jarkko Sakkinen wrote:
> > 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>
> > ---
> > v2:
> > * CONFIG_X86
>
> Did you mean to wrap the crb_acpi_add chunk with CONFIG_X86?

Yup :-/

$ git diff
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 28448bfd4062..ea085b14ab7c 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -805,12 +805,14 @@ static int crb_acpi_add(struct acpi_device *device)
        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);

[also linux-sgx leaked by mistake to my git-send-email command line]

I sent a new one:
https://lkml.org/lkml/2023/8/22/1288

BR, Jarkko

      reply	other threads:[~2023-08-22 23:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 20:39 [PATCH v2] tpm: Enable hwrng only for Pluton on AMD CPUs Jarkko Sakkinen
2023-08-22 21:28 ` Jerry Snitselaar
2023-08-22 23:16   ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CUZGFNUNLO3W.1669MKELG1XIL@suppilovahvero \
    --to=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=peterhuewe@gmx.de \
    --cc=stable@vger.kernel.org \
    --cc=todd.e.brandt@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).