From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 60F66C43603 for ; Wed, 11 Dec 2019 12:31:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24A00214AF for ; Wed, 11 Dec 2019 12:31:39 +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 24A00214AF 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) Received: by kanga.kvack.org (Postfix, from userid 40) id 73FA26B31F6; Wed, 11 Dec 2019 07:31:22 -0500 (EST) 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-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-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 Content-Type: text/plain; charset=UTF-8 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