Skip to contentSkip to conversation

powerpc/mm: Call mmu_context_init() from ppc64

PATCH In review Benjamin Herrenschmidt 3 participants 4 messages Jul 23, 2009 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 9/20 powerpc/mm: Call mmu_context_init() from ppc64

Our 64-bit hash context handling has no init function, but 64-bit Book3E will use the common mmu_context_nohash.c code which does, so define an empty inline mmu_context_init() for 64-bit server and call it from our 64-bit setup_arch()

---

 arch/powerpc/include/asm/mmu_context.h |    7 ++++++-
 arch/powerpc/kernel/setup_64.c         |    4 ++++
 arch/powerpc/mm/mmu_context_hash64.c   |    1 +
 3 files changed, 11 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/mmu_context.h +6 -1
@@ -14,7 +14,6 @@
 /*
  * Most if the context management is out of line
  */
-extern void mmu_context_init(void);
 extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
 extern void destroy_context(struct mm_struct *mm);
 
@@ -23,6 +22,12 @@ extern void switch_stab(struct task_stru
 extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm);
 extern void set_context(unsigned long id, pgd_t *pgd);
 
+#ifdef CONFIG_PPC_BOOK3S_64
+static inline void mmu_context_init(void) { }
+#else
+extern void mmu_context_init(void);
+#endif
+
 /*
  * switch_mm is the entry point called from the architecture independent
  * code in kernel/sched.c
arch/powerpc/kernel/setup_64.c +4 -0
Index: linux-work/arch/powerpc/kernel/setup_64.c
===================================================================
@@ -534,6 +534,10 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
 	paging_init();
+
+	/* Initialize the MMU context management stuff */
+	mmu_context_init();
+
 	ppc64_boot_msg(0x15, "Setup Done");
 }
 
arch/powerpc/mm/mmu_context_hash64.c +1 -0
Index: linux-work/arch/powerpc/mm/mmu_context_hash64.c
===================================================================
@@ -76,3 +76,4 @@ void destroy_context(struct mm_struct *m
 
 	mm->context.id = NO_CONTEXT;
 }
+
#1 lore raw

Hi Ben,

arch/powerpc/mm/mmu_context_hash64.c void destroy_context(struct mm_struct *m · line 79

Quoted 10 lines · On Thu, 23 Jul 2009 15:59:44 +1000 Benjamin Herrenschmidt…

Index: linux-work/arch/powerpc/mm/mmu_context_hash64.c
===================================================================

arch/powerpc/mm/mmu_context_hash64.c +1 -0
@@ -76,3 +76,4 @@ void destroy_context(struct mm_struct *m
 
 	mm->context.id = NO_CONTEXT;
 }
+

Really? :-(

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#2 lore raw
Quoted 10 lines · Stephen Rothwell

Hi Ben,

Quoted 7 lines · On Thu, 23 Jul 2009 15:59:44 +1000 Benjamin Herrenschmidt…

Index: linux-work/arch/powerpc/mm/mmu_context_hash64.c
===================================================================

arch/powerpc/mm/mmu_context_hash64.c +0 -0
@@ -76,3 +76,4 @@ void destroy_context(struct mm_struct *m
 
Quoted 5 lines

arch/powerpc/mm/mmu_context_hash64.c void destroy_context(struct mm_struct *m · line 79

Quoted 3 lines
arch/powerpc/mm/mmu_context_hash64.c +1 -0
 	mm->context.id = NO_CONTEXT;
 }
+

Really? :-(

Little mechanical problem, I used to have something in there in a previous rev of the patch, I'll re-spin that one without that bit.

Cheers,
Ben.

Acked-by on v1 9/20
#3 lore raw
In reply to Benjamin Herrenschmidt
Quoted 5 lines · Benjamin Herrenschmidt

Our 64-bit hash context handling has no init function, but 64-bit Book3E will use the common mmu_context_nohash.c code which does, so define an empty inline mmu_context_init() for 64-bit server and call it from our 64-bit setup_arch()

Quoted 7 lines

---

arch/powerpc/include/asm/mmu_context.h |    7 ++++++-
arch/powerpc/kernel/setup_64.c         |    4 ++++
arch/powerpc/mm/mmu_context_hash64.c   |    1 +
3 files changed, 11 insertions(+), 1 deletion(-)

(w/the assumption the respin will just change the whitespace issue).

- k