From patchwork Tue Nov 5 07:15:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 11227051 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 A3AC61390 for ; Tue, 5 Nov 2019 07:17:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 829C820818 for ; Tue, 5 Nov 2019 07:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572938233; bh=fDiqm/damFNz7xG0t39R7SwZGjDrTUDgZUjYLDoVD3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=w3OjcyYqHkcIkA99b0XasD61kom2359qneG6s5TJjvDL4TMSXWFh71ktroQZ3kFAs MLtLSFLl1wzex4k4z4DkEPRZV5dp9h2MVgltuLS6EAIh6UL5pjJrtHegQfy3lNI9QK FXmQ/n2Tw0ScPO8VUx11v2ytmBDHG1r0RjQBluLk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387916AbfKEHRN (ORCPT ); Tue, 5 Nov 2019 02:17:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:36456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387715AbfKEHRM (ORCPT ); Tue, 5 Nov 2019 02:17:12 -0500 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 E24FB20663; Tue, 5 Nov 2019 07:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572938232; bh=fDiqm/damFNz7xG0t39R7SwZGjDrTUDgZUjYLDoVD3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hBG7ngRnawj2lIkutPcXrYRN5U9QhfIOGB4xexBOR7scFEam0W/Uj/fsaew0nn3uM Omx5OYWR1m8AOP7IsbxTjDevz8AFO2c52jT+3dSrE/9rsNCGEQS/o6oTH3hGMPEkBu 5BwGG87ty4nW4cJcExYMzMISZYObZzGGLizO8vlo= 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, Mike Rapoport Subject: [PATCH v4 09/13] parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup Date: Tue, 5 Nov 2019 09:15:31 +0200 Message-Id: <1572938135-31886-10-git-send-email-rppt@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572938135-31886-1-git-send-email-rppt@kernel.org> References: <1572938135-31886-1-git-send-email-rppt@kernel.org> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org From: Helge Deller Signed-off-by: Helge Deller Signed-off-by: Mike Rapoport --- 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;