Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1152779pxk; Fri, 18 Sep 2020 05:20:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO18pVkhPJ4TAw48/k26FzPqVZwY4FXAEEP71CsWCBJ4EJfv/FGgQp0yZhgiVeHGKkeEJw X-Received: by 2002:a17:906:c2c5:: with SMTP id ch5mr36668387ejb.183.1600431639808; Fri, 18 Sep 2020 05:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600431639; cv=none; d=google.com; s=arc-20160816; b=SpQ6SEb/CnunTKG1NJcrd9IBej2tBHUDiAEcClPFxU0Y/m3q1KLjWCtqhe23CsSF2T 1WyL8YLoAwjkeeRZwxVAvIIzkhhMBHtM2xz7ePfZFFjzd8f0Zd9c+95ZvRf1l7jaWbRg YNWm+juGiA4qBGBdZSknoZiwMO0MCtnsB4cejW7X4VvmEv5or6M5Cuzc26p/By4tX/Sj XG6D9sIZgUwvEZxo7XgRrAm0juja1ZlAbwyfUUkilPfjE1B13/ijGfGOCM9p4QTZH2tZ Hap+n1WtXf53tNRshuVaPSIB7x5w00M3VlZFaykwCEcgCsOzGcIfAw4mDX7HqlCWx9B2 RG8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=k+jx7Fw+Y8Df4onHZe5Pn1VRBLyJIAK4AOJ0o0jG2QE=; b=MFUVda0sy4q0oOpszXwsFScKrZR7Ogc4kc93qgBoBs2JK6xsVjZ+SZkUjKjrXEuziL f7hej8Lwmen/wOL3VH+zfomzCeE8rkr0YNbnDP+am/82fnBf+SFd+pfqABt+d6gYzVg9 CDpuWaNJ/lOlZEqC9C1rmolZBKtVEYZ4to4y/8IIyY+BFMWslDJhTi9Z0yJD44k26A4u dVnn5fyapWekiXWRiV8O2dLik/IFZVG1wN3kF7pBZq9gSQqeMpGTFjMAhvFtYuSv7UoD wboP8m0EyLqvpEPINq4znTSQ+DqwQyG2ETnLpv0Y7bQL6z7BYhAE58PH1013ER4r1+20 tdTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=mDA5YloO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si1944263eds.367.2020.09.18.05.20.16; Fri, 18 Sep 2020 05:20:39 -0700 (PDT) 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=@ellerman.id.au header.s=201909 header.b=mDA5YloO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726392AbgIRMSu (ORCPT + 99 others); Fri, 18 Sep 2020 08:18:50 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:57113 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgIRMSu (ORCPT ); Fri, 18 Sep 2020 08:18:50 -0400 X-Greylist: delayed 87808 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Sep 2020 08:18:48 EDT Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BtCYK40Jjz9sT5; Fri, 18 Sep 2020 22:18:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1600431526; bh=eZsLlZGMKeQkS+03FKo604w9V86XaFWLGzm8pTD5+uI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mDA5YloOUUj1YlrkqhB+NWmP7C+oK2/lEb51pnY0pmK1q+xi+YZdJF9hhzLw5ssGQ 5vsW8B/AbgZLkyYtLDnDusK8tTY7tnBUCe4RArSx6pTDEhm9wVpRd05HuuBAxdlGzv q3xStD52WpU801nnx+2eiKW4wL9M2IuTDP8yKJJiHVgJnP29Wlvxjc2hG4FL9b8n+V EQCPIKrQRI/VIOiFlLt9gv3zsRcuTbu8sqKgEppJ2TKcEsreQ6q172d2ktOnyrkxW7 JeHMrR3RHMLBvdj9QS6Ee3N4/3EwF9bulqzLN+rYEgbu8Mga9FBrr/HEdUT7ehUqmg U/rIeVSqeMwbQ== From: Michael Ellerman To: Nicholas Piggin , peterz@infradead.org Cc: Jens Axboe , linux-arch@vger.kernel.org, "linux-mm \@ kvack . org" , "Aneesh Kumar K . V" , linux-kernel@vger.kernel.org, Andy Lutomirski , Dave Hansen , sparclinux@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S . Miller" Subject: Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race In-Reply-To: <1600137586.nypnz3sbcl.astroid@bobo.none> References: <20200914045219.3736466-1-npiggin@gmail.com> <20200914045219.3736466-2-npiggin@gmail.com> <20200914105617.GP1362448@hirez.programming.kicks-ass.net> <1600137586.nypnz3sbcl.astroid@bobo.none> Date: Fri, 18 Sep 2020 22:18:44 +1000 Message-ID: <87a6xn6zx7.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nicholas Piggin writes: > Excerpts from peterz@infradead.org's message of September 14, 2020 8:56 pm: >> On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote: >>> Reading and modifying current->mm and current->active_mm and switching >>> mm should be done with irqs off, to prevent races seeing an intermediate >>> state. ... >>> >>> This is a bit ugly, but in the interest of fixing the bug and backporting >>> before all architectures are converted this is a compromise. >>> >>> Signed-off-by: Nicholas Piggin >> >> Acked-by: Peter Zijlstra (Intel) >> >> I'm thinking we want this selected on x86 as well. Andy? > > Thanks for the ack. The plan was to take it through the powerpc tree, > but if you'd want x86 to select it, maybe a topic branch? I've put this series in a topic branch based on v5.9-rc2: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/irqs-off-activate-mm I plan to merge it into the powerpc/next tree for v5.10, but if anyone else wants to merge it that's fine too. cheers