arm64/fpsimd: Add interface for kernel use of SVE and SME

We currently support in kernel use of FPSIMD via the kernel_neon_begin()
and kernel_neon_end() interface but there is no corresponding interface
for SVE or SME. Given that SVE hardware is now becoming widely available
there is interest in using these more modern floating point instruction
sets for in kernel applications let's add an interface which allows them
to be selected in addition to FPSIMD.

The sharing of registers and code means that using kernel_neon_begin()
is actually doing most of the setup required, the only problem is that we
are not configuring the vector length so any SVE or SME code would just use
whatever vector length is configured in the hardware potentially leading to
uneven performance on systems which support multiple vector lengths. Add
a new kernel_fp_begin()/end() interface which allows the caller to flag if
it will use SVE or SME and initialises the vector length if requested.

We allow simultaneous specification of multiple extensions since it is
possible that a user may wish to mix them in a single algorithm, there is
no cost to allowing this.

Signed-off-by: Mark Brown <broonie@kernel.org>
2 files changed