From patchwork Tue Nov 3 20:34:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F51C388F9 for ; Tue, 3 Nov 2020 20:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA01A223BD for ; Tue, 3 Nov 2020 20:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436822; bh=fnbyTJCQxdf7TG5t2E5u5tBxyVFzqa2UzX2cWklu1to=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t5h959+frmuTydMUTm6Sp2l2upkPWo/91QsLh2lG5xGb4S1knx6mb6iufAWk65uOD AdefZex3nNit8nRcBHU9RPPbeS8li/7Yi4XXPvphWhSLP92A3ZRGcocQPtZ64b+H3W vNWc9sl1zR/i+m/SC5t8/8LVa/d5Uka55+wwUNvI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732399AbgKCUxl (ORCPT ); Tue, 3 Nov 2020 15:53:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:51766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731766AbgKCUxg (ORCPT ); Tue, 3 Nov 2020 15:53:36 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B39BB22226; Tue, 3 Nov 2020 20:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436816; bh=fnbyTJCQxdf7TG5t2E5u5tBxyVFzqa2UzX2cWklu1to=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AM/OGgy9O/zMyMXP0ujsSzYRdlYUfH0xaSfxJYc5YuHlWTYbGy8LvS57Bp01PcJQK Ju9IhjvWJ5pUBWz+EoCdo5jVaWRVWLP/MulTfUuLRD1wNa474Jwrf24id5p0jCSWyU 68SkoCzQruxB9A2nME3D+/jRpokOzKAf5491yhoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 023/214] powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM Date: Tue, 3 Nov 2020 21:34:31 +0100 Message-Id: <20201103203252.161408033@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicholas Piggin [ 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200914045219.3736466-3-npiggin@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/mmu_context.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index ad620637cbd11..27ef333e96f6d 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -147,6 +147,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 diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 58efca9343113..f132b418a8c7a 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -216,7 +216,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 */