powerpc: Move part of giveup_vsx into c
Move the MSR modification into c. Removing it from the assembly function will allow us to avoid costly MSR writes by batching them up. Check the FP and VMX bits before calling the relevant giveup_*() function. This makes giveup_vsx() and flush_vsx_to_thread() perform more like their sister functions, and allows us to use flush_vsx_to_thread() in the signal code. Move the check_if_tm_restore_required() check in. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
98da581e08
commit
a7d623d4d0
@@ -147,7 +147,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
|
||||
* VMX data.
|
||||
*/
|
||||
if (current->thread.used_vsr && ctx_has_vsx_region) {
|
||||
__giveup_vsx(current);
|
||||
flush_vsx_to_thread(current);
|
||||
v_regs += ELF_NVRREG;
|
||||
err |= copy_vsx_to_user(v_regs, current);
|
||||
/* set MSR_VSX in the MSR value in the frame to
|
||||
@@ -270,7 +270,7 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc,
|
||||
* VMX data.
|
||||
*/
|
||||
if (current->thread.used_vsr) {
|
||||
__giveup_vsx(current);
|
||||
flush_vsx_to_thread(current);
|
||||
v_regs += ELF_NVRREG;
|
||||
tm_v_regs += ELF_NVRREG;
|
||||
|
||||
|
Reference in New Issue
Block a user