powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
authorNicholas Piggin <npiggin@gmail.com>
Mon, 14 Sep 2020 04:52:17 +0000 (14:52 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:06:53 +0000 (11:06 +0100)
[ Upstream commit 66acd46080bd9e5ad2be4b0eb1d498d5145d058e ]

powerpc uses IPIs in some situations to switch a kernel thread away
from a lazy tlb mm, which is subject to the TLB flushing race
described in the changelog introducing ARCH_WANT_IRQS_OFF_ACTIVATE_MM.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200914045219.3736466-3-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/Kconfig
arch/powerpc/include/asm/mmu_context.h

index 679e1e3c1695390699b7ffae7d7a5d964ff0ed62..7cc91d7f893cf51242b10ee8be79d16c9337123a 100644 (file)
@@ -154,6 +154,7 @@ config PPC
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF         if PPC64
        select ARCH_WANT_IPC_PARSE_VERSION
+       select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
        select ARCH_WEAK_RELEASE_ACQUIRE
        select BINFMT_ELF
        select BUILDTIME_EXTABLE_SORT
index 6f67ff5a52672329f52f2c02c44daa655803368e..5f9ad4f4b9c0fed743f64a26741828fabe373aaa 100644 (file)
@@ -101,7 +101,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  */
 static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
 {
-       switch_mm(prev, next, current);
+       switch_mm_irqs_off(prev, next, current);
 }
 
 /* We don't currently use enter_lazy_tlb() for anything */