Skip to content

Commit 691d526

Browse files
author
Martin Schwidefsky
committed
s390/mm: fix incorrect ASCE after crst_table_downgrade
The switch_mm function does nothing in case the prev and next mm are the same. It can happen that a crst_table_downgrade has changed the top-level pgd in the meantime on a different CPU. Always store the new ASCE to be picked up in entry.S. [heiko.carstens@de.ibm.com]: Bug was introduced with git commit 53e857f ("s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries") and causes random crashes due to broken page tables being used. Reported-by: Dominik Vogt <vogt@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
1 parent a9ca8eb commit 691d526

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/include/asm/mmu_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
6262
{
6363
int cpu = smp_processor_id();
6464

65+
S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd);
6566
if (prev == next)
6667
return;
6768
if (MACHINE_HAS_TLB_LC)
@@ -73,7 +74,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
7374
atomic_dec(&prev->context.attach_count);
7475
if (MACHINE_HAS_TLB_LC)
7576
cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
76-
S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd);
7777
}
7878

7979
#define finish_arch_post_lock_switch finish_arch_post_lock_switch

0 commit comments

Comments
 (0)