Skip to content

Commit f286337

Browse files
chleroymaddy-kerneldev
authored andcommitted
powerpc/603: Really copy kernel PGD entries into all PGDIRs
Commit 82ef440 ("powerpc/603: Copy kernel PGD entries into all PGDIRs and preallocate execmem page tables") was supposed to extend to powerpc 603 the copy of kernel PGD entries into all PGDIRs implemented in a previous patch on the 8xx. But 603 is book3s/32 and uses a duplicate of pgd_alloc() defined in another header. So really do the copy at the correct place for the 603. Fixes: 82ef440 ("powerpc/603: Copy kernel PGD entries into all PGDIRs and preallocate execmem page tables") Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/752ab7514cae089a2dd7cc0f3d5e35849f76adb9.1755757797.git.christophe.leroy@csgroup.eu
1 parent d9e46de commit f286337

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

arch/powerpc/include/asm/book3s/32/pgalloc.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77

88
static inline pgd_t *pgd_alloc(struct mm_struct *mm)
99
{
10-
return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
11-
pgtable_gfp_flags(mm, GFP_KERNEL));
10+
pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
11+
pgtable_gfp_flags(mm, GFP_KERNEL));
12+
13+
#ifdef CONFIG_PPC_BOOK3S_603
14+
memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD,
15+
(MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
16+
#endif
17+
return pgd;
1218
}
1319

1420
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)

arch/powerpc/include/asm/nohash/pgalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
2222
pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
2323
pgtable_gfp_flags(mm, GFP_KERNEL));
2424

25-
#if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603)
25+
#ifdef CONFIG_PPC_8xx
2626
memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD,
2727
(MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
2828
#endif

0 commit comments

Comments
 (0)