On Thu, 2018-01-18 at 14:48 +0100, Peter Zijlstra wrote: > Now that we have objtool to validate the correctness of asm-goto > constructs we can start using it to guarantee the absence of dynamic > branches (and thus speculation). > > A primary prerequisite for this is of course that the compiler > supports asm-goto. This effecively lifts the minimum GCC version to > build an x86 kernel to gcc-4.5. > > Signed-off-by: Peter Zijlstra (Intel) This is cute, but it's the wrong way round. We *know* people will be immediately backporting this to every stable kernel they're still using. Let's put it in using alternatives (or the 'else lfence' version, even), and then clean it up with static_cpu_has() on *top* of that, so that the latter doesn't have to be backported.