提交 8eb98037 编写于 作者: A Anton Blanchard 提交者: Michael Ellerman

powerpc: Avoid load hit store in __giveup_fpu() and __giveup_altivec()

In both __giveup_fpu() and __giveup_altivec() we make two modifications
to tsk->thread.regs->msr. gcc decides to do a read/modify/write of
each change, so we end up with a load hit store:

        ld      r9,264(r10)
        rldicl  r9,r9,50,1
        rotldi  r9,r9,14
        std     r9,264(r10)
...
        ld      r9,264(r10)
        rldicl  r9,r9,40,1
        rotldi  r9,r9,24
        std     r9,264(r10)

Fix this by using a temporary.
Signed-off-by: NAnton Blanchard <anton@samba.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 5edb5649
......@@ -139,12 +139,16 @@ EXPORT_SYMBOL(__msr_check_and_clear);
#ifdef CONFIG_PPC_FPU
void __giveup_fpu(struct task_struct *tsk)
{
unsigned long msr;
save_fpu(tsk);
tsk->thread.regs->msr &= ~MSR_FP;
msr = tsk->thread.regs->msr;
msr &= ~MSR_FP;
#ifdef CONFIG_VSX
if (cpu_has_feature(CPU_FTR_VSX))
tsk->thread.regs->msr &= ~MSR_VSX;
msr &= ~MSR_VSX;
#endif
tsk->thread.regs->msr = msr;
}
void giveup_fpu(struct task_struct *tsk)
......@@ -219,12 +223,16 @@ static int restore_fp(struct task_struct *tsk) { return 0; }
static void __giveup_altivec(struct task_struct *tsk)
{
unsigned long msr;
save_altivec(tsk);
tsk->thread.regs->msr &= ~MSR_VEC;
msr = tsk->thread.regs->msr;
msr &= ~MSR_VEC;
#ifdef CONFIG_VSX
if (cpu_has_feature(CPU_FTR_VSX))
tsk->thread.regs->msr &= ~MSR_VSX;
msr &= ~MSR_VSX;
#endif
tsk->thread.regs->msr = msr;
}
void giveup_altivec(struct task_struct *tsk)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册