This week, AMD published a security analysis of AMD Zen 3’s new Predictive Store Forwarding (PSF) functionality. There, they acknowledged that there is a possibility that poor PSF functionality could lead to a side channel attack, even if the exposure in the real world would be quite low. In any case, the interested users allow to disable the Predictive Store Forwarding feature, but what they did not comment on in the paper was what performance overhead to expect if they disabled PSF. So my Easter weekend turned into AMD Zen 3 PSF benchmarking.
AMD does not recommend end users to disable Zen 3’s Protective Store Forwarding functionality, but rather be proactive in their public safety analysis and ensure that customers are informed about the behavior and how to disable it should they become interested. The effect of poor PSF speculation will be similar to that of Specter Variant Four / Speculative Store Bypass. AMD̵
PSF is disabled with Zen 3 processors if Speculative Store Bypass Disable (SSBD) reduction is present or possibly only forcibly disabled via another bit. AMD’s whitepaper says that they are releasing Linux updates to easily disable PSF if desired, but at the time of writing I have not yet seen the public updates anywhere. They will probably do so in the next few days to allow the practical “nopsfd” core option. But for the first testing this weekend, I just built a kernel that set MSR 48h Bit 7 to disable this predictive store forwarding functionality. By default, Linux does not reduce SSBD unless you select it via the prctl interface or SECCOMP.
I did not know what to expect this weekend with a lack of details on the performance implications of disabling Predictive Store Forwarding, and ran dozens of references on a few different standard core AMD Ryzen 5000 and EPYC 7003 series systems and then the same kernel / configuration, but with PSF disabled via bit 7.
Across multiple systems and many different workloads tested, and with the Phoronix Test Suite automatically running each test multiple times, etc., in the end, the results of disabling PSF were of minimal difference. At most, in some workloads there was close to 1% impact over the course of several races and several systems, but in general it was difficult to find any statistically significant difference.
For example, with the Ryzen 7 5800X box, this was the set of results of more than 100 tests. With the geometric mean of all these results, it was less than half a percent performance when you disabled this new Zen 3 feature. The other result files are even more boring than that.
So long story short, even if AMD does not recommend customers at all to disable Predictive Store Forwarding, if you decide to disable it in the name with increased security, it is unlikely to make any meaningful difference in performance. I’m still running some major server loads, but with everything I’ve seen today and yesterday across multiple Zen 3 systems, PSF disabling doesn’t have a big impact. Fortunately, nothing as scary as some of the earlier x86_64 speculative performance dampers we’ve seen in recent years.
For those who appreciate the fast pace of the AMD Zen 3 PSF scale this Easter weekend, consider joining Phoronix Premium or maybe a tip. At least please no use of ad blocking; your support allows you to be able to measure every single day of the year.
If you liked this article, you should consider joining Phoronix Premium to see this site without ads, single-page, multi-page articles and other benefits. PayPal tips are also accepted. Thanks for the support.