Re: [PATCH 09/19] powerpc: Move part of giveup_fpu,altivec,spe into c
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-12-01 11:18:03
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-12-01 11:18:03
On Thu, 2015-10-29 at 11:44 +1100, Anton Blanchard wrote:
Move the MSR modification into new c functions. Removing it from the low level functions will allow us to avoid costly MSR writes by batching them up. Move the check_if_tm_restore_required() check into these new functions.
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 5bf8ec2..6bcf82b 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c@@ -214,6 +244,20 @@ EXPORT_SYMBOL_GPL(flush_vsx_to_thread); #endif /* CONFIG_VSX */ #ifdef CONFIG_SPE +void giveup_spe(struct task_struct *tsk) +{ + u64 oldmsr = mfmsr(); + u64 newmsr; + + check_if_tm_restore_required(tsk);
We can't be building with SPE and also TM can we? I guess this is harmless as it will compile to nothing, but it might be confusing to readers.
+ newmsr = oldmsr | MSR_SPE;
+ if (oldmsr != newmsr)
+ mtmsr_isync(newmsr);
+
+ __giveup_spe(tsk);
+}
+EXPORT_SYMBOL(giveup_spe);
void enable_kernel_spe(void)
{cheers