Re: [PATCH] x86/cpuid: Fix up "virtual" IBRS/IBPB/STIBP feature bits on Intel

From: Thomas Gleixner
Date: Tue Jan 30 2018 - 05:38:01 EST


On Mon, 29 Jan 2018, David Woodhouse wrote:

> Despite the fact that all the other code there seems to be doing it,
> just using set_cpu_cap() in early_intel_init() doesn't actually work.
>
> When the CPU is queried again in identify_boot_cpu(), it all gets
> overwritten again. Do it in init_scattered_cpuid_features() instead.
>
> Turning the bits off for bad microcode can use setup_clear_cpu_cap()
> to force them off for all CPUs; I was less keen on forcing the feature
> bits *on* that way.
>
> Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
> Fixes: 2961298e ("x86/cpufeatures: Clean up Spectre v2 related CPUID flags")
> ---
> I feel I must be missing something. Is the rest of early_init_intel() broken too?

A lot of that stuff is duct taped and works more by chance than by
design. Borislav is looking into cleaning that up already.

Thanks,

tglx