Linux 6.3-rc2 Introduces Stuttering Workaround For AMD Ryzen PCs Due To fTPM RNG

Written by Michael Larabel in AMD on 12 March 2023 at 08:00 PM EDT. 11 Comments
AMD
Since the Linux 6.1 kernel various users have reported system stuttering issues when using modern AMD Ryzen systems. This has been similar to an "intermittent system stutter" issue AMD disclosed last year for Windows 10 and Windows 11 while now for today's Linux 6.3-rc2 a workaround is finally being merged that in turn will also be back-ported to the stable kernel series.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week