From patchwork Wed Dec 11 12:07:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 11284833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2E7C139A for ; Wed, 11 Dec 2019 12:31:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8FD5021556 for ; Wed, 11 Dec 2019 12:31:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ddpzUjpP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FD5021556 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7B39E6B31F1; Wed, 11 Dec 2019 07:31:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 73FA26B31F6; Wed, 11 Dec 2019 07:31:22 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3432A6B31F1; Wed, 11 Dec 2019 07:31:22 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 13CDB6B31F2 for ; Wed, 11 Dec 2019 07:31:22 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id B0B938249980 for ; Wed, 11 Dec 2019 12:31:21 +0000 (UTC) X-FDA: 76252795962.08.kite83_460e5faca8c1c X-Spam-Summary: 2,0,0,c03c00e52ad38eee,d41d8cd98f00b204,peterz@infradead.org,:will@kernel.org:aneesh.kumar@linux.ibm.com:akpm@linux-foundation.org:npiggin@gmail.com:peterz@infradead.org:linux-arch@vger.kernel.org::linux-kernel@vger.kernel.org:ysato@users.sourceforge.jp:dalias@libc.org:davem@davemloft.net:deller@gmx.de:geert@linux-m68k.org:paulburton@kernel.org:tony.luck@intel.com:rth@twiddle.net:nickhu@andestech.com:paul.walmsley@sifive.com,RULES_HIT:41:152:355:379:800:960:965:966:968:973:988:989:1183:1260:1261:1277:1313:1314:1345:1431:1437:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:1981:2194:2196:2198:2199:2200:2201:2393:2559:2562:2731:2903:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3872:4250:4385:4390:4395:5007:6119:6261:6653:6742:8634:10004:10400:11026:11657:11658:11914:12043:12048:12296:12297:12438:12517:12519:13069:13311:13357:14181:14394:14659:14721:21080:21451:21627,0,RBL:198.137.202.133:@infradead.org:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,Ca cheIP:no X-HE-Tag: kite83_460e5faca8c1c X-Filterd-Recvd-Size: 3656 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Dec 2019 12:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+ZJ1DOKZOq/0j+v4BO/2WlQxRCr7GEKCNwB8JR0YAik=; b=ddpzUjpPmxkTKtzj7fKv8rcz3A YKfmo8Y8IeDliNTqcxKrsXSnpR4uU9o1TKeMsoeXW9Uox7y7K+MNJUWtU8UgySEi4LSC0nLKV49IP 4pgdnDEVoF75K7Uzjbw9OOYDhN621bhspd5JqaMePUyJw0vpbEyS8zzbodbVWzcXeQYIFBw5RNIjd kIgmXThqHI/r6tdwzY2BuLg4UQpYBayEYi7/YDiFgCNNHrVEbtUggrYw6dCBRs1H8Wh+z3Nu3pV7K i71g0NWdh13A4Smypw5ftx0m1dSDmv+5/tq7/f6ccPg3BFr/PPElpf+QBLRiB7ZPXqh0sHoUpVF1n 8QwOuO0Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1if193-0001Ph-2y; Wed, 11 Dec 2019 12:31:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0271030719C; Wed, 11 Dec 2019 13:29:44 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 5AF6420137CBE; Wed, 11 Dec 2019 13:31:02 +0100 (CET) Message-Id: <20191211122956.572325873@infradead.org> User-Agent: quilt/0.65 Date: Wed, 11 Dec 2019 13:07:29 +0100 From: Peter Zijlstra To: Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yoshinori Sato , Rich Felker , "David S. Miller" , Helge Deller , Geert Uytterhoeven , Paul Burton , Tony Luck , Richard Henderson , Nick Hu , Paul Walmsley Subject: [PATCH 16/17] nds32/tlb: Fix __p*_free_tlb() References: <20191211120713.360281197@infradead.org> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Just like regular pages, page directories need to observe the following order: 1) unhook 2) TLB invalidate 3) free to ensure it is safe against concurrent accesses. Even though NDS32 is UP only, we still need to observe this order because mmu_gather is preemptible. NDS32 does not in fact have PMDs. Signed-off-by: Peter Zijlstra (Intel) --- arch/nds32/include/asm/tlb.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/nds32/include/asm/tlb.h +++ b/arch/nds32/include/asm/tlb.h @@ -6,7 +6,12 @@ #include -#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte) +#define __pte_free_tlb(tlb, pte, address) \ +do { \ + pgtable_pte_page_dtor(pte); \ + tlb_remove_table((tlb), (pte)); \ +} while (0) + #define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tln)->mm, pmd) #endif