···201}202#endif /* CONFIG_SPE */2030000000000000000000000204int set_dabr(unsigned long dabr)205{206 if (ppc_md.set_dabr)···456void exit_thread(void)457{458 kprobe_flush_task(current);459-460-#ifndef CONFIG_SMP461- if (last_task_used_math == current)462- last_task_used_math = NULL;463-#ifdef CONFIG_ALTIVEC464- if (last_task_used_altivec == current)465- last_task_used_altivec = NULL;466-#endif /* CONFIG_ALTIVEC */467-#ifdef CONFIG_SPE468- if (last_task_used_spe == current)469- last_task_used_spe = NULL;470-#endif471-#endif /* CONFIG_SMP */472}473474void flush_thread(void)···468 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);469#endif470471-#ifndef CONFIG_SMP472- if (last_task_used_math == current)473- last_task_used_math = NULL;474-#ifdef CONFIG_ALTIVEC475- if (last_task_used_altivec == current)476- last_task_used_altivec = NULL;477-#endif /* CONFIG_ALTIVEC */478-#ifdef CONFIG_SPE479- if (last_task_used_spe == current)480- last_task_used_spe = NULL;481-#endif482-#endif /* CONFIG_SMP */483484#ifdef CONFIG_PPC64 /* for now */485 if (current->thread.dabr) {···634 }635#endif636637-#ifndef CONFIG_SMP638- if (last_task_used_math == current)639- last_task_used_math = NULL;640-#ifdef CONFIG_ALTIVEC641- if (last_task_used_altivec == current)642- last_task_used_altivec = NULL;643-#endif644-#ifdef CONFIG_SPE645- if (last_task_used_spe == current)646- last_task_used_spe = NULL;647-#endif648-#endif /* CONFIG_SMP */649 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));650 current->thread.fpscr.val = 0;651#ifdef CONFIG_ALTIVEC
···201}202#endif /* CONFIG_SPE */203204+/*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+ */208+static inline void discard_lazy_cpu_state(void)209+{210+#ifndef CONFIG_SMP211+ preempt_disable();212+ if (last_task_used_math == current)213+ last_task_used_math = NULL;214+#ifdef CONFIG_ALTIVEC215+ if (last_task_used_altivec == current)216+ last_task_used_altivec = NULL;217+#endif /* CONFIG_ALTIVEC */218+#ifdef CONFIG_SPE219+ if (last_task_used_spe == current)220+ last_task_used_spe = NULL;221+#endif222+ preempt_enable();223+#endif /* CONFIG_SMP */224+}225+226int set_dabr(unsigned long dabr)227{228 if (ppc_md.set_dabr)···434void exit_thread(void)435{436 kprobe_flush_task(current);437+ discard_lazy_cpu_state();000000000000438}439440void flush_thread(void)···458 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);459#endif460461+ discard_lazy_cpu_state();00000000000462463#ifdef CONFIG_PPC64 /* for now */464 if (current->thread.dabr) {···635 }636#endif637638+ discard_lazy_cpu_state();00000000000639 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));640 current->thread.fpscr.val = 0;641#ifdef CONFIG_ALTIVEC
+1-1
arch/powerpc/kernel/prom_init.c
···265 va_end(list);266267 for (i = 0; i < nret; i++)268- rets[nargs+i] = 0;269270 if (enter_prom(&args, RELOC(prom_entry)) < 0)271 return PROM_ERROR;
···265 va_end(list);266267 for (i = 0; i < nret; i++)268+ args.args[nargs+i] = 0;269270 if (enter_prom(&args, RELOC(prom_entry)) < 0)271 return PROM_ERROR;