summaryrefslogtreecommitdiff
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@nvidia.com>2012-09-24 21:45:00 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:09:23 -0700
commite700ffc891047182e16f53fc0238c8fd9bf72007 (patch)
tree7f8bd5a793693283d56c6d5266c6f933138c099e /arch/arm/vfp
parent679c50f9effbdf5bb7b783a5b8cc3619dca3b0da (diff)
DROP! Revert "ARM: 7419/1: vfp: fix VFP flushing regression on sigreturn path"
This reverts commit 56cb248428ead13a6b423ed3f3cf9e4aa01244b1. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: R04097c3b5e214d99271f25e35d31133f2254ef38
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/vfpmodule.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 41c9a3b53161..da9cc262f14d 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -589,6 +589,12 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
* entry.
*/
hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK);
+
+ /*
+ * Disable VFP in the hwstate so that we can detect if it gets
+ * used.
+ */
+ hwstate->fpexc &= ~FPEXC_EN;
return 0;
}
@@ -601,8 +607,12 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
unsigned long fpexc;
int err = 0;
- /* Disable VFP to avoid corrupting the new thread state. */
- vfp_flush_hwstate(thread);
+ /*
+ * If VFP has been used, then disable it to avoid corrupting
+ * the new thread state.
+ */
+ if (hwstate->fpexc & FPEXC_EN)
+ vfp_flush_hwstate(thread);
/*
* Copy the floating point registers. There can be unused