From e8d36c971676efa3e316d1c44f6807ce8c9c9725 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Sun, 21 Jan 2018 08:21:28 -0500 Subject: [PATCH] x86: Use PRED_CMD MSR when ibpb is enabled Since we have the knobs we should depend on those. OraBug: 27448280 Reviewed-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk --- arch/x86/mm/tlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 9b876a8cc4a6..dd0c56c68faa 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * TLB flushing, formerly SMP-only @@ -104,7 +105,7 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next, unsigned cpu = smp_processor_id(); /* Null tsk means switching to kernel, so that's safe */ - if (boot_cpu_has(X86_FEATURE_SPEC_CTRL) && tsk && + if (ibpb_inuse && tsk && ___ptrace_may_access(tsk, current, PTRACE_MODE_IBPB)) native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB); -- 2.50.1