Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3593510ybx; Sun, 3 Nov 2019 22:59:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxXFlIVNPxT8Sj41Xyj2fc8D9UJ9rQIldEj8MAu1ZthS9r/w5ubpcI7pQ7E9oLNMGVPkAm7 X-Received: by 2002:a17:906:298f:: with SMTP id x15mr22283641eje.50.1572850790745; Sun, 03 Nov 2019 22:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572850790; cv=none; d=google.com; s=arc-20160816; b=eBUdo9mykwIHW//GncHPx/BACQeoF6/aX20G2TekKyQYXsqaFBX/FhK2yKAULLin/w hXJ5Ib2IN8amt/vgr0XIzAMf15bm9C6kCPyJzYUU4djcrwU0+bMQnfZ/JFCcsnzwdyJy yUiHg7Ur9BF3AhcvL9shoiUKUdtc8dtPdi7YeGcoBCbWtu0zOBm4A/pqAwd/XPwD65Rt gCzdcTX8cDPPzGmMM0f534PBx+o03VpaVOCmzyTru6VxiKGLwewCYTwYT6HUB8wuHROw En2GLX8DDw9PCmIwpL6pjg4gfzQHTuvnJA6WH4hDohrv9/H3kjvJomtMYfZDCk5uPQQd LFnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=N+ejMkkCre7m6tsOGd1qjziqGW8PubYpyhwISEyDVE8=; b=pErnpPII2/ByDqW6CSi7ohF9KqDPzTBthaGptpieT+tI/mX4A5Zvj/kDh3MzXlXWgd vj9vKqL0xSMptf5mwb1fXpP1aqUNv0wiFaiEO2LPi4Xmqh+iu9GwujcY88xXrXe628Z5 27OpWuF0GP2q7MEXMAjLxUuuXxCC7od5uwfLDuo/6yQ94KhMeFNo+7a6ge8yQeIx96nl s88S9AFxeoSPqqsB6lcmXqmoBfmZkFP9lviPSPVA440gv/jfIK4yaNjHVMYFoTEGq+t0 ArfJ86P3jNQUAR3c4r27yrYvfnzhYLYhX2UDCB+hc6zd8x0aaGO/WJIDESjvmQuIucJH jZCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+Z6xFsh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si11481636ejl.235.2019.11.03.22.59.26; Sun, 03 Nov 2019 22:59:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+Z6xFsh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbfKDG6F (ORCPT + 99 others); Mon, 4 Nov 2019 01:58:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:33972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfKDG6E (ORCPT ); Mon, 4 Nov 2019 01:58:04 -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 9298B222D4; Mon, 4 Nov 2019 06:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572850684; bh=fDiqm/damFNz7xG0t39R7SwZGjDrTUDgZUjYLDoVD3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q+Z6xFshUx2AHAxU2CUoSUL9VakeQeqWD52XYfrZahAKAuW3kWIK63ryb7UB4hEdl /UhYszl3oYbN/ZUAudNB7x9tvq7e1Z4dc6zISzxJo+buffE3+jfiqPphxjBkwhnyUB kSjU9tTQVl8nVkizIFuvXIwOMTrNdbxOiGaJrK2w= 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 v3 09/13] parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup Date: Mon, 4 Nov 2019 08:56:23 +0200 Message-Id: <1572850587-20314-10-git-send-email-rppt@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572850587-20314-1-git-send-email-rppt@kernel.org> References: <1572850587-20314-1-git-send-email-rppt@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; -- 2.7.4