s390/fpu: add documentation about fpu helper functions
authorHeiko Carstens <hca@linux.ibm.com>
Sat, 3 Feb 2024 10:45:03 +0000 (11:45 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 16 Feb 2024 13:30:14 +0000 (14:30 +0100)
Add documentation which describes what the fpu helper functions are
good for, and why they should be used.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/fpu-insn.h

index 32d2894b60ca558b1a902df99f40388109c3b754..ccdaacdeaa972329354b4ac74dff637f8388d3de 100644 (file)
 
 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