From: Heiko Carstens Date: Sat, 3 Feb 2024 10:45:03 +0000 (+0100) Subject: s390/fpu: add documentation about fpu helper functions X-Git-Tag: block-6.9-20240315~48^2~60 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=045bad0800cec6098c30148e2873e20db742c750;p=linux-2.6-block.git s390/fpu: add documentation about fpu helper functions Add documentation which describes what the fpu helper functions are good for, and why they should be used. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/include/asm/fpu-insn.h b/arch/s390/include/asm/fpu-insn.h index 32d2894b60ca..ccdaacdeaa97 100644 --- a/arch/s390/include/asm/fpu-insn.h +++ b/arch/s390/include/asm/fpu-insn.h @@ -15,6 +15,26 @@ asm(".include \"asm/fpu-insn-asm.h\"\n"); +/* + * Various small helper functions, which can and should be used within + * kernel fpu code sections. Each function represents only one floating + * point or vector instruction (except for helper functions which require + * exception handling). + * + * This allows to use floating point and vector instructions like C + * functions, which has the advantage that all supporting code, like + * e.g. loops, can be written in easy to read C code. + * + * Each of the helper functions provides support for code instrumentation, + * like e.g. KASAN. Therefore instrumentation is also covered automatically + * when using these functions. + * + * In order to ensure that code generated with the helper functions stays + * within kernel fpu sections, which are guarded with kernel_fpu_begin() + * and kernel_fpu_end() calls, each function has a mandatory "memory" + * barrier. + */ + /** * sfpc_safe - Set floating point control register safely. * @fpc: new value for floating point control register