Skip to contentSkip to conversation

powerpc-e500-switch-to-64-bits-pgd-on-85xx-32-bits.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: powerpc/e500: switch to 64 bits PGD on 85xx (32 bits)
has been removed from the -mm tree. Its filename was

     powerpc-e500-switch-to-64-bits-pgd-on-85xx-32-bits.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Christophe Leroy <[email protected]>
Subject: powerpc/e500: switch to 64 bits PGD on 85xx (32 bits)
Date: Tue, 2 Jul 2024 15:51:28 +0200

At the time being when CONFIG_PTE_64BIT is selected, PTE entries are 64 bits but PGD entries are still 32 bits.

In order to allow leaf PMD entries, switch the PGD to 64 bits entries.

---

 arch/powerpc/include/asm/pgtable-types.h |    4 ++++
 arch/powerpc/kernel/head_85xx.S          |   10 ++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/pgtable-types.h renamed from arch/powerpc/include/asm/pgtable-types.h~powerpc-e500-switch-to-64-bits-pgd-on-85xx-32-bits +4 -0
@@ -49,7 +49,11 @@ static inline unsigned long pud_val(pud_
 #endif /* CONFIG_PPC64 */
 
 /* PGD level */
+#if defined(CONFIG_PPC_E500) && defined(CONFIG_PTE_64BIT)
+typedef struct { unsigned long long pgd; } pgd_t;
+#else
 typedef struct { unsigned long pgd; } pgd_t;
+#endif
 #define __pgd(x)	((pgd_t) { (x) })
 static inline unsigned long pgd_val(pgd_t x)
 {
arch/powerpc/kernel/head_85xx.S renamed from arch/powerpc/kernel/head_85xx.S~powerpc-e500-switch-to-64-bits-pgd-on-85xx-32-bits +6 -4
@@ -307,8 +307,9 @@ set_ivor:
 #ifdef CONFIG_PTE_64BIT
 #ifdef CONFIG_HUGETLB_PAGE
 #define FIND_PTE	\
-	rlwinm	r12, r10, 13, 19, 29;	/* Compute pgdir/pmd offset */	\
-	lwzx	r11, r12, r11;		/* Get pgd/pmd entry */		\
+	rlwinm	r12, r10, 14, 18, 28;	/* Compute pgdir/pmd offset */	\
+	add	r12, r11, r12;						\
+	lwz	r11, 4(r12);		/* Get pgd/pmd entry */		\
 	rlwinm.	r12, r11, 0, 0, 20;	/* Extract pt base address */	\
 	blt	1000f;			/* Normal non-huge page */	\
 	beq	2f;			/* Bail if no table */		\
@@ -321,8 +322,9 @@ set_ivor:
 1001:	lwz	r11, 4(r12);		/* Get pte entry */
 #else
 #define FIND_PTE	\
-	rlwinm	r12, r10, 13, 19, 29;	/* Compute pgdir/pmd offset */	\
-	lwzx	r11, r12, r11;		/* Get pgd/pmd entry */		\
+	rlwinm	r12, r10, 14, 18, 28;	/* Compute pgdir/pmd offset */	\
+	add	r12, r11, r12;						\
+	lwz	r11, 4(r12);		/* Get pgd/pmd entry */		\
 	rlwinm.	r12, r11, 0, 0, 20;	/* Extract pt base address */	\
 	beq	2f;			/* Bail if no table */		\
 	rlwimi	r12, r10, 23, 20, 28;	/* Compute pte address */	\

_

Patches currently in -mm which might be from [email protected] are