Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[cascardo/linux.git] / arch / s390 / include / asm / mmu_context.h
index 3ce3854..c6a088c 100644 (file)
@@ -20,7 +20,7 @@ static inline int init_new_context(struct task_struct *tsk,
        spin_lock_init(&mm->context.gmap_lock);
        INIT_LIST_HEAD(&mm->context.gmap_list);
        cpumask_clear(&mm->context.cpu_attach_mask);
-       atomic_set(&mm->context.attach_count, 0);
+       atomic_set(&mm->context.flush_count, 0);
        mm->context.flush_mm = 0;
 #ifdef CONFIG_PGSTE
        mm->context.alloc_pgste = page_table_allocate_pgste;
@@ -91,15 +91,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
        S390_lowcore.user_asce = next->context.asce;
        if (prev == next)
                return;
-       if (MACHINE_HAS_TLB_LC)
-               cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
+       cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
+       cpumask_set_cpu(cpu, mm_cpumask(next));
        /* Clear old ASCE by loading the kernel ASCE. */
        __ctl_load(S390_lowcore.kernel_asce, 1, 1);
        __ctl_load(S390_lowcore.kernel_asce, 7, 7);
-       atomic_inc(&next->context.attach_count);
-       atomic_dec(&prev->context.attach_count);
-       if (MACHINE_HAS_TLB_LC)
-               cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
+       cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
 }
 
 #define finish_arch_post_lock_switch finish_arch_post_lock_switch
@@ -111,10 +108,9 @@ static inline void finish_arch_post_lock_switch(void)
        load_kernel_asce();
        if (mm) {
                preempt_disable();
-               while (atomic_read(&mm->context.attach_count) >> 16)
+               while (atomic_read(&mm->context.flush_count))
                        cpu_relax();
 
-               cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
                if (mm->context.flush_mm)
                        __tlb_flush_mm(mm);
                preempt_enable();
@@ -129,7 +125,6 @@ static inline void activate_mm(struct mm_struct *prev,
                                struct mm_struct *next)
 {
        switch_mm(prev, next, current);
-       cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
        set_user_asce(next);
 }