]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Implement per-cpu IBRS control
authorAlexandre Chartre <alexandre.chartre@oracle.com>
Mon, 25 Jun 2018 09:45:16 +0000 (11:45 +0200)
committerBrian Maly <brian.maly@oracle.com>
Tue, 31 Jul 2018 19:53:01 +0000 (15:53 -0400)
commitcc6358c1d82e7a48e1e0497314997dba3260a275
tree772f149e5fdb7c3bec86453ce4dda4ee6af1a0ad
parent54be9e10290b9e4626732dd943dacca3e1c946a4
x86/speculation: Implement per-cpu IBRS control

If a system is booted with non-IBRS microcode, starts a microcode update
which enables IBRS, flags IBRS as supported, then an NMI is taken on a CPU
that hasn't actually received the update, we get a #GP since the SPEC_CTRL
MSR will get frobbed on the unsupported CPU anyway.

IBRS usage is now defined globally as well as per-cpu. The boot cpu defines
the initial IBRS usage, then each cpu defines its own per-cpu IBRS usage
based on the global IBRS uage and its cpu capabilities.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from UEK5 commit fabdd62357acce2531c9e16c5510e04862eab52d
 and part of UEK5 commit 5055b50f67b59ec07c64c833cb351f088486cb02)

[Backport: backport includes part of UEK5 commit 5055b50f67b59e
 ("x86/topology: Avoid wasting 128k for package id array") to track when
 cpu data are initialized.]

Orabug: 28064081

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/include/asm/processor.h
arch/x86/include/asm/spec_ctrl.h
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/scattered.c
arch/x86/kernel/smpboot.c