From patchwork Fri Jul 17 11:10:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 11669999 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 E6EBB1751 for ; Fri, 17 Jul 2020 11:35:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B191B20717 for ; Fri, 17 Jul 2020 11:35:16 +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="GsN9f7zd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B191B20717 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 3DC4C8D004A; Fri, 17 Jul 2020 07:35:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3B4018D0040; Fri, 17 Jul 2020 07:35:15 -0400 (EDT) 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 2CA7F8D004A; Fri, 17 Jul 2020 07:35:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 191108D0040 for ; Fri, 17 Jul 2020 07:35:15 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CFA831827058B for ; Fri, 17 Jul 2020 11:35:14 +0000 (UTC) X-FDA: 77047361748.29.shape51_050555e26f0a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id A3E5A1846CCD4 for ; Fri, 17 Jul 2020 11:35:14 +0000 (UTC) X-Spam-Summary: 1,0,0,0347ffa33ed17122,d41d8cd98f00b204,peterz@infradead.org,,RULES_HIT:41:152:355:379:800:960:966:968:973:988:989:1183:1260:1261:1277:1313:1314:1345:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2196:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3874:4250:4385:5007:6261:6653:6742:8634:9592:10004:10400:11026:11473:11657:11658:11914:12043:12048:12296:12297:12438:12517:12519:12679:13069:13221:13229:13311:13357:14181:14394:14659:14721:21080:21433:21451:21627:30003:30054:30055,0,RBL:90.155.50.34:@infradead.org:.lbl8.mailshell.net-64.201.201.201 62.8.15.100;04yfta3c7osmku7wpugine9mpetiwop9qtndm36xaewkgfu195sir5fiko5kgxa.kdx4jn449gmdt8rdjarmtr17y79ropnkgsnky1py1bf16zrkkbhep6x4yp57ynj.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: shape51_050555e26f0a X-Filterd-Recvd-Size: 4178 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jul 2020 11:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=JpsKOsZ9DAnC7hF8A6UR44iGc8j6T+HCUrwgJT3qna0=; b=GsN9f7zd3xGQm9E7Rs/9GO6Onv tQFOciWVNRa0dSkuBi2M3LCrvRWcBpajEzmYqEbvlBaXEJj5TVu8rwQy1Q7CNM7FZR48rVSTeBEGI rxqAK1jJtMJgtXRWRByIMPriLYyhgef4TVlkdIWBk/HEuGJcrF5ZqBi4hDqMeVize23cLJ0dbQ2Rr ip6Sj9RwHTkJWgq4VEYAlzp2yq6rkCH7ht7KXWI/JDmBlDwMD1hfEqR0twYDRHj0D9qMYMWXXgvJy 1co1QpT2PKFq+vwxgBdv2Cf4ZMf4aetp6NLBpyaXqUnapfRc5si+FOdHmr45RHoiibPH/LNSuP/jA R5Ykw5SA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwOJa-00051V-96; Fri, 17 Jul 2020 11:14:07 +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 0D7ED300446; Fri, 17 Jul 2020 13:14:02 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id AC1F7203D4090; Fri, 17 Jul 2020 13:14:02 +0200 (CEST) Message-ID: <20200717111349.475459591@infradead.org> User-Agent: quilt/0.66 Date: Fri, 17 Jul 2020 13:10:07 +0200 From: Peter Zijlstra To: Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra Cc: linux-arch@vger.kernel.org, linux-sh@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 , John Paul Adrian Glaubitz , Christoph Hellwig , Geert Uytterhoeven Subject: [PATCH v2 02/11] sh/tlb: Fix PGTABLE_LEVELS > 2 References: <20200717111005.024867618@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: A3E5A1846CCD4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: Geert reported that his SH7722-based Migo-R board failed to boot after commit: c5b27a889da9 ("sh/tlb: Convert SH to generic mmu_gather") That commit fell victim to copying the wrong pattern -- __pmd_free_tlb() used to be implemented with pmd_free(). Fixes: c5b27a889da9 ("sh/tlb: Convert SH to generic mmu_gather") Reported-by: Geert Uytterhoeven Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven --- a/arch/sh/include/asm/pgalloc.h +++ b/arch/sh/include/asm/pgalloc.h @@ -12,6 +12,7 @@ extern void pgd_free(struct mm_struct *m extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address); extern void pmd_free(struct mm_struct *mm, pmd_t *pmd); +#define __pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, (pmdp)) #endif static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, @@ -33,13 +34,4 @@ do { \ tlb_remove_page((tlb), (pte)); \ } while (0) -#if CONFIG_PGTABLE_LEVELS > 2 -#define __pmd_free_tlb(tlb, pmdp, addr) \ -do { \ - struct page *page = virt_to_page(pmdp); \ - pgtable_pmd_page_dtor(page); \ - tlb_remove_page((tlb), page); \ -} while (0); -#endif - #endif /* __ASM_SH_PGALLOC_H */