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

From: Thomas Gleixner
Date: Mon Feb 04 2019 - 12:49:18 EST


On Fri, 1 Feb 2019, Fenghua Yu wrote:

> On some platforms, a feature (e.g. #AC for split lock) may not be
> enumerated by CPUID or non architectural way in IA32_CORE_CAPABILITY.
> To enable the feature on the platforms, a new kernel option setcpuid
> is added.
>
> The feature is defined in cpufeatures.h. The kernel option setcpuid
> takes either feature bit or cpu cap flag corresponding to the feature.
> The format of the option:
> setcpuid=<feature bit>
> setcpuid=<feature capability flag>
>
> Check cpufeatures.h for valid feature bit numbers and check capflags.c
> or /proc/cpuinfo for valid feature capability flags.
>
> Enabling multiple features are supported.
>
> Please note kernel may malfunction if some features are enabled by
> the option.
>
> This option behaves like existing kernel option clearcpuid.

No it does NOT. clearcpuid allows to disable things.

This allows to enable random CPUID bits without any sanity checking. Not
going to happen. We made it clear in the past that functionality needs to
be detectable by enumeration. We do quirks for broken crap, but this is
just not how it works.

Thanks,

tglx