Re: [PATCH v2 5/8] x86/speculation: Add basic support for IBPB

From: David Woodhouse
Date: Sun Jan 21 2018 - 13:54:55 EST


On Sun, 2018-01-21 at 19:06 +0100, Borislav Petkov wrote:
>
> > switch to using ALTERNATIVES instead of static_cpu_has]
>
> Why?
>
> ÂÂÂÂÂÂÂÂif (static_cpu_has(X86_FEATURE_IBPB))
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂwrmsr(MSR_IA32_PRED_CMD, PRED_CMD_IBPB, 0);
>
> It can't get any more readable than this. Why even f*ck with
> alternatives?

Because we're backporting this to every stable kernel under the sun,
and they don't already require asm-goto. Peter does have a dozen or so
objtool patches to protect us against the missed GCC optimisation which
would make it vulnerable via a conditional branch, but we'll do that
*after* the basic backportable implementation using ALTERNATIVE goes
in.

Attachment: smime.p7s
Description: S/MIME cryptographic signature