arm: vfp: always clear vfp_current_hw_state when forcing reload
The current thread trying to clear the held vfp state may not be the owner of hw state. For example, Core0 Core1 Thread1 uses VFP. Thread1 vfpstate.hard.cpu = 1. vfp_current_hw_state[1] points to Thread1 vfpstate. Going to suspend. Freeze Thread1. Thread1 is switched out. VFP HW registers saved to Thread1 vfpstate. Core0 disables Core1. Stopper thread calls vfp_force_reload(). Stopper thread vfpstate.hard.cpu = NR_CPUS. ... (No PM notifier for non-idle path. So vfp_pm_suspend() is NOT called on Core1.) ... Core1 is off and VFP HW registers are lost. ... Core0 enables Core1. Core0 thaw Thread1. Thread1 migrate to Core1 before using VFP. Thread1 starts using VFP. Now we have vfp_current_hw_state[1] points to Thread1 vfpstate. And Thread1 has vfpstate.hard.cpu = 1. Thread1 does not need to reload saved vfpstate to VFP HW. Thread1 continues running using corrupted VFP HW register. This change fixes above gap by always clearing vfp_current_hw_state when vfp_force_reload() is called. CRs-fixed: 553415 Change-Id: I1b914a1e6f06c088b78e82ae01f68e3cf49f0442 Signed-off-by:Yuanyuan Zhong <zyy@motorola.com> Patch-mainline: linux-arm-kernel @ Wed Oct 2 17:59:47 EDT 2013 Signed-off-by:
Murali Nalajala <mnalajal@codeaurora.org>
Loading
Please register or sign in to comment