summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/facility.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/facility.c')
-rw-r--r--arch/s390/kernel/facility.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/s390/kernel/facility.c b/arch/s390/kernel/facility.c
new file mode 100644
index 0000000000..f02127219a
--- /dev/null
+++ b/arch/s390/kernel/facility.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright IBM Corp. 2023
+ */
+
+#include <asm/facility.h>
+
+unsigned int stfle_size(void)
+{
+ static unsigned int size;
+ unsigned int r;
+ u64 dummy;
+
+ r = READ_ONCE(size);
+ if (!r) {
+ r = __stfle_asm(&dummy, 1) + 1;
+ WRITE_ONCE(size, r);
+ }
+ return r;
+}
+EXPORT_SYMBOL(stfle_size);