lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191024120208.GA17545@ls3530.fritz.box>
Date:   Thu, 24 Oct 2019 14:02:08 +0200
From:   Helge Deller <deller@....de>
To:     Mike Rapoport <rppt@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, linux-parisc@...r.kernel.org,
        James Bottomley <James.Bottomley@...senpartnership.com>,
        John David Anglin <dave.anglin@...l.net>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>,
        "David S. Miller" <davem@...emloft.net>,
        Mike Rapoport <rppt@...ux.ibm.com>
Subject: Re: [PATCH 08/12] parisc: use pgtable-nopXd instead of 4level-fixup

* Mike Rapoport <rppt@...nel.org>:
> From: Mike Rapoport <rppt@...ux.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@...ux.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?

Other than that (and the lexical corrections which other already mentioned):
Acked-by: Helge Deller <deller@....de>

Thanks!
Helge

----------------
parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup

Signed-off-by: Helge Deller <deller@....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;





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ