]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Support per-process SSBD with IBRS
authorAlexandre Chartre <alexandre.chartre@oracle.com>
Mon, 9 Jul 2018 14:53:05 +0000 (16:53 +0200)
committerBrian Maly <brian.maly@oracle.com>
Tue, 7 Aug 2018 17:21:43 +0000 (13:21 -0400)
commitc5729c68658cd121cbba14d030a8c769b93925e3
tree4b94061cda25609ce7ebfa804c36a01bc3dcaa12
parent4dbc2ddc8d51dd616b95d868b0223d102428b995
x86/speculation: Support per-process SSBD with IBRS

Currently per-process SSBD can't be used with IBRS because both SSBD
and IBRS have to concurrently modify the spec_ctrl state which is globally
stored across all cpus. As a consequence, when using IBRS, Speculative
Store Bypass is disabled for userspace and it can't be used per-process
with prctl.

Commit fabdd62357ac ("x86/speculation: Implement per-cpu IBRS control")
has implemented per-cpu IBRS control and a similar change is needed to
maintain part of the spec_ctrl state (x86_spec_ctrl_priv) per-cpu too.
Then spec_ctrl state will be maintained per-cpu and per-process SSBD
can be used with IBRS.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from UEK5 commit 9275aeff3b17bf85c7fe99d98d73b69628c14796)

Orabug: 28354043

[Backport: assembly code changes in spec_ctrl.h are similar but the
 code is organized slightly differently on UEK5 and UEK4. On UEK5,
 changes are directly in assembly macros (.macro). On UEK4, changes
 are in preprocessor macros (#define) which are used by assembly macros.]

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/spec_ctrl.h
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/scattered.c