Linux Patched For A New AMD Zen 4 CPU Bug - Erratum #1485

Written by Michael Larabel in AMD on 11 October 2023 at 07:27 AM EDT. 13 Comments
AMD
Merged today to Linux 6.6 Git is a new patch for fixing an AMD erratum CPU bug affecting Zen 4 based processors like the Ryzen 7000 series and EPYC 8004/9004 series.

Merged to the Linux kernel is a patch adding around a dozen lines of code for fixing a recently uncovered Zen 4 bug. The issue is an undefined instruction (#UD) exception potentially occurring when running Zen 4 without the Single Threaded Indirect Branch Predictors (STIBP) enabled. STIBP is needed for Zen 4 as part of the default security mitigations. STIBP is used as part of Spectre Variant Two protections. But for those booting their Linux kernel with "mitigations=off" or more selectively disabling the CPU security mitigations in trying to enhance performance, this undefined instruction exception can erroneously appear in such configuration.

The erratum was discovered when the T2 Linux distribution crew reported random illegal instruction build errors while compiling code. As part of the report, mitigations=off was reported and that when not disabling mitigations, these spurious illegal instructions did not appear.

AMD Ryzen 9 CPUs


After research/testing by AMD, it's now been confirmed to be a Zen 4 bug and identified as Erratum #1485. The good news is that with this fix the performance impact is negligible. Additionally, as mentioned, this bug only occurs if you end up disabling the STIBP security feature. So those running AMD Ryzen 7000 series or EPYC 8004/9004 series out-of-the-box won't encounter these spurious illegal instructions errors unless you are disabling the default security protections -- which isn't recommended for production systems and the "mitigations=off" benefits these days tend to be quite small anyways for most workloads.

While in Linux 6.6 Git as of today, the small erratum bug fix is marked for back-porting to existing stable Linux kernel series as well. This is a CPU hardware bug so other operating systems are presumably affected as well, but outside of Linux with the easy "mitigations=off" knob it's even less common on other operating systems for going through the steps to disable CPU security mitigations.
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