Skip to content

Commit

Permalink
powerpc/ptdump: don't entirely rebuild kernel when selecting CONFIG_P…
Browse files Browse the repository at this point in the history
…PC_DEBUG_WX

Selecting CONFIG_PPC_DEBUG_WX only impacts ptdump and pgtable_32/64
init calls. Declaring related functions in asm/pgtable.h implies
rebuilding almost everything.

Move ptdump_check_wx() declaration in mm/mmu_decl.h

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/bf34fd9dca61eadf9a134a9f89ebbc162cfd5f86.1578986011.git.christophe.leroy@c-s.fr
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Jan 23, 2020
1 parent ed0bc98 commit 1e1c8b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions arch/powerpc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ void mark_initmem_nx(void);
static inline void mark_initmem_nx(void) { }
#endif

#ifdef CONFIG_PPC_DEBUG_WX
void ptdump_check_wx(void);
#else
static inline void ptdump_check_wx(void) { }
#endif

/*
* When used, PTE_FRAG_NR is defined in subarch pgtable.h
* so we are sure it is included when arriving here.
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/mm/mmu_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,9 @@ void mmu_mark_rodata_ro(void);
static inline void mmu_mark_initmem_nx(void) { }
static inline void mmu_mark_rodata_ro(void) { }
#endif

#ifdef CONFIG_PPC_DEBUG_WX
void ptdump_check_wx(void);
#else
static inline void ptdump_check_wx(void) { }
#endif
2 changes: 2 additions & 0 deletions arch/powerpc/mm/ptdump/ptdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <asm/page.h>
#include <asm/pgalloc.h>

#include <mm/mmu_decl.h>

#include "ptdump.h"

/*
Expand Down

0 comments on commit 1e1c8b2

Please sign in to comment.