Live data from Hacker News

Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

forum.level1techs.com

41–47 of 47 posts

Re: Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

#41

I am reminded of this article several years ago remarking on Intel's CPU bugs: https://news.ycombinator.com/item?id=16058920 Perhaps AMD has also gone down the same path. It's unfortunate that the hardware industry has also formalised planned obsolescence ("end of life" and similar phrasings) which drastically decreases the motivation to achieve perfection, as they can then defer "fixing" anything to "buy the new mod…

Unfortunately, hardware is a hard solve for fixing things after its out the door, especially when the brainbox is the actual problem. Say i make a CPU and release it to the world. A bug is discovered 6 months later, after thousands have bought my CPU. I cant simply go "oopsie doodle, lets replace your cpu for free to fix the problem", as thatd kill business, and the returned CPU is effectively trash or a paperweight, because it cant be reused (without melting down, separation, etc). So, a new CPU is created, and a new generation of the chip is formed with the fix in place.

CPU mfgs have semisolved some of this through the use of microcode, which is a way to control the CPU workings, and do really 'stupid' things, like burning efuses, which is a what mfgs have designed to allow poking the chip by permanently setting values, and causing a trace in the CPU to literally burn, locking it in place. These are habdy for early things like disabling cores, locking frequencies, etc, but it comes with the caveat of you can only do it once. So again, back to the oopsie doodle. We might be able to pop an efuse through the microcode, if we thought ahead and knew there was potential for issues, but, that might bring other issues, like we see now (decreased performance, etc). And so, the only answer, is again, a new CPU and new generation.

Theres really no way around the rinse repeat cycle of hardware. What does chap my balls about the CPU industry though, is all of the crap we keep doing in the name of compatibility or because what we have now has been layered on a known "working" process for a long time. There are feature sets and design details that have been just stuck in the CPU since the dawn of the x86, and that is really where the problem lies. I saw a talk, or maybe an article ages ago that im unable to find; there are parts of the CPU that we just keep using over and over in the name of compatibility, which is a real problem. I wont go into all the compat things, but look how long its taken for RISC or ARM to really gain traction. Its because i cant simply take a copy of whatever program, and slap it onto a different architecture without lots of work, which is what removing some of these existing x86 features would effectively create.

I do think theres a good solve for some part of this, but i dont think its really the best, because of speed setbacks. If we take the "chiplet" approach, but modularize it, we can start replacing pieces of the CPU, without replacing it whole. For example, say we had a CPU socket that took a bunch of, what ill call "nanochips", which are the individual CPU components (individually replaceable cores, cache, etc), broken out into their own little chips. If a piece has a problem, say, a hardware level exploit not correctable by efuse, fixing it becomes much easier, and cheaper. This isnt a whole solution though, because evolution, and demand for more IO, speeds, etc. Things will always be changing.

Re: Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

#42

would've been nice to see a whole copy of the actual GCC binary in question :( edit: looks like it dies in this: https://github.com/gcc-mirror/gcc/blob/master/gcc/tree-switc... edit2: it also would've been nice to see the actual bytes being decoded when it faults, maybe it ends up spuriously writing over .text edit3: on the LKML https://lore.kernel.org/lkml/D99589F4-BC5D-430B-87B2-72C2037...

You can see his complete test environment here: https://www.youtube.com/channel/UCJLLl6AraX1POemgLfhirwg/com...

Re: Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

#45

I think there was a post a few months ago that in recent AMD CPUs with up to date microcode, mitigations=off actually runs slower than leaving them on. This here seems to be the final nail in the coffin for turning them off, at least on AMD. In the very beginning we decided to turn them off on our fleet of Linux devices, but stopped after that post, even though we don't even run any AMD currently.

That is more a myth and makes no sense and is just the result of people benchmarking random nonsense. mitigations=off is 1-2% faster compiling open source software. On every not last gen silicon mitigations actually have a major impact on performance.

Re: Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

#46

would've been nice to see a whole copy of the actual GCC binary in question :( edit: looks like it dies in this: https://github.com/gcc-mirror/gcc/blob/master/gcc/tree-switc... edit2: it also would've been nice to see the actual bytes being decoded when it faults, maybe it ends up spuriously writing over .text edit3: on the LKML https://lore.kernel.org/lkml/D99589F4-BC5D-430B-87B2-72C2037...

You can see his complete test environment here: https://www.youtube.com/channel/UCJLLl6AraX1POemgLfhirwg/com...

Oh, I didn't see that `cc1` is in the initrd image! Thanks!

Seems like there's already a potential answer to this on the LKML - looks like it has something to do with BTB state being shared between threads?

https://lore.kernel.org/lkml/20231010083956.GEZSUN3OKuYSyU18...

Re: Mitigations=off considered harmful or spurious SIGILL on AMD Zen4

#47

Earlier quoted context omitted.

Out of curiosity did you have smt=off for performance reasons or other reasons?

performance testing vulkan and physx on linux.

Note recent reports of mitigations=off _hurting_ Zen4 performance in many cases.

I don't have Zen4 so I'm not super up-to-date on this -- r2-t2 above disagrees, but offers no data.

https://www.phoronix.com/news/AMD-Zen-4-Mitigations-Off

Post reply on HN