diff options
author | Will Deacon <will.deacon@arm.com> | 2012-01-30 20:21:42 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-02 17:37:41 +0000 |
commit | 2af276dfb1722e97b190bd2e646b079a2aa674db (patch) | |
tree | 8fee4bc70d769d2d6bea25c627ff63716c3d0b20 /arch/arm/kernel/ptrace.c | |
parent | 97f1040982d7935716e9a45a26ccd5cc8fe92f8c (diff) | |
download | op-kernel-dev-2af276dfb1722e97b190bd2e646b079a2aa674db.zip op-kernel-dev-2af276dfb1722e97b190bd2e646b079a2aa674db.tar.gz |
ARM: 7306/1: vfp: flush thread hwstate before restoring context from sigframe
Following execution of a signal handler, we currently restore the VFP
context from the ucontext in the signal frame. This involves copying
from the user stack into the current thread's vfp_hard_struct and then
flushing the new data out to the hardware registers.
This is problematic when using a preemptible kernel because we could be
context switched whilst updating the vfp_hard_struct. If the current
thread has made use of VFP since the last context switch, the VFP
notifier will copy from the hardware registers into the vfp_hard_struct,
overwriting any data that had been partially copied by the signal code.
Disabling preemption across copy_from_user calls is a terrible idea, so
instead we move the VFP thread flush *before* we update the
vfp_hard_struct. Since the flushing is performed lazily, this has the
effect of disabling VFP and clearing the CPU's VFP state pointer,
therefore preventing the thread from being updated with stale data on
the next context switch.
Cc: stable <stable@vger.kernel.org>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions