From patchwork Fri Nov 1 08:39:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 11222665 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 A5D601747 for ; Fri, 1 Nov 2019 08:41:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7225B21855 for ; Fri, 1 Nov 2019 08:41:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="lMHEszAw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7225B21855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACE896B0006; Fri, 1 Nov 2019 04:41:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A7DDE6B0010; Fri, 1 Nov 2019 04:41:17 -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 9BA6A6B0266; Fri, 1 Nov 2019 04:41:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 7F9286B0006 for ; Fri, 1 Nov 2019 04:41:17 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 298F9181AEF1F for ; Fri, 1 Nov 2019 08:41:17 +0000 (UTC) X-FDA: 76107064194.18.stamp22_6280fc1d2e715 X-Spam-Summary: 2,0,0,3838bf1b86e7819a,d41d8cd98f00b204,rppt@kernel.org,::akpm@linux-foundation.org:anton.ivanov@cambridgegreys.com:arnd@arndb.de:davem@davemloft.net:geert@linux-m68k.org:green.hu@gmail.com:gerg@linux-m68k.org:deller@gmx.de:james.bottomley@hansenpartnership.com:jdike@addtoit.com:kirill@shutemov.name:torvalds@linux-foundation.org:msalter@redhat.com:mattst88@gmail.com:monstr@monstr.eu:peda@axentia.se:richard@nod.at:eike-kernel@sf-tec.de:linux@armlinux.org.uk:sammy@sammy.net:deanbo422@gmail.com:vineet.gupta1@synopsys.com:rppt@kernel.org:linux-alpha@vger.kernel.org:linux-arch@vger.kernel.org:linux-arm-kernel@lists.infradead.org:linux-c6x-dev@linux-c6x.org:linux-kernel@vger.kernel.org:linux-m68k@lists.linux-m68k.org:linux-parisc@vger.kernel.org:linux-um@lists.infradead.org:sparclinux@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:988:989:1260:1345:1359:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3353:3876:3877:4321:4605:5007:6114:61 19:6261: X-HE-Tag: stamp22_6280fc1d2e715 X-Filterd-Recvd-Size: 4099 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 Nov 2019 08:41:16 +0000 (UTC) Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03111204FD; Fri, 1 Nov 2019 08:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572597675; bh=Y+gVGE10d245e4VHi4PQWwWLSbG+tRT9WV2TxjQTg00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMHEszAwJRDUouW5sxrto+Kxqo5UaNweEI0CjbJ6kSxa+0wd79DAjqceF//fQ2vI3 Hp8Ni6Pw1rQDifFO2qSMyiF2b5gX6FhO3UrkE75j1NVVkNZJWoBva5NfjexeFuJCbv axTqcibmW01UKh64fJWjPPzg76jGDqkerkonz21g= From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Anton Ivanov , Arnd Bergmann , "David S. Miller" , Geert Uytterhoeven , Greentime Hu , Greg Ungerer , Helge Deller , "James E.J. Bottomley" , Jeff Dike , "Kirill A. Shutemov" , Linus Torvalds , Mark Salter , Matt Turner , Michal Simek , Peter Rosin , Richard Weinberger , Rolf Eike Beer , Russell King , Sam Creasey , Vincent Chen , Vineet Gupta , Mike Rapoport , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, sparclinux@vger.kernel.org Subject: [PATCH v2 09/13] parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup Date: Fri, 1 Nov 2019 10:39:40 +0200 Message-Id: <1572597584-6390-10-git-send-email-rppt@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572597584-6390-1-git-send-email-rppt@kernel.org> References: <1572597584-6390-1-git-send-email-rppt@kernel.org> 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: From: Helge Deller Signed-off-by: Helge Deller --- arch/parisc/mm/hugetlbpage.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/parisc/mm/hugetlbpage.c b/arch/parisc/mm/hugetlbpage.c index d578809..0e1e212 100644 --- a/arch/parisc/mm/hugetlbpage.c +++ b/arch/parisc/mm/hugetlbpage.c @@ -49,6 +49,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz) { pgd_t *pgd; + p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; @@ -61,7 +62,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, addr &= HPAGE_MASK; pgd = pgd_offset(mm, addr); - pud = pud_alloc(mm, pgd, addr); + p4d = p4d_offset(pgd, addr); + pud = pud_alloc(mm, p4d, addr); if (pud) { pmd = pmd_alloc(mm, pud, addr); if (pmd) @@ -74,6 +76,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, unsigned long sz) { pgd_t *pgd; + p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; @@ -82,11 +85,14 @@ pte_t *huge_pte_offset(struct mm_struct *mm, pgd = pgd_offset(mm, addr); if (!pgd_none(*pgd)) { - pud = pud_offset(pgd, addr); - if (!pud_none(*pud)) { - pmd = pmd_offset(pud, addr); - if (!pmd_none(*pmd)) - pte = pte_offset_map(pmd, addr); + p4d = p4d_offset(pgd, addr); + if (!p4d_none(*p4d)) { + pud = pud_offset(p4d, addr); + if (!pud_none(*pud)) { + pmd = pmd_offset(pud, addr); + if (!pmd_none(*pmd)) + pte = pte_offset_map(pmd, addr); + } } } return pte;