from Hacker News

AMD Ryzen 7000 Series performs better with Spectre V2 Mitigations enabled

by ad8e on 10/4/22, 12:39 PM with 41 comments

  • by MBCook on 10/8/22, 3:06 AM

    “As for why the Ryzen 7000 series performance is actually slower if disabling the Spectre V2 mitigations, that's likely something only AMD can effectively answer but presumably…”

    Just ask!

    Seriously. You can ask AMD. Maybe they won’t tell you, but they might. It might be really good info. Why not ask someone who is really knowledgeable about this stuff like a kernel developer who works on x86-64 or worked on the mitigations?

    This is what I never understand about Phoronix. People link to them all the time but they run a bunch of benchmarks and then end on “there you go”. I’d like investigation into why. You won’t always get an answer but you should try.

  • by Ristovski on 10/4/22, 2:02 PM

    An interesting comment made in the Phoronix forums:

    > My theory is that fixing the Spectre V2 vulnerability on a hardware level would lead to fundamental architecture changes that AMD is not willing to make, because it may add so much more complexity to the architecture or it may just be too unconvenient. They probably realized that optimizing the code paths that the Linux kernel utilizes on the default mitigations mode is faster, simpler and it may involve less deeper changes, while still being secure.

    > As far as I know, pretty much every CPU architecture that implements speculative execution is vulnerable to some version of Spectre, so note that this is not a fundametal flaw of AMD64.

  • by ZiiS on 10/8/22, 8:36 AM

    This is basically just saying: the super clever AMD designers and Linux kernel developers have optimised for the setting they recomend and most people use. An insecure setting they recomend against isn't yet well optimised on brand new hardware.
  • by stevefan1999 on 10/8/22, 6:13 AM

    meh, maybe they just flush TLB every time in hardware level if you disabled the mitigations, ane disabled the hardware flush if the software side can handle it
  • by amelius on 10/8/22, 11:38 AM

    Perhaps their Spectre path has benchmark detection :)
  • by staticassertion on 10/8/22, 1:59 PM

    Interesting. I wonder if the kpti path leveraging PCID has 'tipped' into a performance improvement? Maybe a larger PCID cache on the CPUs and optimized codepaths for specter-usage?
  • by Havoc on 10/8/22, 12:06 AM

    Interesting. When i first heard this I assumed it’s bad benchmarking but photonics saying same suggest otherwise
  • by sylware on 10/8/22, 10:13 AM

    this smells really bad... as it does not make a lot of sense, the devil hides in the details.
  • by simlevesque on 10/8/22, 1:12 AM

    It seems logical that if Zen 4 is immune to Spectre, the mitigations are a waste and therefore slow the CPU.