summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/fpu-insn.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-02-03 13:45:03 +0300
committerHeiko Carstens <hca@linux.ibm.com>2024-02-16 16:30:14 +0300
commit045bad0800cec6098c30148e2873e20db742c750 (patch)
tree139c7b00c369d00545f685233a2bf27a18ff818e /arch/s390/include/asm/fpu-insn.h
parentfd2527f20915d041e838b6e4a08122dbc73c7abc (diff)
downloadlinux-045bad0800cec6098c30148e2873e20db742c750.tar.xz
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 <imbrenda@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/fpu-insn.h')
-rw-r--r--arch/s390/include/asm/fpu-insn.h20
1 files changed, 20 insertions, 0 deletions
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