[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1517310230.18619.86.camel@infradead.org>
Date: Tue, 30 Jan 2018 11:03:50 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Borislav Petkov <bp@...en8.de>
Cc: arjan@...ux.intel.com, tglx@...utronix.de, karahmed@...zon.de,
x86@...nel.org, linux-kernel@...r.kernel.org,
tim.c.chen@...ux.intel.com, peterz@...radead.org,
pbonzini@...hat.com, ak@...ux.intel.com,
torvalds@...ux-foundation.org, gregkh@...ux-foundation.org
Subject: Re: [PATCH] x86/cpuid: Fix up "virtual" IBRS/IBPB/STIBP feature
bits on Intel
On Tue, 2018-01-30 at 11:58 +0100, Borislav Petkov wrote:
>
> Does that help?
>
> diff --git a/arch/x86/kernel/cpu/intel.c
> b/arch/x86/kernel/cpu/intel.c
> index 6936d14d4c77..1dd596d0a6c4 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -182,21 +182,21 @@ static void early_init_intel(struct cpuinfo_x86
> *c)
> * Intel CPUs, for finer-grained selection of what's
> available.
> */
> if (cpu_has(c, X86_FEATURE_SPEC_CTRL)) {
> - set_cpu_cap(c, X86_FEATURE_IBRS);
> - set_cpu_cap(c, X86_FEATURE_IBPB);
> + setup_force_cpu_cap(X86_FEATURE_IBRS);
> + setup_force_cpu_cap(X86_FEATURE_IBPB);
> }
> if (cpu_has(c, X86_FEATURE_INTEL_STIBP))
> - set_cpu_cap(c, X86_FEATURE_STIBP);
> + setup_force_cpu_cap(X86_FEATURE_STIBP);
I pondered that, but I didn't like it. I didn't want to always *force*
those features on, for all CPUs, just because they happened to be
discovered at boot time on the first CPU (which *did* have its
microcode updated by the crappy BIOS, while the others didn't).
I strongly suspect that's purely an academic concern, and we mostly
check boot_cpu_has() and never even *notice* if secondary CPUs don't
match. I just didn't want to make that *worse*. It tickled my OCD.
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5213 bytes)
Powered by blists - more mailing lists