s390_guarded_storage(2) | System Calls Manual | s390_guarded_storage(2) |
s390_guarded_storage - operations with z/Architecture guarded storage facility
Standard C library (libc, -lc)
#include <asm/guarded_storage.h> /* Definition of GS_* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h>
int syscall(SYS_s390_guarded_storage, int command, struct gs_cb *gs_cb);
Note: glibc provides no wrapper for s390_guarded_storage(), necessitating the use of syscall(2).
The s390_guarded_storage() system call enables the use of the Guarded Storage Facility (a z/Architecture-specific feature) for user-space processes.
The guarded storage facility is a hardware feature that allows marking up to 64 memory regions (as of z14) as guarded; reading a pointer with a newly introduced "Load Guarded" (LGG) or "Load Logical and Shift Guarded" (LLGFSG) instructions will cause a range check on the loaded value and invoke a (previously set up) user-space handler if one of the guarded regions is affected.
The command argument indicates which function to perform. The following commands are supported:
The gs_cb argument specifies the address of a guarded storage control block structure and is currently used only by the GS_SET_BC_CB command; all other aforementioned commands ignore this argument.
On success, the return value of s390_guarded_storage() is 0.
On error, -1 is returned, and errno is set to indicate the error.
Linux on s390.
Linux 4.12. System z14.
The description of the guarded storage facility along with related instructions and Guarded Storage Control Block and Guarded Storage Event Parameter List structure layouts is available in "z/Architecture Principles of Operations" beginning from the twelfth edition.
The gs_cb structure has a field gsepla (Guarded Storage Event Parameter List Address), which is a user-space pointer to a Guarded Storage Event Parameter List structure (that contains the address of the aforementioned event handler in the gseha field), and its layout is available as a gs_epl structure type definition in the asm/guarded_storage.h header.
syscall(2)
2023-10-31 | Linux man-pages 6.7 |