Linux-m68k Archive on lore.kernel.org
 help / color / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greentime Hu <green.hu@gmail.com>,
	Greg Ungerer <gerg@linux-m68k.org>, Helge Deller <deller@gmx.de>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Jeff Dike <jdike@addtoit.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Mark Salter <msalter@redhat.com>,
	Matt Turner <mattst88@gmail.com>, Michal Simek <monstr@monstr.eu>,
	Peter Rosin <peda@axentia.se>,
	Richard Weinberger <richard@nod.at>,
	Rolf Eike Beer <eike-kernel@sf-tec.de>,
	Russell King <linux@armlinux.org.uk>,
	Sam Creasey <sammy@sammy.net>, Vincent Chen <deanbo422@gmail.com>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	Mike Rapoport <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,
	Mike Rapoport <rppt@linux.ibm.com>
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> (raw)
In-Reply-To: <1572938135-31886-1-git-send-email-rppt@kernel.org>

From: Helge Deller <deller@gmx.de>

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Mike Rapoport <rppt@linux.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


  parent reply index

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05  7:15 [PATCH v4 00/13] mm: remove __ARCH_HAS_4LEVEL_HACK Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 01/13] alpha: use pgtable-nopud instead of 4level-fixup Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 02/13] arm: nommu: " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 03/13] c6x: " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 04/13] m68k: nommu: " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 05/13] m68k: mm: use pgtable-nopXd " Mike Rapoport
2019-11-08  8:35   ` Geert Uytterhoeven
2019-11-08 19:39   ` Andrew Morton
2019-11-09 14:26     ` Geert Uytterhoeven
2019-11-10  8:41       ` Mike Rapoport
2019-11-11 23:35       ` Andrew Morton
2019-11-05  7:15 ` [PATCH v4 06/13] microblaze: use pgtable-nopmd " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 07/13] nds32: " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 08/13] parisc: use pgtable-nopXd " Mike Rapoport
2019-11-05  7:15 ` Mike Rapoport [this message]
2019-11-05  7:15 ` [PATCH v4 10/13] sparc32: use pgtable-nopud " Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 11/13] um: remove unused pxx_offset_proc() and addr_pte() functions Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 12/13] um: add support for folded p4d page tables Mike Rapoport
2019-11-05  7:15 ` [PATCH v4 13/13] mm: remove __ARCH_HAS_4LEVEL_HACK and include/asm-generic/4level-fixup.h Mike Rapoport
2019-11-06  1:13   ` Andrew Morton
2019-11-05 14:58 ` [PATCH v4 00/13] mm: remove __ARCH_HAS_4LEVEL_HACK Anatoly Pugachev

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1572938135-31886-10-git-send-email-rppt@kernel.org \
    --to=rppt@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=deanbo422@gmail.com \
    --cc=deller@gmx.de \
    --cc=eike-kernel@sf-tec.de \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=green.hu@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=kirill@shutemov.name \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mattst88@gmail.com \
    --cc=monstr@monstr.eu \
    --cc=msalter@redhat.com \
    --cc=peda@axentia.se \
    --cc=richard@nod.at \
    --cc=rppt@linux.ibm.com \
    --cc=sammy@sammy.net \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-m68k Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-m68k/0 linux-m68k/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-m68k linux-m68k/ https://lore.kernel.org/linux-m68k \
		linux-m68k@vger.kernel.org linux-m68k@lists.linux-m68k.org
	public-inbox-index linux-m68k

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-m68k


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git