]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 25 Jan 2018 16:14:14 +0000 (16:14 +0000)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 8 Feb 2018 18:16:10 +0000 (10:16 -0800)
commit1dcea05f67130d46c66e4b7efb7992be29c0fec1
tree4d768f5148e9b7fb2778fb0248114b34531c505a
parent058e1590d8b3c035378a4bc6ce9548780e38538a
x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes

This doesn't refuse to load the affected microcodes; it just refuses to
use the Spectre v2 mitigation features if they're detected, by clearing
the appropriate feature bits.

The AMD CPUID bits are handled here too, because hypervisors *may* have
been exposing those bits even on Intel chips, for fine-grained control
of what's available.

It is non-trivial to use x86_match_cpu() for this table because that
doesn't handle steppings. And the approach taken in commit bd9240a18
almost made me lose my lunch.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: gnomes@lxorguk.ukuu.org.uk
Cc: ak@linux.intel.com
Cc: ashok.raj@intel.com
Cc: dave.hansen@intel.com
Cc: karahmed@amazon.de
Cc: arjan@linux.intel.com
Cc: torvalds@linux-foundation.org
Cc: peterz@infradead.org
Cc: bp@alien8.de
Cc: pbonzini@redhat.com
Cc: tim.c.chen@linux.intel.com
Cc: gregkh@linux-foundation.org
Link: https://lkml.kernel.org/r/1516896855-7642-7-git-send-email-dwmw@amazon.co.uk
(cherry picked from commit a5b2966364538a0e68c9fa29bc0a3a1651799035)

Orabug: 27477743
CVE: CVE-2017-5715

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
 Conflicts:
arch/x86/kernel/cpu/intel.c

[Our resolution to
 5d10cbc91d9e x86/cpufeatures: Add AMD feature bits for Speculation Control
 is different, so we still clear the right bits if there (or would be)are AMD machines
 with bad microcode]

Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
arch/x86/kernel/cpu/intel.c