arm64: add abstractions for FPSIMD state manipulation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Feb 2014 14:26:27 +0000 (15:26 +0100)
committerJP Abgrall <jpa@google.com>
Thu, 28 Aug 2014 17:22:26 +0000 (10:22 -0700)
commitf11a3d1bc1528e0a01dde578c2ab88c70b3fbeff
treeaf4b8ab7937bf4feccbb8ff4fea45574f122099f
parent197028d295db718f4e5cf8af9038cfeb4823b4ef
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>
Conflicts:
arch/arm64/kernel/fpsimd.c

Change-Id: I53ae7082427cb1c5cc32e1f2ddbd4218115601ba
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