arm64: fix bug for reloading FPSIMD state after cpu power off
authorLeo Yan <leoy@marvell.com>
Mon, 1 Sep 2014 03:09:51 +0000 (11:09 +0800)
committerGreg Hackmann <ghackmann@google.com>
Wed, 3 Sep 2014 14:41:11 +0000 (07:41 -0700)
commitc7ca25a4ad7498bba8c20ede3c5f4a3b7931887a
tree91ceb7bc224b9db787d25081a608d23b4d0ac47b
parent597ff3a0f3ba6e471ce4dc93bf0b41abcebe9f8c
arm64: fix bug for reloading FPSIMD state after cpu power off

Now arm64 defers reloading FPSIMD state, but this optimization also
introduces the bug after cpu resume back from low power mode.

The reason is after the cpu has been powered off, s/w need set the
cpu's fpsimd_last_state to NULL so that it will force to reload
FPSIMD state for the thread, otherwise there has the chance to meet
the condition for both the task's fpsimd_state.cpu field contains the
id of the current cpu, and the cpu's fpsimd_last_state per-cpu variable
points to the task's fpsimd_state, so finally kernel will skip to reload
the context during it return back to userland.

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Leo Yan <leoy@marvell.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/fpsimd.c