diff options
author | Michael Neuling <mikey@neuling.org> | 2013-11-24 19:12:20 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-11-24 19:50:51 -0500 |
commit | ec67ad82814bee92251fd963bf01c7a173856555 (patch) | |
tree | 8f03379f169ef11972c72d4281c82446c7b5e93f /arch/powerpc/kernel/signal_64.c | |
parent | 8ff812719ac73ef9428b788e210221c8d87b2a8c (diff) |
powerpc/signals: Improved mark VSX not saved with small contexts fix
In a recent patch:
commit c13f20ac48328b05cd3b8c19e31ed6c132b44b42
Author: Michael Neuling <mikey@neuling.org>
powerpc/signals: Mark VSX not saved with small contexts
We fixed an issue but an improved solution was later discussed after the patch
was merged.
Firstly, this patch doesn't handle the 64bit signals case, which could also hit
this issue (but has never been reported).
Secondly, the original patch isn't clear what MSR VSX should be set to. The
new approach below always clears the MSR VSX bit (to indicate no VSX is in the
context) and sets it only in the specific case where VSX is available (ie. when
VSX has been used and the signal context passed has space to provide the
state).
This reverts the original patch and replaces it with the improved solution. It
also adds a 64 bit version.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index e66f67b8b9e6..42991045349f 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -122,6 +122,12 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, | |||
122 | flush_fp_to_thread(current); | 122 | flush_fp_to_thread(current); |
123 | /* copy fpr regs and fpscr */ | 123 | /* copy fpr regs and fpscr */ |
124 | err |= copy_fpr_to_user(&sc->fp_regs, current); | 124 | err |= copy_fpr_to_user(&sc->fp_regs, current); |
125 | |||
126 | /* | ||
127 | * Clear the MSR VSX bit to indicate there is no valid state attached | ||
128 | * to this context, except in the specific case below where we set it. | ||
129 | */ | ||
130 | msr &= ~MSR_VSX; | ||
125 | #ifdef CONFIG_VSX | 131 | #ifdef CONFIG_VSX |
126 | /* | 132 | /* |
127 | * Copy VSX low doubleword to local buffer for formatting, | 133 | * Copy VSX low doubleword to local buffer for formatting, |