]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: functions for supporting enhanced IBRS
authorAlejandro Jimenez <alejandro.j.jimenez@oracle.com>
Fri, 26 Oct 2018 16:11:32 +0000 (12:11 -0400)
committerBrian Maly <brian.maly@oracle.com>
Wed, 2 Jan 2019 18:08:43 +0000 (13:08 -0500)
commit9fa5b5f6e8f239d0b668029358b0453c9b5955af
treed3acb1eaa937b002b0665892b18c13b492df0aa3
parent2c976e363616a7340b7f18f446676813bd766e06
x86/speculation: functions for supporting enhanced IBRS

Indirect Branch Restricted Speculation (IBRS) is available either
with a basic support (basic IBRS) or with an enhanced support
(enhanced IBRS). Currently only basic IBRS is implemented, and it
requires IBRS to be set after every transition to a more privileged
predictor mode.

Enhanced IBRS supports an 'always on' model in which IBRS is enabled
once and never disabled. We enhance the existing functions, introduce
new identifiers, and rename existing ones in order to be able to
differentiate between basic and enhanced IBRS.

Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Co-developed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
(cherry picked from commit d762c3e419e1df1e7671c346ab4247a495fbc3dd from UEK5)

Orabug: 28474851

Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
arch/x86/include/asm/spec_ctrl.h
(Differences in the IBRS related macro definitions. Not adding
spec_ctrl_flush_all_cpus() that is already in bugs_64.c. Change
set_ibrs_inuse() return value from boolean to void.)

arch/x86/kernel/cpu/bugs.c
(UEK4 uses bugs_64.c. Slight differences in
disable_ibrs_and_friends() and cpu_show_common().)

arch/x86/kernel/cpu/spec_ctrl.c
(No need to remove the spec_ctrl_flush_all_cpus(), it is in bugs_64.c)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/include/asm/nospec-branch.h
arch/x86/include/asm/spec_ctrl.h
arch/x86/kernel/cpu/bugs_64.c