Linux OpenRISC platform development
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 19 Feb 2020 14:24:20 +0100	[thread overview]
Message-ID: <20200219132420.GA5559@hump> (raw)
In-Reply-To: <5b7c3929-5833-8ceb-85c8-a8e92e6a138e@c-s.fr>

On Wed, Feb 19, 2020 at 01:07:55PM +0100, Christophe Leroy wrote:
> 
> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
> > diff --git a/arch/powerpc/mm/ptdump/ptdump.c b/arch/powerpc/mm/ptdump/ptdump.c
> > index 206156255247..7bd4b81d5b5d 100644
> > --- a/arch/powerpc/mm/ptdump/ptdump.c
> > +++ b/arch/powerpc/mm/ptdump/ptdump.c
> > @@ -277,9 +277,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
> >   	}
> >   }
> > -static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
> > +static void walk_pud(struct pg_state *st, p4d_t *p4d, unsigned long start)
> >   {
> > -	pud_t *pud = pud_offset(pgd, 0);
> > +	pud_t *pud = pud_offset(p4d, 0);
> >   	unsigned long addr;
> >   	unsigned int i;
> > @@ -293,6 +293,22 @@ static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
> >   	}
> >   }
> > +static void walk_p4d(struct pg_state *st, pgd_t *pgd, unsigned long start)
> > +{
> > +	p4d_t *p4d = p4d_offset(pgd, 0);
> > +	unsigned long addr;
> > +	unsigned int i;
> > +
> > +	for (i = 0; i < PTRS_PER_P4D; i++, p4d++) {
> > +		addr = start + i * P4D_SIZE;
> > +		if (!p4d_none(*p4d) && !p4d_is_leaf(*p4d))
> > +			/* p4d exists */
> > +			walk_pud(st, p4d, addr);
> > +		else
> > +			note_page(st, addr, 2, p4d_val(*p4d));
> 
> Level 2 is already used by walk_pud().
> 
> I think you have to increment the level used in walk_pud() and walk_pmd()
> and walk_pte()

Thanks for catching this!
I'll fix the numbers in the next version.
 
> > +	}
> > +}
> > +
> >   static void walk_pagetables(struct pg_state *st)
> >   {
> >   	unsigned int i;
> > @@ -306,7 +322,7 @@ static void walk_pagetables(struct pg_state *st)
> >   	for (i = pgd_index(addr); i < PTRS_PER_PGD; i++, pgd++, addr += PGDIR_SIZE) {
> >   		if (!pgd_none(*pgd) && !pgd_is_leaf(*pgd))
> >   			/* pgd exists */
> > -			walk_pud(st, pgd, addr);
> > +			walk_p4d(st, pgd, addr);
> >   		else
> >   			note_page(st, addr, 1, pgd_val(*pgd));
> >   	}
> 
> Christophe

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2020-02-19 13:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16  8:18 [OpenRISC] [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 01/13] arm/arm64: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 02/13] h8300: remove usage of __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 03/13] hexagon: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 04/13] ia64: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 05/13] nios2: " Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 06/13] openrisc: " Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 07/13] powerpc: " Mike Rapoport
2020-02-16 10:41   ` Christophe Leroy
2020-02-18 10:54     ` Mike Rapoport
2020-02-26  9:13       ` Mike Rapoport
2020-02-26  9:46         ` Christophe Leroy
2020-02-26 10:56           ` Mike Rapoport
2020-02-26 11:20             ` Christophe Leroy
2020-02-19 12:07   ` Christophe Leroy
2020-02-19 13:24     ` Mike Rapoport [this message]
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 08/13] sh: fault: Modernize printing of kernel messages Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 09/13] sh: drop __pXd_offset() macros that duplicate pXd_index() ones Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 10/13] sh: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 11/13] unicore32: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 12/13] asm-generic: remove pgtable-nop4d-hack.h Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] [PATCH v2 13/13] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h Mike Rapoport
2020-02-16  8:22 ` [OpenRISC] [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK Russell King - ARM Linux admin
2020-02-16 10:45   ` Christophe Leroy
2020-02-17  6:23   ` Mike Rapoport

Reply instructions:

You may reply publicly 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=20200219132420.GA5559@hump \
    --to=rppt@kernel.org \
    --cc=openrisc@lists.librecores.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox