From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
jgg@ziepe.ca, linux@dominikbrodowski.net,
linux-integrity@vger.kernel.org, daniil.stas@posteo.net,
peterhuewe@gmx.de
Subject: Re: [PATCH v3] tpm: Disable RNG for all AMD fTPMs
Date: Tue, 8 Aug 2023 19:19:29 +0200 [thread overview]
Message-ID: <ZNJ5IZjpOdOBFFja@zx2c4.com> (raw)
In-Reply-To: <CAHk-=whT2hf5f6SwK32J4cF2Yu+q9SZaO6JZVzBOsLz63uPW1w@mail.gmail.com>
On Mon, Aug 07, 2023 at 08:26:03PM -0700, Linus Torvalds wrote:
> On Mon, 7 Aug 2023 at 17:39, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > I'm not sure what's best or what Linus prefers. Linus - Jarkko sent you
> > the wrong version patch. Do you want a fixup patch that accounts for the
> > difference, and then I'll address the stable@ metadata deficiency
> > manually by talking to Greg, or would you rather some merge commit
> > magic, or something else?
>
> Either works for me, whatever ends up being easiest.
>
> However, looking at that v3 patch, that "should we enable/disable the
> hwrng" is now repeated *three* times, and that first one is
>
> if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM) || tpm_is_firmware_upgrade(chip) ||
> - tpm_amd_is_rng_defective(chip))
> + chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)
>
> and wants fixing anyway: you want parenthesis around the '&'.
>
> Yes, yes, it works (because bitwise ops have higher precedence than
> logical ones), but let's not do that.
>
> But more importantly, can we just have a single helper inline function
> for this and *not* repeat the same multi-line expression three times
> (just in negated and then 2x non-negated format)?
>
> That test is ugly anyway. Why is "tpm_is_firmware_upgrade()" a wrapper
> function around testing "chip->flags", but then right next to it it
> tests them explicitly.
>
> So if we have to re-do this all, let's re-do it properly. Ok?
>
> Thinking about it, I do guess that makes it easier to just send an
> incremental patch on top.
Alright, looks like Mario took care of that:
https://lore.kernel.org/all/20230808041229.22514-1-mario.limonciello@amd.com/
Once this is in your tree I'll ping Greg about the right stable versions
to make up for the wrong tag.
Jason
next prev parent reply other threads:[~2023-08-08 18:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 18:24 [PATCH v3] tpm: Disable RNG for all AMD fTPMs Mario Limonciello
2023-08-04 13:28 ` Jason A. Donenfeld
2023-08-04 23:06 ` Jarkko Sakkinen
2023-08-04 22:54 ` Jarkko Sakkinen
2023-08-04 23:21 ` Mario Limonciello
2023-08-04 23:39 ` Jarkko Sakkinen
2023-08-07 22:28 ` Jason A. Donenfeld
2023-08-08 0:15 ` Mario Limonciello
2023-08-08 0:39 ` Jason A. Donenfeld
2023-08-08 3:26 ` Linus Torvalds
2023-08-08 17:19 ` Jason A. Donenfeld [this message]
2023-08-09 17:06 ` Linus Torvalds
2023-08-09 21:35 ` Jason A. Donenfeld
2023-08-10 15:37 ` Jarkko Sakkinen
2023-08-10 15:06 ` Jarkko Sakkinen
2023-08-10 15:14 ` Jason A. Donenfeld
2023-08-10 15:04 ` Jarkko Sakkinen
2023-08-10 14:42 ` Jarkko Sakkinen
2023-08-10 14:45 ` Limonciello, Mario
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=ZNJ5IZjpOdOBFFja@zx2c4.com \
--to=jason@zx2c4.com \
--cc=daniil.stas@posteo.net \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=mario.limonciello@amd.com \
--cc=peterhuewe@gmx.de \
--cc=torvalds@linux-foundation.org \
/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