]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Always disable IBRS in disable_ibrs_and_friends()
authorAlejandro Jimenez <alejandro.j.jimenez@oracle.com>
Fri, 21 Dec 2018 19:15:36 +0000 (14:15 -0500)
committerBrian Maly <brian.maly@oracle.com>
Tue, 8 Jan 2019 15:36:05 +0000 (10:36 -0500)
commit06eac7d086259b1a15460175f17270c443b62493
tree0553909aad463a3500ee6e8ede32b1b4e4a98ed7
parent926609356d0374633bb18483e4aa4cc93642a895
x86/speculation: Always disable IBRS in disable_ibrs_and_friends()

Booting with "spectre_v2=retpoline" calls disable_ibrs_and_friends(false),
which does not set ibrs_disabled. Then, when attempting to enable
IBRS by writing 1 to ibrs_enabled, change_spectre_v2_mitigation() is called
and it looks like IBRS is already in use (ibrs_used = !ibrs_disabled) so it
does not activate IBRS.

Because now we use change_spectre_v2_mitigation() to activate IBRS when
using the retpoline fallback mechanism, and this function clears
ibrs_disabled before activating IBRS, we can fix disable_ibrs_and_friends()
and set ibrs_disabled there every time.

Orabug: 29139710

Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/bugs_64.c