From: Mike Rapoport <rppt@kernel.org>
To: Helge Deller <deller@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
James Bottomley <James.Bottomley@hansenpartnership.com>,
John David Anglin <dave.anglin@bell.net>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>,
"David S. Miller" <davem@davemloft.net>,
Mike Rapoport <rppt@linux.ibm.com>
Subject: Re: [PATCH 08/12] parisc: use pgtable-nopXd instead of 4level-fixup
Date: Thu, 24 Oct 2019 19:00:06 +0300 [thread overview]
Message-ID: <20191024160005.GD12281@rapoport-lnx> (raw)
In-Reply-To: <20191024120208.GA17545@ls3530.fritz.box>
On Thu, Oct 24, 2019 at 02:02:08PM +0200, Helge Deller wrote:
> * Mike Rapoport <rppt@kernel.org>:
> > From: Mike Rapoport <rppt@linux.ibm.com>
> >
> > parisc has two or three levels of page tables and can use appropriate
> > pgtable-nopXd and folding of the upper layers.
> >
> > Replace usage of include/asm-generic/4level-fixup.h and explicit
> > definitions of __PAGETABLE_PxD_FOLDED in parisc with
> > include/asm-generic/pgtable-nopmd.h for two-level configurations and with
> > include/asm-generic/pgtable-nopmd.h for three-lelve configurations and
> > adjust page table manipulation macros and functions accordingly.
> >
> > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> > ---
> > arch/parisc/include/asm/page.h | 30 +++++++++++++---------
> > arch/parisc/include/asm/pgalloc.h | 41 +++++++++++-------------------
> > arch/parisc/include/asm/pgtable.h | 52 +++++++++++++++++++--------------------
> > arch/parisc/include/asm/tlb.h | 2 ++
> > arch/parisc/kernel/cache.c | 13 ++++++----
> > arch/parisc/kernel/pci-dma.c | 9 +++++--
> > arch/parisc/mm/fixmap.c | 10 +++++---
> > 7 files changed, 81 insertions(+), 76 deletions(-)
>
> Mike, thanks for this clean-up!
>
> Your patch is functional OK. I successfully tested it with a 32-bit
> kernel in qemu, and with a 64-bit kernel on a physical box.
> For 64-bit you missed to adapt the parisc hugetlb code, so maybe you
> can add the patch below to your series?
Sure.
> Other than that (and the lexical corrections which other already mentioned):
> Acked-by: Helge Deller <deller@gmx.de>
Thanks!
> Thanks!
> Helge
>
> ----------------
> parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup
>
> Signed-off-by: Helge Deller <deller@gmx.de>
>
> diff --git a/arch/parisc/mm/hugetlbpage.c b/arch/parisc/mm/hugetlbpage.c
> index d578809e55cf..0e1e212f1c96 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;
>
>
>
>
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2019-10-24 16:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 9:28 [PATCH 00/12] mm: remove __ARCH_HAS_4LEVEL_HACK Mike Rapoport
2019-10-23 9:28 ` [PATCH 01/12] alpha: use pgtable-nop4d instead of 4level-fixup Mike Rapoport
2019-10-23 9:28 ` [PATCH 02/12] arm: nommu: use pgtable-nopud " Mike Rapoport
2019-10-23 9:40 ` Russell King - ARM Linux admin
2019-10-23 9:28 ` [PATCH 03/12] c6x: " Mike Rapoport
2019-10-23 9:28 ` [PATCH 04/12] m68k: nommu: " Mike Rapoport
2019-10-24 4:09 ` Greg Ungerer
2019-10-24 5:35 ` Mike Rapoport
2019-10-24 6:23 ` Greg Ungerer
2019-10-23 9:28 ` [PATCH 05/12] m68k: mm: use pgtable-nopXd " Mike Rapoport
2019-10-24 4:12 ` Greg Ungerer
2019-10-25 5:52 ` kbuild test robot
2019-10-23 9:28 ` [PATCH 06/12] microblaze: use pgtable-nopmd " Mike Rapoport
2019-10-25 2:17 ` kbuild test robot
2019-10-25 8:24 ` Michal Simek
2019-10-25 20:33 ` Mike Rapoport
2019-10-23 9:28 ` [PATCH 07/12] nds32: " Mike Rapoport
2019-10-23 9:28 ` [PATCH 08/12] parisc: use pgtable-nopXd " Mike Rapoport
2019-10-23 10:20 ` Rolf Eike Beer
2019-10-24 8:51 ` Mike Rapoport
2019-10-24 9:35 ` Peter Rosin
2019-10-24 9:50 ` Mike Rapoport
2019-10-24 12:02 ` Helge Deller
2019-10-24 16:00 ` Mike Rapoport [this message]
2019-10-23 9:28 ` [PATCH 09/12] sparc32: use pgtable-nopud " Mike Rapoport
2019-10-23 19:59 ` [PATCH v2 " Mike Rapoport
2019-10-23 21:21 ` David Miller
2019-10-23 9:28 ` [PATCH 10/12] um: remove unused pxx_offset_proc() and addr_pte() functions Mike Rapoport
2019-10-23 9:29 ` [PATCH 11/12] um: add support for folded p4d page tables Mike Rapoport
2019-10-23 9:29 ` [PATCH 12/12] mm: remove __ARCH_HAS_4LEVEL_HACK and include/asm-generic/4level-fixup.h Mike Rapoport
2019-10-23 10:25 ` [PATCH 00/12] mm: remove __ARCH_HAS_4LEVEL_HACK Linus Torvalds
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=20191024160005.GD12281@rapoport-lnx \
--to=rppt@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dave.anglin@bell.net \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=rppt@linux.ibm.com \
--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
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