man-pages/man2/s390_sthyi.2.html
2021-03-31 01:06:50 +01:00

215 lines
4.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of S390_STHYI</TITLE>
</HEAD><BODY>
<H1>S390_STHYI</H1>
Section: System Calls (2)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
s390_sthyi - emulate STHYI instruction
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/asm/unistd.h">asm/unistd.h</A>&gt;</B>
<B>int s390_sthyi(unsigned long </B><I>function_code</I><B>, void *</B><I>resp_buffer</I><B>,</B>
<B> uint64_t *</B><I>return_code</I><B>, unsigned long </B><I>flags</I><B>);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The
<B>s390_sthyi</B>()
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.
<P>
The
<I>function_code</I>
argument indicates which function to perform.
The following code(s) are supported:
<DL COMPACT>
<DT id="1">0<DD>
Return CP (Central Processor) and IFL (Integrated Facility for Linux)
capacity information.
</DL>
<P>
The
<I>resp_buffer</I>
argument specifies the address of a response buffer.
When the
<I>function_code</I>
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.
<P>
The
<I>return_code</I>
argument stores the return code of the STHYI instruction,
using one of the following values:
<DL COMPACT>
<DT id="2">0<DD>
Success.
<DT id="3">4<DD>
Unsupported function code.
</DL>
<P>
For further details about
<I>return_code</I>,
<I>function_code</I>,
and
<I>resp_buffer</I>,
see the reference given in NOTES.
<P>
The
<I>flags</I>
argument is provided to allow for future extensions and currently
must be set to 0.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success (that is: emulation succeeded), the return value of
<B>s390_sthyi</B>()
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
<I>*resp_buffer</I>.
A return value of 3 indicates &quot;unsupported function code&quot; and the content of
<I>*resp_buffer</I>
is unchanged.
The return values 1 and 2 are reserved.
<P>
On error, -1 is returned, and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="4"><B>EFAULT</B>
<DD>
The value specified in
<I>resp_buffer</I>
or
<I>return_code</I>
is not a valid address.
<DT id="5"><B>EINVAL</B>
<DD>
The value specified in
<I>flags</I>
is nonzero.
<DT id="6"><B>ENOMEM</B>
<DD>
Allocating memory for handling the CPU capacity information failed.
<DT id="7"><B>EOPNOTSUPP</B>
<DD>
The value specified in
<I>function_code</I>
is not valid.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>VERSIONS</H2>
This system call is available since Linux 4.15.
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
This Linux-specific system call is available only on the s390 architecture.
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
Glibc does not provide a wrapper for this system call, use
<B><A HREF="/cgi-bin/man/man2html?2+syscall">syscall</A></B>(2)
to call it.
<P>
For details of the STHYI instruction, see
the documentation page
<P>
When the system call interface is used, the response buffer doesn't
have to fulfill alignment requirements described in the STHYI
instruction definition.
<P>
The kernel caches the response (for up to one second, as of Linux 4.16).
Subsequent system call invocations may return the cached response.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?2+syscall">syscall</A></B>(2)
<A NAME="lbAK">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="11"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="12"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="13"><A HREF="#lbAG">VERSIONS</A><DD>
<DT id="14"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="15"><A HREF="#lbAI">NOTES</A><DD>
<DT id="16"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="17"><A HREF="#lbAK">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:34 GMT, March 31, 2021
</BODY>
</HTML>