[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1572938135-31886-10-git-send-email-rppt@kernel.org>
Date: Tue, 5 Nov 2019 09:15:31 +0200
From: Mike Rapoport <rppt@...nel.org>
To: linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Arnd Bergmann <arnd@...db.de>,
"David S. Miller" <davem@...emloft.net>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Greentime Hu <green.hu@...il.com>,
Greg Ungerer <gerg@...ux-m68k.org>,
Helge Deller <deller@....de>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
Jeff Dike <jdike@...toit.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mark Salter <msalter@...hat.com>,
Matt Turner <mattst88@...il.com>,
Michal Simek <monstr@...str.eu>, Peter Rosin <peda@...ntia.se>,
Richard Weinberger <richard@....at>,
Rolf Eike Beer <eike-kernel@...tec.de>,
Russell King <linux@...linux.org.uk>,
Sam Creasey <sammy@...my.net>,
Vincent Chen <deanbo422@...il.com>,
Vineet Gupta <Vineet.Gupta1@...opsys.com>,
Mike Rapoport <rppt@...nel.org>, linux-alpha@...r.kernel.org,
linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-c6x-dev@...ux-c6x.org, linux-kernel@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, linux-parisc@...r.kernel.org,
linux-um@...ts.infradead.org, sparclinux@...r.kernel.org,
Mike Rapoport <rppt@...ux.ibm.com>
Subject: [PATCH v4 09/13] parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup
From: Helge Deller <deller@....de>
Signed-off-by: Helge Deller <deller@....de>
Signed-off-by: Mike Rapoport <rppt@...ux.ibm.com>
---
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
Powered by blists - more mailing lists