Skip to content

Commit e3783eb

Browse files
npiggingregkh
authored andcommitted
powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
[ Upstream commit 66acd46 ] 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>
1 parent 5311d47 commit e3783eb

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ config PPC
148148
select ARCH_USE_QUEUED_RWLOCKS if PPC_QUEUED_SPINLOCKS
149149
select ARCH_USE_QUEUED_SPINLOCKS if PPC_QUEUED_SPINLOCKS
150150
select ARCH_WANT_IPC_PARSE_VERSION
151+
select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
151152
select ARCH_WEAK_RELEASE_ACQUIRE
152153
select BINFMT_ELF
153154
select BUILDTIME_TABLE_SORT

arch/powerpc/include/asm/mmu_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
244244
*/
245245
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
246246
{
247-
switch_mm(prev, next, current);
247+
switch_mm_irqs_off(prev, next, current);
248248
}
249249

250250
/* We don't currently use enter_lazy_tlb() for anything */

0 commit comments

Comments
 (0)