Skip to content

x86: Remove ideal_nops[]

Peter Zijlstra linux-toolchains lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/cpu branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 49 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2x86: Remove dynamic NOP selectionarch/x86/include/asm/jump_label.h arch/x86/include/asm/nops.h arch/x86/include/asm/special_insns.h +7 more+98 -34719 replies
2/2objtool,x86: Use asm/nops.htools/arch/x86/include/asm/nops.h tools/objtool/arch/x86/decode.c tools/objtool/sync-check.sh+90 -50 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAlexei StarovoitovSedat Dilek
SeriesT-b
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] x86: Remove ideal_nops[]

Hi!

A while ago Steve complained about x86 being weird for having different NOPs [1]

Having cursed the same thing before, I figured it was time to look at the NOP situation.

32bit simply isn't a performance target anymore, so all we need is a set of NOPs that works on all.

x86_64 has two main NOP variants, NOPL and prefix NOP. NOPL was introduced by P6 and is architecturally mandated for x86_64. However, some uarchs made the choice to limit NOPL decoding to a single port, which obviously limits NOPL throughput. Other uarchs have (severe) decoding penalties for excessive (>~3) prefixes, hobbling prefix NOP throughput.

But the thing is, all the modern uarchs can handle both without issue; that is AMD K10 (2007) and later and Intel Ivy Bridge (2012) and later. The only exception is Atom, which has the prefix penalty.

Since ultimate performance of a 10 year old chip (Intel Sandy Bridge, 2011) is simply irrelevant today, remove variable NOPs and use NOPL.

This gives us deterministic NOPs and restores sanity.

[1] https://lkml.kernel.org/r/[email protected]