{
unsigned cpu = smp_processor_id();
- /* Null tsk means switching to kernel, so that's safe */
- if (ibpb_inuse && tsk &&
- ___ptrace_may_access(tsk, current, PTRACE_MODE_IBPB))
- native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
-
if (likely(prev != next)) {
+
+ /* Null tsk means switching to kernel, so that's safe */
+ if (ibpb_inuse && tsk &&
+ get_dumpable(tsk->mm) != SUID_DUMP_USER)
+ native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
+
this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK);
this_cpu_write(cpu_tlbstate.active_mm, next);
cpumask_set_cpu(cpu, mm_cpumask(next));