]> www.infradead.org Git - users/jedix/linux-maple.git/commit
retpoline: selectively disable IBRS in disable_ibrs_and_friends()
authorChuck Anderson <chuck.anderson@oracle.com>
Wed, 7 Mar 2018 05:29:14 +0000 (21:29 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 9 Mar 2018 08:19:47 +0000 (00:19 -0800)
commitdd777c19cb80969b770ed23e88118ec52fea937f
treecc73cd0cf29c682bae7794d64cbb24c02c555961
parenta6ae8a4cb0741c7f42bae573368d702487ecb5b1
retpoline: selectively disable IBRS in disable_ibrs_and_friends()

disable_ibrs_and_friends() is called:
(1) when the boot parameter "spectre_v2=off" is specified.
(2) the CPU is not affected by Spectre V2 and:
- spectre_v2=off
- or spectre_v2=auto
- or the spectre_v2 is not specified
(3) retpoline is selected as the Spectre V2 mitigation.

For (1) and (2) IBRS should be disabled (SPEC_CTRL_IBRS_ADMIN_DISABLED
is set).  This prevents setting IBRS in use even if it is the only
Spectre V2 mitigation available.

For (3) IBRS should be set not-in-use but remain enabled in case
it is selected by disable_repoline() as the fall back Spectre V2
mitigation.

Orabug: 27665263

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/kernel/cpu/bugs_64.c