]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers
authorWill Deacon <will.deacon@arm.com>
Mon, 30 Jan 2012 19:23:29 +0000 (20:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Feb 2012 19:16:52 +0000 (11:16 -0800)
commit 8130b9d7b9d858aa04ce67805e8951e3cb6e9b2f upstream.

If we are context switched whilst copying into a thread's
vfp_hard_struct then the partial copy may be corrupted by the VFP
context switching code (see "ARM: vfp: flush thread hwstate before
restoring context from sigframe").

This patch updates the ptrace VFP set code so that the thread state is
flushed before the copy, therefore disabling VFP and preventing
corruption from occurring.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/ptrace.c

index 8b17fb452af84ed8292aaf62946cfebf49dc3b3d..90fa8b36b6123fbd1d7e8a049c9c091d8e707176 100644 (file)
@@ -726,8 +726,8 @@ static int vfp_set(struct task_struct *target,
        if (ret)
                return ret;
 
-       thread->vfpstate.hard = new_vfp;
        vfp_flush_hwstate(thread);
+       thread->vfpstate.hard = new_vfp;
 
        return 0;
 }