Skip to content

Commit

Permalink
powerpc/mm: Rework context management for CPUs with no hash table
Browse files Browse the repository at this point in the history
This reworks the context management code used by 4xx,8xx and
freescale BookE.  It adds support for SMP by implementing a
concept of stale context map to lazily flush the TLB on
processors where a context may have been invalidated.  This
also contains the ground work for generalizing such lazy TLB
flushing by just picking up a new PID and marking the old one
stale.  This will be implemented later.

This is a first implementation that uses a global spinlock.

Ideally, we should try to get at least the fast path (context ID
already assigned) lockless or limited to a per context lock,
but for now this will do.

I tried to keep the UP case reasonably simple to avoid adding
too much overhead to 8xx which does a lot of context stealing
since it effectively has only 16 PIDs available.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Dec 21, 2008
1 parent 5e69661 commit 2ca8cf7
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 54 deletions.
5 changes: 3 additions & 2 deletions arch/powerpc/include/asm/mmu-40x.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
#ifndef __ASSEMBLY__

typedef struct {
unsigned long id;
unsigned long vdso_base;
unsigned int id;
unsigned int active;
unsigned long vdso_base;
} mm_context_t;

#endif /* !__ASSEMBLY__ */
Expand Down
5 changes: 3 additions & 2 deletions arch/powerpc/include/asm/mmu-44x.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@
extern unsigned int tlb_44x_hwater;

typedef struct {
unsigned long id;
unsigned long vdso_base;
unsigned int id;
unsigned int active;
unsigned long vdso_base;
} mm_context_t;

#endif /* !__ASSEMBLY__ */
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/include/asm/mmu-8xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@

#ifndef __ASSEMBLY__
typedef struct {
unsigned long id;
unsigned int id;
unsigned int active;
unsigned long vdso_base;
} mm_context_t;
#endif /* !__ASSEMBLY__ */
Expand Down
5 changes: 3 additions & 2 deletions arch/powerpc/include/asm/mmu-fsl-booke.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@
#ifndef __ASSEMBLY__

typedef struct {
unsigned long id;
unsigned long vdso_base;
unsigned int id;
unsigned int active;
unsigned long vdso_base;
} mm_context_t;
#endif /* !__ASSEMBLY__ */

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <linux/mm.h>

#define MMU_NO_CONTEXT ((unsigned int)-1)

extern void _tlbie(unsigned long address, unsigned int pid);
extern void _tlbil_all(void);
extern void _tlbil_pid(unsigned int pid);
Expand Down
Loading

0 comments on commit 2ca8cf7

Please sign in to comment.