Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
powerpc/603: Copy kernel PGD entries into all PGDIRs and preallocate …
Browse files Browse the repository at this point in the history
…execmem page tables

For the same reason as 8xx, copy kernel PGD entries into all
PGDIRs in pgd_alloc() and preallocate execmem page tables before
creating new PGDs so that all PGD entries related to execmem are
copied by pgd_alloc().

This will help reduce the fast-path in TLBmiss handlers.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/1a0d1feee07c4cf955f6a43a704c203e5c90fa53.1724173828.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Aug 30, 2024
1 parent 2f2b9a3 commit 82ef440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/nohash/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
pgtable_gfp_flags(mm, GFP_KERNEL));

#ifdef CONFIG_PPC_8xx
#if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603)
memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD,
(MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ EXPORT_SYMBOL_GPL(walk_system_ram_range);
#ifdef CONFIG_EXECMEM
static struct execmem_info execmem_info __ro_after_init;

#ifdef CONFIG_PPC_8xx
#if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603)
static void prealloc_execmem_pgtable(void)
{
unsigned long va;
Expand Down

0 comments on commit 82ef440

Please sign in to comment.