xref: /linux/arch/s390/kernel/facility.c (revision 6e7fd890f1d6ac83805409e9c346240de2705584)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright IBM Corp. 2023
4  */
5 
6 #include <asm/facility.h>
7 
8 unsigned int stfle_size(void)
9 {
10 	static unsigned int size;
11 	unsigned int r;
12 	u64 dummy;
13 
14 	r = READ_ONCE(size);
15 	if (!r) {
16 		r = __stfle_asm(&dummy, 1) + 1;
17 		WRITE_ONCE(size, r);
18 	}
19 	return r;
20 }
21 EXPORT_SYMBOL(stfle_size);
22