[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.6 / 0013-ARM-7308-1-vfp-flush-thread-hwstate-before-copying-p.patch
1 From a4e4a6ee0cc6e069926d006b7a6efd73d33edfcc Mon Sep 17 00:00:00 2001
2 From: Will Deacon <will.deacon@arm.com>
3 Date: Mon, 30 Jan 2012 20:23:29 +0100
4 Subject: [PATCH 13/87] ARM: 7308/1: vfp: flush thread hwstate before copying
5 ptrace registers
7 commit 8130b9d7b9d858aa04ce67805e8951e3cb6e9b2f upstream.
9 If we are context switched whilst copying into a thread's
10 vfp_hard_struct then the partial copy may be corrupted by the VFP
11 context switching code (see "ARM: vfp: flush thread hwstate before
12 restoring context from sigframe").
14 This patch updates the ptrace VFP set code so that the thread state is
15 flushed before the copy, therefore disabling VFP and preventing
16 corruption from occurring.
18 Signed-off-by: Will Deacon <will.deacon@arm.com>
19 Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 arch/arm/kernel/ptrace.c | 2 +-
23 1 files changed, 1 insertions(+), 1 deletions(-)
25 diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
26 index 8b17fb4..90fa8b3 100644
27 --- a/arch/arm/kernel/ptrace.c
28 +++ b/arch/arm/kernel/ptrace.c
29 @@ -726,8 +726,8 @@ static int vfp_set(struct task_struct *target,
30 if (ret)
31 return ret;
33 - thread->vfpstate.hard = new_vfp;
34 vfp_flush_hwstate(thread);
35 + thread->vfpstate.hard = new_vfp;
37 return 0;
38 }
39 --
40 1.7.7.4