diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/paca.h | 11 | ||||
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 5 | ||||
-rw-r--r-- | arch/powerpc/mm/slb.c | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/slice.c | 3 |
5 files changed, 18 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index 70bd4381f8e6..1cc6e0828907 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -131,7 +131,9 @@ struct paca_struct { | |||
131 | struct tlb_core_data tcd; | 131 | struct tlb_core_data tcd; |
132 | #endif /* CONFIG_PPC_BOOK3E */ | 132 | #endif /* CONFIG_PPC_BOOK3E */ |
133 | 133 | ||
134 | #ifdef CONFIG_PPC_BOOK3S | ||
134 | mm_context_t context; | 135 | mm_context_t context; |
136 | #endif | ||
135 | 137 | ||
136 | /* | 138 | /* |
137 | * then miscellaneous read-write fields | 139 | * then miscellaneous read-write fields |
@@ -194,6 +196,15 @@ struct paca_struct { | |||
194 | #endif | 196 | #endif |
195 | }; | 197 | }; |
196 | 198 | ||
199 | #ifdef CONFIG_PPC_BOOK3S | ||
200 | static inline void copy_mm_to_paca(mm_context_t *context) | ||
201 | { | ||
202 | get_paca()->context = *context; | ||
203 | } | ||
204 | #else | ||
205 | static inline void copy_mm_to_paca(mm_context_t *context){} | ||
206 | #endif | ||
207 | |||
197 | extern struct paca_struct *paca; | 208 | extern struct paca_struct *paca; |
198 | extern void initialise_paca(struct paca_struct *new_paca, int cpu); | 209 | extern void initialise_paca(struct paca_struct *new_paca, int cpu); |
199 | extern void setup_paca(struct paca_struct *new_paca); | 210 | extern void setup_paca(struct paca_struct *new_paca); |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 221d584d089f..9db7be292bf3 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -185,6 +185,7 @@ int main(void) | |||
185 | DEFINE(PACAKMSR, offsetof(struct paca_struct, kernel_msr)); | 185 | DEFINE(PACAKMSR, offsetof(struct paca_struct, kernel_msr)); |
186 | DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled)); | 186 | DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled)); |
187 | DEFINE(PACAIRQHAPPENED, offsetof(struct paca_struct, irq_happened)); | 187 | DEFINE(PACAIRQHAPPENED, offsetof(struct paca_struct, irq_happened)); |
188 | #ifdef CONFIG_PPC_BOOK3S | ||
188 | DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); | 189 | DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); |
189 | #ifdef CONFIG_PPC_MM_SLICES | 190 | #ifdef CONFIG_PPC_MM_SLICES |
190 | DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct, | 191 | DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct, |
@@ -193,6 +194,7 @@ int main(void) | |||
193 | context.high_slices_psize)); | 194 | context.high_slices_psize)); |
194 | DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); | 195 | DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); |
195 | #endif /* CONFIG_PPC_MM_SLICES */ | 196 | #endif /* CONFIG_PPC_MM_SLICES */ |
197 | #endif | ||
196 | 198 | ||
197 | #ifdef CONFIG_PPC_BOOK3E | 199 | #ifdef CONFIG_PPC_BOOK3E |
198 | DEFINE(PACAPGD, offsetof(struct paca_struct, pgd)); | 200 | DEFINE(PACAPGD, offsetof(struct paca_struct, pgd)); |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 4233dcccbaf7..03279eac0957 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -882,7 +882,8 @@ void demote_segment_4k(struct mm_struct *mm, unsigned long addr) | |||
882 | slice_set_range_psize(mm, addr, 1, MMU_PAGE_4K); | 882 | slice_set_range_psize(mm, addr, 1, MMU_PAGE_4K); |
883 | copro_flush_all_slbs(mm); | 883 | copro_flush_all_slbs(mm); |
884 | if ((get_paca_psize(addr) != MMU_PAGE_4K) && (current->mm == mm)) { | 884 | if ((get_paca_psize(addr) != MMU_PAGE_4K) && (current->mm == mm)) { |
885 | get_paca()->context = mm->context; | 885 | |
886 | copy_mm_to_paca(&mm->context); | ||
886 | slb_flush_and_rebolt(); | 887 | slb_flush_and_rebolt(); |
887 | } | 888 | } |
888 | } | 889 | } |
@@ -949,7 +950,7 @@ static void check_paca_psize(unsigned long ea, struct mm_struct *mm, | |||
949 | { | 950 | { |
950 | if (user_region) { | 951 | if (user_region) { |
951 | if (psize != get_paca_psize(ea)) { | 952 | if (psize != get_paca_psize(ea)) { |
952 | get_paca()->context = mm->context; | 953 | copy_mm_to_paca(&mm->context); |
953 | slb_flush_and_rebolt(); | 954 | slb_flush_and_rebolt(); |
954 | } | 955 | } |
955 | } else if (get_paca()->vmalloc_sllp != | 956 | } else if (get_paca()->vmalloc_sllp != |
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c index 515730e499fe..825b6873391f 100644 --- a/arch/powerpc/mm/slb.c +++ b/arch/powerpc/mm/slb.c | |||
@@ -228,7 +228,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm) | |||
228 | asm volatile("slbie %0" : : "r" (slbie_data)); | 228 | asm volatile("slbie %0" : : "r" (slbie_data)); |
229 | 229 | ||
230 | get_paca()->slb_cache_ptr = 0; | 230 | get_paca()->slb_cache_ptr = 0; |
231 | get_paca()->context = mm->context; | 231 | copy_mm_to_paca(&mm->context); |
232 | 232 | ||
233 | /* | 233 | /* |
234 | * preload some userspace segments into the SLB. | 234 | * preload some userspace segments into the SLB. |
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 0f432a702870..42954f0b47ac 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c | |||
@@ -185,8 +185,7 @@ static void slice_flush_segments(void *parm) | |||
185 | if (mm != current->active_mm) | 185 | if (mm != current->active_mm) |
186 | return; | 186 | return; |
187 | 187 | ||
188 | /* update the paca copy of the context struct */ | 188 | copy_mm_to_paca(¤t->active_mm->context); |
189 | get_paca()->context = current->active_mm->context; | ||
190 | 189 | ||
191 | local_irq_save(flags); | 190 | local_irq_save(flags); |
192 | slb_flush_and_rebolt(); | 191 | slb_flush_and_rebolt(); |