xref: /linux/arch/s390/kernel/facility.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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