The Performance Impact Of AMD Changing Their Retpoline Method For Spectre V2

Written by Michael Larabel in Software on 11 March 2022 at 01:25 PM EST. Page 3 of 3. 14 Comments.
AMD Retpolines Linux 5.17

I also fired up tests on an ASUS laptop with AMD Ryzen 9 5900HX and again looking at the new generic Retpolines default for AMD GPUs compared to the prior default of AMD/LFENCE Retpolines.

AMD Retpolines Linux 5.17

With the Ryzen 9 5900HX laptop there tended to be a more measurable impact than the higher-end desktop tests and in particular for I/O workloads the AMD LFENCE Retpoline mode was a few percent faster, WireGuard was also a few percent faster on the prior Retpoline mode, and other synthetic benchmarks.

AMD Retpolines Linux 5.17

On an AMD EPYC server I also fired up some benchmarks for seeing the impact of the new AMD Retpoline default.

AMD Retpolines Linux 5.17

On that front the AMD EPYC server results were mixed, but for some of the I/O benchmarks like the KeyDB database server, Node.js, and other tests the former LFENCE/JMP Retpoline mode was faster albeit not as secure as previously anticipated.

From two days of looking at the performance impact of the AMD Retpoline change, those are the main takeaways for now. More over the weekend if any other interesting discoveries on this Retpoline front or As a reminder, this new default is already in Linux 5.17 Git as of a few days ago and is working its way to existing stable Linux kernel series point releases at the moment. Presumably Microsoft has or will make a similar change with Windows. This change is being made by default as while the "AMD" (LFENCE/JMP) Retpoline mode can be slightly faster, it turns out to not be as secure as using the generic Retpoline mode. Users on patched kernels can still go back to that former default using the "spectre_v2=retpoline,lfence" kernel option and there is also "mitigations=off" for those not concerned as much about system security.

If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.


Related Articles
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.