Merge remote-tracking branch 'lsk/v3.10/topic/gator' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / signal32.c
index 02de43260332b93166f823da472e53f5c6913c16..e51bbe79f5b5b9c850207a577e42018caf5fa846 100644 (file)
@@ -219,7 +219,7 @@ static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame)
         * Note that this also saves V16-31, which aren't visible
         * in AArch32.
         */
-       fpsimd_preserve_current_state();
+       fpsimd_save_state(fpsimd);
 
        /* Place structure header on the stack */
        __put_user_error(magic, &frame->magic, err);
@@ -282,8 +282,11 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame)
         * We don't need to touch the exception register, so
         * reload the hardware state.
         */
-       if (!err)
-               fpsimd_update_current_state(&fpsimd);
+       if (!err) {
+               preempt_disable();
+               fpsimd_load_state(&fpsimd);
+               preempt_enable();
+       }
 
        return err ? -EFAULT : 0;
 }