Back in March last year, AMD had warned about fTPM (firmware-based Trusted Platform Module) issues on its Ryzen processors. The bug would lead to stuttering and freezing on Windows 11 and Windows 10 systems. Although initially confined to Windows only, the issue has now started affecting Linux as well.
The bug was triggered since Linux 6.1 when hardware random number generators (hwrng) kernel multi-threading (kthread) was enabled for untrusted sources, ie, when hwrng source were set to a quality setting of zero. As the name suggests, random number generators help to generate random number used in creating cryptographic keys that aid in security functions like encryption.
Mario Limonciello, who is a Principal Member of Technical Staff at AMD, has recommended the disabling of hwrng for fTPM on affected Ryzen(and Athlon) systems:
AMD has issued an advisory indicating that having fTPM enabled in BIOS can cause "stuttering" in the OS. This issue has been fixed in newer versions of the fTPM firmware, but it"s up to system designers to decide whether to distribute it.
This issue has existed for a while, but is more prevalent starting with kernel 6.1 because commit b006c439d58db ("hwrng: core - start hwrng kthread also for untrusted sources") started to use the fTPM for hwrng by default. However, all uses of /dev/hwrng result in unacceptable stuttering.
So, simply disable registration of the defective hwrng when detecting these faulty fTPM versions.
You can find the set of Linux patches here (Patch 0/1 and 1/1) in the Linux kernel mailing list. Not everything, however, is bad news for AMD users on Linux. Recent testing comparing the performance of newer Linux kernel shows massive improvement over a two-year period.
Via: Phoronix