Skip to content

Commit

Permalink
powerpc/mm: define an empty slice_init_new_context_exec()
Browse files Browse the repository at this point in the history
Define slice_init_new_context_exec() at all time to avoid

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Dec 19, 2018
1 parent 05a4ab8 commit badb968
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 9 additions & 5 deletions arch/powerpc/include/asm/slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include <asm/nohash/32/slice.h>
#endif

#ifndef __ASSEMBLY__

struct mm_struct;

#ifdef CONFIG_PPC_MM_SLICES

#ifdef CONFIG_HUGETLB_PAGE
Expand All @@ -18,10 +22,6 @@
#define HAVE_ARCH_UNMAPPED_AREA
#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN

#ifndef __ASSEMBLY__

struct mm_struct;

unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
unsigned long flags, unsigned int psize,
int topdown);
Expand All @@ -34,8 +34,12 @@ void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
void slice_init_new_context_exec(struct mm_struct *mm);
void slice_setup_new_exec(void);

#endif /* __ASSEMBLY__ */
#else /* CONFIG_PPC_MM_SLICES */

static inline void slice_init_new_context_exec(struct mm_struct *mm) {}

#endif /* CONFIG_PPC_MM_SLICES */

#endif /* __ASSEMBLY__ */

#endif /* _ASM_POWERPC_SLICE_H */
2 changes: 0 additions & 2 deletions arch/powerpc/mm/mmu_context_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
{
pr_hard("initing context for mm @%p\n", mm);

#ifdef CONFIG_PPC_MM_SLICES
/*
* We have MMU_NO_CONTEXT set to be ~0. Hence check
* explicitly against context.id == 0. This ensures that we properly
Expand All @@ -382,7 +381,6 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
*/
if (mm->context.id == 0)
slice_init_new_context_exec(mm);
#endif
mm->context.id = MMU_NO_CONTEXT;
mm->context.active = 0;
pte_frag_set(&mm->context, NULL);
Expand Down

0 comments on commit badb968

Please sign in to comment.