Skip to content

Commit e7758c0

Browse files
committed
Merge tag 'powerpc-6.4-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fix from Michael Ellerman: - Disable IRQs when switching mm in exit_lazy_flush_tlb() called from exit_mmap() Thanks to Nicholas Piggin and Sachin Sant. * tag 'powerpc-6.4-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s/radix: Fix exit lazy tlb mm switch with irqs enabled
2 parents 4a426aa + dfaed3e commit e7758c0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/powerpc/mm/book3s64/radix_tlb.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,20 @@ void exit_lazy_flush_tlb(struct mm_struct *mm, bool always_flush)
795795
goto out;
796796

797797
if (current->active_mm == mm) {
798+
unsigned long flags;
799+
798800
WARN_ON_ONCE(current->mm != NULL);
799-
/* Is a kernel thread and is using mm as the lazy tlb */
801+
/*
802+
* It is a kernel thread and is using mm as the lazy tlb, so
803+
* switch it to init_mm. This is not always called from IPI
804+
* (e.g., flush_type_needed), so must disable irqs.
805+
*/
806+
local_irq_save(flags);
800807
mmgrab_lazy_tlb(&init_mm);
801808
current->active_mm = &init_mm;
802809
switch_mm_irqs_off(mm, &init_mm, current);
803810
mmdrop_lazy_tlb(mm);
811+
local_irq_restore(flags);
804812
}
805813

806814
/*

0 commit comments

Comments
 (0)