]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/bugs/IBRS: properly use the _base ops if IBRS is currently unset
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Wed, 10 Oct 2018 09:07:18 +0000 (17:07 +0800)
committerBrian Maly <brian.maly@oracle.com>
Thu, 11 Oct 2018 21:27:00 +0000 (17:27 -0400)
... or else we can run into an idle state with IBRS enabled which lead to
low performance.

Orabug: 28782729

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/bugs_64.c

index 900fc409aea4b2d32e64e5a0a5c1fa36ae423927..07eefe862036bf48b729351e40c100cc636d64e9 100644 (file)
@@ -266,7 +266,7 @@ void x86_spec_ctrl_set(u64 val)
                        else
                                host = val & ~(SPEC_CTRL_SSBD);
                } else {
-                       if (ibrs_inuse)
+                       if (ibrs_inuse && (val & SPEC_CTRL_IBRS))
                                host = this_cpu_read(x86_spec_ctrl_priv_cpu);
                        else
                                host = x86_spec_ctrl_base;