]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/spectre_v2: Figure out if STUFF_RSB macro needs to be used.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 1 Feb 2018 15:40:43 +0000 (10:40 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Wed, 7 Feb 2018 20:31:43 +0000 (12:31 -0800)
commitda24943eba81829daf349d7c6b23a29117c5174a
tree0a8daa4f89a253ce60d36eac3bc0962abfef6c73
parentf1bb328815e537d76b7070aa71030568e01c74e9
x86/spectre_v2: Figure out if STUFF_RSB macro needs to be used.

If IBRS is on, STUFF_RSB only needs to be enabled if the CPU
does not have SMEP enabled.

We change the macro to depend on a synthetic one called
X86_FEATURE_STUFF_RSB - which will only be turned on
if 'spectre_v2=ibrs' is set and the BIOS does not have SMEP
enabled.

(And naturally also if the kernel is compiled without retpoline
and the CPU does not have SMEP).

Orabug: 27477743
CVE: CVE-2017-5715

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
arch/x86/include/asm/cpufeature.h
arch/x86/include/asm/spec_ctrl.h
arch/x86/kernel/cpu/bugs_64.c