]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc: Fix MSR setting in 32 bit signal code
authorMichael Neuling <mikey@neuling.org>
Wed, 25 Jun 2008 04:07:17 +0000 (14:07 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 1 Jul 2008 01:28:42 +0000 (11:28 +1000)
If we set the SPE MSR bit in save_user_regs we can blow away the VEC
bit.  This doesn't matter in reality as they are in fact the same bit
but looks bad.

Also, when we add VSX in a later patch, we need to be able to set two
separate MSR bits here.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/signal_32.c

index 4ae16d179803ef6071cd07909b86dd91ad032b62..b057e6852a7d0a5fd611e76ba66252195b6fffb8 100644 (file)
@@ -336,6 +336,8 @@ struct rt_sigframe {
 static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
                int sigret)
 {
+       unsigned long msr = regs->msr;
+
        /* Make sure floating point registers are stored in regs */
        flush_fp_to_thread(current);
 
@@ -354,8 +356,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
                        return 1;
                /* set MSR_VEC in the saved MSR value to indicate that
                   frame->mc_vregs contains valid data */
-               if (__put_user(regs->msr | MSR_VEC, &frame->mc_gregs[PT_MSR]))
-                       return 1;
+               msr |= MSR_VEC;
        }
        /* else assert((regs->msr & MSR_VEC) == 0) */
 
@@ -377,8 +378,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
                        return 1;
                /* set MSR_SPE in the saved MSR value to indicate that
                   frame->mc_vregs contains valid data */
-               if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR]))
-                       return 1;
+               msr |= MSR_SPE;
        }
        /* else assert((regs->msr & MSR_SPE) == 0) */
 
@@ -387,6 +387,8 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
                return 1;
 #endif /* CONFIG_SPE */
 
+       if (__put_user(msr, &frame->mc_gregs[PT_MSR]))
+               return 1;
        if (sigret) {
                /* Set up the sigreturn trampoline: li r0,sigret; sc */
                if (__put_user(0x38000000UL + sigret, &frame->tramp[0])