From: Zhenzhong Duan Date: Wed, 10 Oct 2018 09:07:18 +0000 (+0800) Subject: x86/bugs/IBRS: properly use the _base ops if IBRS is currently unset X-Git-Tag: v4.1.12-124.31.3~491 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8b44d2a3d7ada0818db085f453c4444adb21b82b;p=users%2Fjedix%2Flinux-maple.git x86/bugs/IBRS: properly use the _base ops if IBRS is currently unset ... or else we can run into an idle state with IBRS enabled which lead to low performance. Orabug: 28782729 Signed-off-by: Zhenzhong Duan Signed-off-by: Brian Maly --- diff --git a/arch/x86/kernel/cpu/bugs_64.c b/arch/x86/kernel/cpu/bugs_64.c index 900fc409aea4..07eefe862036 100644 --- a/arch/x86/kernel/cpu/bugs_64.c +++ b/arch/x86/kernel/cpu/bugs_64.c @@ -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;