Commit 9e751186 authored by Michael Neuling's avatar Michael Neuling Committed by Paul Mackerras

powerpc: Fix MSR setting in 32 bit signal code

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: default avatarMichael Neuling <mikey@neuling.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 9b09c6d9
...@@ -336,6 +336,8 @@ struct rt_sigframe { ...@@ -336,6 +336,8 @@ struct rt_sigframe {
static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
int sigret) int sigret)
{ {
unsigned long msr = regs->msr;
/* Make sure floating point registers are stored in regs */ /* Make sure floating point registers are stored in regs */
flush_fp_to_thread(current); flush_fp_to_thread(current);
...@@ -354,8 +356,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, ...@@ -354,8 +356,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
return 1; return 1;
/* set MSR_VEC in the saved MSR value to indicate that /* set MSR_VEC in the saved MSR value to indicate that
frame->mc_vregs contains valid data */ frame->mc_vregs contains valid data */
if (__put_user(regs->msr | MSR_VEC, &frame->mc_gregs[PT_MSR])) msr |= MSR_VEC;
return 1;
} }
/* else assert((regs->msr & MSR_VEC) == 0) */ /* else assert((regs->msr & MSR_VEC) == 0) */
...@@ -377,8 +378,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, ...@@ -377,8 +378,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
return 1; return 1;
/* set MSR_SPE in the saved MSR value to indicate that /* set MSR_SPE in the saved MSR value to indicate that
frame->mc_vregs contains valid data */ frame->mc_vregs contains valid data */
if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR])) msr |= MSR_SPE;
return 1;
} }
/* else assert((regs->msr & MSR_SPE) == 0) */ /* else assert((regs->msr & MSR_SPE) == 0) */
...@@ -387,6 +387,8 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, ...@@ -387,6 +387,8 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
return 1; return 1;
#endif /* CONFIG_SPE */ #endif /* CONFIG_SPE */
if (__put_user(msr, &frame->mc_gregs[PT_MSR]))
return 1;
if (sigret) { if (sigret) {
/* Set up the sigreturn trampoline: li r0,sigret; sc */ /* Set up the sigreturn trampoline: li r0,sigret; sc */
if (__put_user(0x38000000UL + sigret, &frame->tramp[0]) if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment