arm64: add abstractions for FPSIMD state manipulation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Feb 2014 14:26:27 +0000 (15:26 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 8 May 2014 09:31:41 +0000 (11:31 +0200)
commitc51f92693c35c141cf7d9b7e2fcbb81128324eb4
tree940006e10b6aa199babdbc16da334713682174b8
parent0567f5facbdf04806a37ef521dd0893159fde715
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>
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