]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/spectre_v2: Disable IBRS if spectre_v2=off
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 9 Feb 2018 22:19:01 +0000 (17:19 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Sat, 10 Feb 2018 01:05:20 +0000 (17:05 -0800)
commit4583a6bc9877a75d8b7feb5fc1039c880c54c300
tree4e3a60326acb6cdbbb95dafb48b1992909894b95
parentc859a422b74865f18014fb84ff6b301db2ab2f43
x86/spectre_v2: Disable IBRS if spectre_v2=off

We found some interesting behaviors when booting on IBRS enabled
hardware where 'spectre_v2=off' did not disable IBRS completely.

That is during the bootup we received some interrupts which
meant that we set the MSR 0x48 to 1.. and then when we got
to the code that handles 'spectre_v2=off' we would just
call 'set_ibrs_disabled' which would clear the in_use parameter.

But that would not clear the wedged MSR 048 being set to 1.

Which means we would continue on with both retpoline and IBRS on!

The fix is rather simple -  clear the MSR as well.

Note that if 'noibrs' was used - then we would have disabled the
IBRS _before_ we got the interrupt, as 'noibrs' is an early parameter.

OraBug: 27525754
Reported-by: Yao-Min Chen <yaomin.chen@oracle.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/kernel/cpu/bugs_64.c