1 .\" Copyright IBM Corp. 2017
2 .\" Author: QingFeng Hao <haoqf@linux.vnet.ibm.com>
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .TH S390_STHYI 2 2021-03-22 "Linux Programmer's Manual"
27 s390_sthyi \- emulate STHYI instruction
30 .BR "#include <asm/sthyi.h>" " /* Definition of " STHYI_* " constants */"
31 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
32 .B #include <unistd.h>
34 .BI "int syscall(SYS_s390_sthyi, unsigned long " function_code ,
35 .BI " void *" resp_buffer ", uint64_t *" return_code ,
36 .BI " unsigned long " flags );
40 glibc provides no wrapper for
42 necessitating the use of
47 system call emulates the STHYI (Store Hypervisor Information) instruction.
48 It provides hardware resource information for the machine and its
49 virtualization levels.
50 This includes CPU type and capacity, as well as the machine model and
55 argument indicates which function to perform.
56 The following code(s) are supported:
58 .B STHYI_FC_CP_IFL_CAP
59 Return CP (Central Processor) and IFL (Integrated Facility for Linux)
64 argument specifies the address of a response buffer.
68 .BR STHYI_FC_CP_IFL_CAP ,
69 the buffer must be one page (4K) in size.
70 If the system call returns 0,
71 the response buffer will be filled with CPU capacity information.
72 Otherwise, the response buffer's content is unchanged.
76 argument stores the return code of the STHYI instruction,
77 using one of the following values:
83 Unsupported function code.
85 For further details about
90 see the reference given in NOTES.
94 argument is provided to allow for future extensions and currently
97 On success (that is: emulation succeeded), the return value of
99 matches the condition code of the STHYI instructions, which is a value
101 A return value of 0 indicates that CPU capacity information is stored in
103 A return value of 3 indicates "unsupported function code" and the content of
106 The return values 1 and 2 are reserved.
108 On error, \-1 is returned, and
110 is set to indicate the error.
114 The value specified in
118 is not a valid address.
121 The value specified in
126 Allocating memory for handling the CPU capacity information failed.
129 The value specified in
133 This system call is available since Linux 4.15.
135 This Linux-specific system call is available only on the s390 architecture.
137 For details of the STHYI instruction, see
138 .UR https://www.ibm.com\:/support\:/knowledgecenter\:/SSB27U_6.3.0\:/com.ibm.zvm.v630.hcpb4\:/hcpb4sth.htm
139 the documentation page
142 When the system call interface is used, the response buffer doesn't
143 have to fulfill alignment requirements described in the STHYI
144 instruction definition.
146 The kernel caches the response (for up to one second, as of Linux 4.16).
147 Subsequent system call invocations may return the cached response.