Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp807037pxb; Tue, 3 Nov 2020 13:04:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjP5X15Qh+w+1zlaTI6ojnZs6HWlzLezuQuRNBmnJgZz1sw+Vr4PIMKYTO4iJ0oXKCC3Kd X-Received: by 2002:a17:906:43c6:: with SMTP id j6mr21699469ejn.547.1604437491279; Tue, 03 Nov 2020 13:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437491; cv=none; d=google.com; s=arc-20160816; b=neB6wCIosY5FDqSYh9TCdSoeTDIzc6vBAsS9TFuYUJZ+QIUrbwG98G4xOGQ6V1h44c LKxQYk8EHjmgoICj60Vmr0rZgjEUIMHLnP9wLHSbo9Tv80f29Et/00djg8jWaEtA+gSL vGI7WfMFIT8KCDsnHhtUB6T7jzyqhqXsJrLDJOTTI2ZDClL/IBPfK4ZHMwnwveMXwiSk IgG1TBWbCksYOioPuETHpeezQLuePLUC0uU2izXmCcquBdeKfg4fmoOT6t1CnQC2rVpl YpcEiM9ykjkYXrgincAFVZJVMY8Q+W89TmgET8KtDMp62EH6qsAqXgQf5U76vrf4f4QD flow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o8LW8dqfLd7HiIAE0UBluc0cuRry5yjHSIAgBJxQWUU=; b=q+1csTJMpBqmsCuZZP+XQ9shPgGv8s2jNAHNmiPaVmwEIn0AigQs/m+8LX3lmIlPWY zbEYAjU44/pjigrNF7DqI01/DGgf46n83ZtHhGFAfPOHGmKe3/Y626Qjg4+ESOZEWhYd fyNLYtPyKU+845pnZgvcv4Z2PikH28N32ZWv+29DR7olBGWlweh4B5hRR1qxgbbr1L49 4yRar1rAQQw2TVHaS1kErwtVLGfvx2gPyxkBjKnB+HpJPj2vw6T3ffgImNKyOZmAaXPL UKpV/dw7MQ68PzEnbNJ0wgrF6h01RHErbXTl/+7u0zXcstKzH6pYOof5uI3arKDbKDr7 Ww8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AnpFzgeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si7249005edq.105.2020.11.03.13.04.28; Tue, 03 Nov 2020 13:04:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AnpFzgeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733063AbgKCVDN (ORCPT + 99 others); Tue, 3 Nov 2020 16:03:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:40500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387871AbgKCVDJ (ORCPT ); Tue, 3 Nov 2020 16:03:09 -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 2FFC920658; Tue, 3 Nov 2020 21:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437388; bh=OKEYqE4th6vUDiX5Ad/3qkvWw0XewGsrxHkQwjfXZwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AnpFzgePkq/06Cjc7AJMoHL20YweT+RkfR50H3QsOXWZ0+dzxexSsh63Op+SCVSQ1 npTztVnX9xE+fm2ZLxPOkBsaSIK87VGpt+7UoIh0VtvHONz25JtBQz9PraYvn/zJ8f Wx88ZLVTyPHleZCiuMyVll/0VuFd0PDSRPS8lS8E= 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 4.19 056/191] powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM Date: Tue, 3 Nov 2020 21:35:48 +0100 Message-Id: <20201103203239.940977599@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 f38d153d25861..0bc53f0e37c0f 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -152,6 +152,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 ae953958c0f33..d93bdcaa4a469 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -204,7 +204,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 */ -- 2.27.0