Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init

From: H. Peter Anvin
Date: Mon Jan 18 2016 - 14:45:48 EST


On 01/18/16 10:39, Borislav Petkov wrote:
> On Mon, Jan 18, 2016 at 10:29:24AM -0800, Andy Lutomirski wrote:
>> I think that, if we can make static_cpu_has be unconditionally safe as
>> a result
>
> Problem with this is the additional .altinstructions entry for
> X86_FEATURE_ALWAYS. And sometimes you don't really need to use the _safe
> variant when you know you're safe.
>

I think the two-byte optimization is the real issue if there is one at
all. I don't care about the inittext, and unless I'm misremembering
completely altinstructions also get ejected.

So I don't personally object to killing off the unsafe variant.

-hpa