ARM: add support for kernel mode NEON
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 16 May 2013 09:41:48 +0000 (11:41 +0200)
committerIliyan Malchev <malchev@google.com>
Fri, 2 Jan 2015 20:39:49 +0000 (12:39 -0800)
commit7c8865cc8b5afabec1952a172dbd79350e1844c0
tree6455e25664f91bb455ef72177449a35d8342583d
parent2b996fa96e94dbf6c787fce1ec150b1146f80718
ARM: add support for kernel mode NEON

In order to safely support the use of NEON instructions in
kernel mode, some precautions need to be taken:
- the userland context that may be present in the registers (even
  if the NEON/VFP is currently disabled) must be stored under the
  correct task (which may not be 'current' in the UP case),
- to avoid having to keep track of additional vfpstates for the
  kernel side, disallow the use of NEON in interrupt context
  and run with preemption disabled,
- after use, re-enable preemption and re-enable the lazy restore
  machinery by disabling the NEON/VFP unit.

This patch adds the functions kernel_neon_begin() and
kernel_neon_end() which take care of the above. It also adds
the Kconfig symbol KERNEL_MODE_NEON to enable it.

Change-Id: I286f9d414e87568f094b7782762faea46c6d4831
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Chris Fries <cfries@motorola.com>
arch/arm/Kconfig
arch/arm/include/asm/neon.h [new file with mode: 0644]
arch/arm/vfp/vfpmodule.c