Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
Linux 6.3-rc2 Introduces Stuttering Workaround For AMD Ryzen PCs Due To fTPM RNG
The system stutter on Windows last year and now on Linux with 6.1+ kernels was attributed to fTPM-related memory transactions in the SPI flash memory that could lead to temporary pauses in system interactivity or responsiveness. After more than one month of going back-and-forth over the Linux kernel workaround, this evening just ahead of the imminent Linux 6.3-rc2 tagging a workaround was merged.
AMD Linux engineer Mario Limonciello saw his workaround merged to disable the hardware random number generator for the fTPM on select AMD designs. Mario described in the patch:
"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. As this is caused by faulty firmware, it is plausible that such a problem could also be reproduced by other TPM interactions, but this hasn't been shown by any user's testing or reports.
It is hypothesized to be triggered more frequently by the use of the RNG because userspace software will fetch random numbers regularly.
Intentionally continue to register other TPM functionality so that users that rely upon PCR measurements or any storage of data will still have access to it. If it's found later that another TPM functionality is exacerbating this problem a module parameter it can be turned off entirely and a module parameter can be introduced to allow users who rely upon fTPM functionality to turn it on even though this problem is present."
It took the month to figure out the exact behavior to enforce with affected fTPM versions, etc. But long story short, if you have a system firmware update available for your AMD Ryzen system, upgrade to ideally address the fundamental problem and can thereby avoid this workaround to blacklist the hardware random number generation of the fTPM.
Look for this workaround to appear in Linux 6.2 stable and Linux 6.1 LTS in the coming days.