Re: [PATCH v3 08/10] x86/setcpuid: Add kernel option setcpuid

From: Dave Hansen
Date: Tue Feb 05 2019 - 11:46:26 EST


On 2/4/19 10:18 PM, Borislav Petkov wrote:
> On Mon, Feb 04, 2019 at 03:24:23PM -0800, Dave Hansen wrote:
>> Actually, there's one part of all this that I forgot. Will split lock
>> detection be enumerated _widely_?
>
> You never know what users will do. The moment it gets out, it better be
> designed properly, along with the chicken bits.

Sure. I think this was just the simplest implementation we could come
up with. There was more complexity before, and Thomas suggested
stripping it back to the bare-bones like we have here.

>> IOW, will my laptop in 5 years enumerate support for it?
>
> Don't tell me this is going to be another MPX fiasco :-\
>
> Or is this something along the lines of "let's see whether it takes off
> and if yes, we'll commit to it or otherwise remove it and not even waste
> a CPUID leaf"?

"Is Intel serious enough to put in a CPUID leaf" is a pretty good litmus
test INMHO. I think it's one of the reasons that Thomas said he would
consider this if Intel was willing to go to the trouble of adding proper
enumeration.

>> If so, we surely don't want to enable this everyhwhere: it will break
>> old apps. Doesn't that mean that we need both feature detection and
>> another separate bit for folks to opt-in?
>
> Well, if it breaks old apps, it probably needs to be opt-in anyway.

Yes, this was my assumption.

> And for that you don't need setcpuid either - you simply boot with
> "split_lock_ac" or whatever and the kernel pokes that MSR_TEST_CTL or
> whatever else it needs to detect in hw for split lock and sets the
> X86_FEATURE bits if detection is successful.

That's actually what we did in the last set.

Anyway... There are a few branches of this discussion. Let's wait for
Fenghua to tell us how universal this feature is and if
family/model/stepping detection will work.