Re: [RFC PATCH 31/56] x86/alternative: Prepend nops with retpolines

Peter Zijlstra
2025-10-16T14:23:58Z

On Thu, Oct 16, 2025 at 02:16:04PM +0000, Kaplan, David wrote:

> > Yeah, makes sense. But I like I wrote, I think prefix stuffing might be
> > a better option.
>
> Ok, and that's because we need at most 3 prefixes as Intel uarch's
> don't have significant penalties at 3 prefixes, only at 4+?

Yeah, IIRC 3 was the magic number. Sadly there isn't much public
information on this. The best summary on the subject I could find was
here:

https://reviews.llvm.org/D75945

> I'll need to check on this on the AMD side too.

The above, quoting Agner's optimization guide, says Bulldozer is
affected.