s390_sthyi — emulate STHYI instruction
#include <asm/unistd.h>
int
s390_sthyi( |
unsigned long function_code, |
void *resp_buffer, | |
uint64_t *return_code, | |
unsigned long flags) ; |
Note | |
---|---|
There is no glibc wrapper for this system call; see NOTES. |
The s390_sthyi
() system call
emulates the STHYI (Store Hypervisor Information)
instruction. It provides hardware resource information for
the machine and its virtualization levels. This includes CPU
type and capacity, as well as the machine model and other
metrics.
The function_code
argument indicates which function to perform. The following
code(s) are supported:
0
Return CP (Central Processor) and IFL (Integrated Facility for Linux) capacity information.
The resp_buffer
argument specifies the address of a response buffer. When the
function_code
is 0,
the buffer must be one page (4K) in size. If the system call
returns 0, the response buffer will be filled with CPU
capacity information. Otherwise, the response buffer's
content is unchanged.
The return_code
argument stores the return code of the STHYI instruction,
using one of the following values:
0
Success.
4
Unsupported function code.
For further details about return_code
, function_code
, and resp_buffer
, see the reference
given in NOTES.
The flags
argument
is provided to allow for future extensions and currently must
be set to 0.
On success (that is: emulation succeeded), the return
value of s390_sthyi
() matches
the condition code of the STHYI instructions, which is a
value in the range [0..3]. A return value of 0 indicates that
CPU capacity information is stored in *resp_buffer
. A return value of
3 indicates "unsupported function code" and the content of
*resp_buffer
is
unchanged. The return values 1 and 2 are reserved.
On error, −1 is returned, and errno
is set to indicate the error.
The value specified in resp_buffer
or return_code
is not a
valid address.
The value specified in flags
is nonzero.
Allocating memory for handling the CPU capacity information failed.
The value specified in function_code
is not
valid.
Glibc does not provide a wrapper for this system call; call it using syscall(2)
For details of the STHYI instruction, see the documentation page
When the system call interface is used, the response buffer doesn't have to fulfill alignment requirements described in the STHYI instruction definition.
The kernel caches the response (for up to one second, as of Linux 4.16). Subsequent system call invocations may return the cached response.
This page is part of release 5.11 of the Linux man-pages
project. A
description of the project, information about reporting bugs,
and the latest version of this page, can be found at
https://www.kernel.org/doc/man−pages/.
Copyright IBM Corp. 2017 Author: QingFeng Hao <haoqflinux.vnet.ibm.com> %%%LICENSE_START(GPLv2+_DOC_FULL) This is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU General Public License's references to "object code" and "executables" are to be interpreted as the output of any document formatting or typesetting system, including intermediate and printed output. This manual is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this manual; if not, see <http://www.gnu.org/licenses/>. %%%LICENSE_END |