arm64: add abstractions for FPSIMD state manipulation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Feb 2014 14:26:27 +0000 (15:26 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 19 Jun 2014 11:34:05 +0000 (12:34 +0100)
commit2c65b0d3682a1b023f59b2ebaa17876298a4bb5b
tree6cc0ebd8124509ab5fe3d761306e8c07933e3151
parentd7ee1fd79f9677e5ab75215aa696e6ac50352ca9
arm64: add abstractions for FPSIMD state manipulation

There are two tacit assumptions in the FPSIMD handling code that will no longer
hold after the next patch that optimizes away some FPSIMD state restores:
. the FPSIMD registers of this CPU contain the userland FPSIMD state of
  task 'current';
. when switching to a task, its FPSIMD state will always be restored from
  memory.

This patch adds the following functions to abstract away from straight FPSIMD
register file saves and restores:
- fpsimd_preserve_current_state -> ensure current's FPSIMD state is saved
- fpsimd_update_current_state -> replace current's FPSIMD state

Where necessary, the signal handling and fork code are updated to use the above
wrappers instead of poking into the FPSIMD registers directly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
(cherry picked from commit c51f92693c35c141cf7d9b7e2fcbb81128324eb4)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/include/asm/fpsimd.h
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/process.c
arch/arm64/kernel/signal.c
arch/arm64/kernel/signal32.c