aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c6
-rw-r--r--arch/powerpc/kernel/process.c62
-rw-r--r--arch/powerpc/kernel/prom_init.c2
3 files changed, 28 insertions, 42 deletions
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index af4d1bc9a2eb..94db25708456 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -163,15 +163,13 @@ EXPORT_SYMBOL(giveup_altivec);
163EXPORT_SYMBOL(giveup_spe); 163EXPORT_SYMBOL(giveup_spe);
164#endif /* CONFIG_SPE */ 164#endif /* CONFIG_SPE */
165 165
166#ifdef CONFIG_PPC64 166#ifndef CONFIG_PPC64
167EXPORT_SYMBOL(__flush_icache_range);
168#else
169EXPORT_SYMBOL(flush_instruction_cache); 167EXPORT_SYMBOL(flush_instruction_cache);
170EXPORT_SYMBOL(flush_icache_range);
171EXPORT_SYMBOL(flush_tlb_kernel_range); 168EXPORT_SYMBOL(flush_tlb_kernel_range);
172EXPORT_SYMBOL(flush_tlb_page); 169EXPORT_SYMBOL(flush_tlb_page);
173EXPORT_SYMBOL(_tlbie); 170EXPORT_SYMBOL(_tlbie);
174#endif 171#endif
172EXPORT_SYMBOL(__flush_icache_range);
175EXPORT_SYMBOL(flush_dcache_range); 173EXPORT_SYMBOL(flush_dcache_range);
176 174
177#ifdef CONFIG_SMP 175#ifdef CONFIG_SMP
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a5a7542a8ff3..105d5609ff57 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -201,6 +201,28 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
201} 201}
202#endif /* CONFIG_SPE */ 202#endif /* CONFIG_SPE */
203 203
204/*
205 * If we are doing lazy switching of CPU state (FP, altivec or SPE),
206 * and the current task has some state, discard it.
207 */
208static inline void discard_lazy_cpu_state(void)
209{
210#ifndef CONFIG_SMP
211 preempt_disable();
212 if (last_task_used_math == current)
213 last_task_used_math = NULL;
214#ifdef CONFIG_ALTIVEC
215 if (last_task_used_altivec == current)
216 last_task_used_altivec = NULL;
217#endif /* CONFIG_ALTIVEC */
218#ifdef CONFIG_SPE
219 if (last_task_used_spe == current)
220 last_task_used_spe = NULL;
221#endif
222 preempt_enable();
223#endif /* CONFIG_SMP */
224}
225
204int set_dabr(unsigned long dabr) 226int set_dabr(unsigned long dabr)
205{ 227{
206 if (ppc_md.set_dabr) 228 if (ppc_md.set_dabr)
@@ -434,19 +456,7 @@ void show_regs(struct pt_regs * regs)
434void exit_thread(void) 456void exit_thread(void)
435{ 457{
436 kprobe_flush_task(current); 458 kprobe_flush_task(current);
437 459 discard_lazy_cpu_state();
438#ifndef CONFIG_SMP
439 if (last_task_used_math == current)
440 last_task_used_math = NULL;
441#ifdef CONFIG_ALTIVEC
442 if (last_task_used_altivec == current)
443 last_task_used_altivec = NULL;
444#endif /* CONFIG_ALTIVEC */
445#ifdef CONFIG_SPE
446 if (last_task_used_spe == current)
447 last_task_used_spe = NULL;
448#endif
449#endif /* CONFIG_SMP */
450} 460}
451 461
452void flush_thread(void) 462void flush_thread(void)
@@ -458,18 +468,7 @@ void flush_thread(void)
458 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 468 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
459#endif 469#endif
460 470
461#ifndef CONFIG_SMP 471 discard_lazy_cpu_state();
462 if (last_task_used_math == current)
463 last_task_used_math = NULL;
464#ifdef CONFIG_ALTIVEC
465 if (last_task_used_altivec == current)
466 last_task_used_altivec = NULL;
467#endif /* CONFIG_ALTIVEC */
468#ifdef CONFIG_SPE
469 if (last_task_used_spe == current)
470 last_task_used_spe = NULL;
471#endif
472#endif /* CONFIG_SMP */
473 472
474#ifdef CONFIG_PPC64 /* for now */ 473#ifdef CONFIG_PPC64 /* for now */
475 if (current->thread.dabr) { 474 if (current->thread.dabr) {
@@ -635,18 +634,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
635 } 634 }
636#endif 635#endif
637 636
638#ifndef CONFIG_SMP 637 discard_lazy_cpu_state();
639 if (last_task_used_math == current)
640 last_task_used_math = NULL;
641#ifdef CONFIG_ALTIVEC
642 if (last_task_used_altivec == current)
643 last_task_used_altivec = NULL;
644#endif
645#ifdef CONFIG_SPE
646 if (last_task_used_spe == current)
647 last_task_used_spe = NULL;
648#endif
649#endif /* CONFIG_SMP */
650 memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); 638 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
651 current->thread.fpscr.val = 0; 639 current->thread.fpscr.val = 0;
652#ifdef CONFIG_ALTIVEC 640#ifdef CONFIG_ALTIVEC
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 4ce0105c308e..bcdc209dca85 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -265,7 +265,7 @@ static int __init call_prom_ret(const char *service, int nargs, int nret,
265 va_end(list); 265 va_end(list);
266 266
267 for (i = 0; i < nret; i++) 267 for (i = 0; i < nret; i++)
268 rets[nargs+i] = 0; 268 args.args[nargs+i] = 0;
269 269
270 if (enter_prom(&args, RELOC(prom_entry)) < 0) 270 if (enter_prom(&args, RELOC(prom_entry)) < 0)
271 return PROM_ERROR; 271 return PROM_ERROR;