2018-05-02 13:13:28 +00:00
|
|
|
.\" Copyright (C) 2018 Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
getent.1, iconv.1, ldd.1, locale.1, localedef.1, memusage.1, memusagestat.1, pldd.1, sprof.1, time.1, _syscall.2, accept.2, add_key.2, adjtimex.2, bind.2, bpf.2, capget.2, chown.2, chroot.2, clock_getres.2, clone.2, connect.2, copy_file_range.2, epoll_ctl.2, epoll_wait.2, eventfd.2, fanotify_init.2, fanotify_mark.2, fcntl.2, fsync.2, futex.2, getcpu.2, getdents.2, getgid.2, getgroups.2, getpid.2, gettid.2, gettimeofday.2, getuid.2, getxattr.2, inotify_add_watch.2, inotify_init.2, ioctl_fat.2, ioctl_ns.2, ioctl_userfaultfd.2, ioprio_set.2, kcmp.2, kexec_load.2, keyctl.2, listxattr.2, lseek.2, madvise.2, memfd_create.2, migrate_pages.2, mount.2, mprotect.2, mremap.2, msgctl.2, msgop.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, pipe.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, readahead.2, readdir.2, readlink.2, reboot.2, recvmmsg.2, removexattr.2, rename.2, request_key.2, s390_guarded_storage.2, s390_runtime_instr.2, s390_sthyi.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, seccomp.2, select.2, select_tut.2, semctl.2, sendmmsg.2, set_thread_area.2, setgid.2, setns.2, setuid.2, setxattr.2, shmctl.2, sigaction.2, signalfd.2, sigsuspend.2, socket.2, socketpair.2, spu_run.2, stat.2, statx.2, subpage_prot.2, syscalls.2, sysctl.2, tee.2, timer_create.2, timerfd_create.2, truncate.2, uname.2, unshare.2, userfaultfd.2, ustat.2, vmsplice.2, write.2, CPU_SET.3, __ppc_get_timebase.3, alloca.3, argz_add.3, asprintf.3, backtrace.3, basename.3, bsd_signal.3, bstring.3, bswap.3, bzero.3, cacos.3, cacosh.3, catan.3, catanh.3, catgets.3, clock_getcpuclockid.3, cmsg.3, confstr.3, ctermid.3, ctime.3, des_crypt.3, dl_iterate_phdr.3, dlinfo.3, dlsym.3, duplocale.3, end.3, endian.3, errno.3, exec.3, exit.3, ferror.3, fgetws.3, fmemopen.3, fnmatch.3, fopencookie.3, fputws.3, frexp.3, ftw.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrouplist.3, getifaddrs.3, getline.3, getlogin.3, getmntent.3, getnameinfo.3, getopt.3, getpass.3, getprotoent_r.3, getpwnam.3, getservent_r.3, getsubopt.3, glob.3, gnu_get_libc_version.3, hsearch.3, if_nameindex.3, index.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isatty.3, iswblank.3, iswspace.3, lockf.3, makecontext.3, mallinfo.3, malloc.3, malloc_hook.3, malloc_info.3, mallopt.3, matherr.3, mbrtowc.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mcheck.3, memchr.3, mq_getattr.3, mq_notify.3, newlocale.3, nl_langinfo.3, offsetof.3, perror.3, posix_spawn.3, printf.3, pthread_attr_init.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_setaffinity_np.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, putenv.3, qsort.3, rand.3, random.3, readdir.3, regex.3, resolver.3, rpmatch.3, rtime.3, scanf.3, sem_wait.3, setaliasent.3, setbuf.3, stpcpy.3, stpncpy.3, strcat.3, strchr.3, strcmp.3, strcpy.3, strdup.3, strerror.3, strfromd.3, strfry.3, strftime.3, string.3, strlen.3, strnlen.3, strsep.3, strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, system.3, termios.3, trunc.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscat.3, wcscpy.3, wcslen.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wcsstr.3, wcstok.3, wcstombs.3, wcwidth.3, wprintf.3, xcrypt.3, console_codes.4, dsp56k.4, full.4, initrd.4, lirc.4, loop.4, st.4, tty.4, vcs.4, charmap.5, core.5, host.conf.5, locale.5, proc.5, repertoiremap.5, resolv.conf.5, termcap.5, tmpfs.5, tzfile.5, aio.7, capabilities.7, cgroup_namespaces.7, cgroups.7, charsets.7, complex.7, epoll.7, fanotify.7, feature_test_macros.7, inotify.7, ip.7, locale.7, man-pages.7, man.7, namespaces.7, pid_namespaces.7, pkeys.7, pthreads.7, rtld-audit.7, sched.7, signal.7, sock_diag.7, socket.7, tcp.7, udp.7, unicode.7, user_namespaces.7, utf-8.7, zdump.8, zic.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-06 14:11:03 +00:00
|
|
|
.TH S390_GUARDED_STORAGE 2 2019-03-06 "Linux Programmer's Manual"
|
2018-04-14 16:43:51 +00:00
|
|
|
.SH NAME
|
|
|
|
s390_guarded_storage \- operations with z/Architecture guarded storage facility
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <asm/guarded_storage.h>
|
|
|
|
.PP
|
2018-05-02 12:31:15 +00:00
|
|
|
.BI "int s390_guarded_storage(int " command ", struct gs_cb *" gs_cb ");"
|
2018-04-14 16:43:51 +00:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
|
|
|
.BR s390_guarded_storage ()
|
|
|
|
system call enables the use of the Guarded Storage Facility
|
2018-05-02 12:31:15 +00:00
|
|
|
(a z/Architecture-specific feature) for user-space processes.
|
2018-04-14 16:43:51 +00:00
|
|
|
.PP
|
|
|
|
.\" The description is based on
|
|
|
|
.\" http://www-05.ibm.com/de/linux-on-z-ws-us/agenda/pdfs/8_-_Linux_Whats_New_-_Stefan_Raspl.pdf
|
|
|
|
.\" and "z/Architecture Principles of Operation" obtained from
|
|
|
|
.\" http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr011.pdf
|
|
|
|
The guarded storage facility is a hardware feature that allows marking up to
|
|
|
|
64 memory regions (as of z14) as guarded;
|
2018-05-02 12:34:32 +00:00
|
|
|
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.
|
2018-04-14 16:43:51 +00:00
|
|
|
.PP
|
|
|
|
The
|
|
|
|
.\" The command description is copied from v4.12-rc1~139^2~56^2 commit message
|
|
|
|
.I command
|
|
|
|
argument indicates which function to perform.
|
|
|
|
The following commands are supported:
|
|
|
|
.TP
|
|
|
|
.B GS_ENABLE
|
2018-05-02 12:31:15 +00:00
|
|
|
Enable the guarded storage facility for the calling task.
|
2018-04-14 16:43:51 +00:00
|
|
|
The initial content of the guarded storage control block will be all zeros.
|
2018-05-02 12:31:15 +00:00
|
|
|
After enablement, user-space code can use the "Load Guarded Storage
|
2018-04-14 16:43:51 +00:00
|
|
|
Controls" (LGSC) instruction (or the
|
|
|
|
.BR load_gs_cb ()
|
|
|
|
function wrapper provided in the
|
2018-05-02 12:27:46 +00:00
|
|
|
.I asm/guarded_storage.h
|
2018-04-14 16:43:51 +00:00
|
|
|
header) to load an arbitrary control block.
|
2018-05-02 12:31:15 +00:00
|
|
|
While a task is enabled, the kernel will save and restore the calling content
|
2018-04-14 16:43:51 +00:00
|
|
|
of the guarded storage registers on context switch.
|
|
|
|
.TP
|
|
|
|
.B GS_DISABLE
|
2018-05-02 12:31:15 +00:00
|
|
|
Disables the use of the guarded storage facility for the calling task.
|
2018-04-14 16:43:51 +00:00
|
|
|
The kernel will cease to save and restore the content of the guarded storage
|
|
|
|
registers, the task-specific content of these registers is lost.
|
|
|
|
.TP
|
|
|
|
.B GS_SET_BC_CB
|
|
|
|
Set a broadcast guarded storage control block to the one provided in the
|
|
|
|
.I gs_cb
|
|
|
|
argument.
|
|
|
|
This is called per thread and associates a specific guarded storage control
|
2018-05-02 12:31:15 +00:00
|
|
|
block with the calling task.
|
2018-04-14 16:43:51 +00:00
|
|
|
This control block will be used in the broadcast command
|
|
|
|
.BR GS_BROADCAST .
|
|
|
|
.TP
|
|
|
|
.B GS_CLEAR_BC_CB
|
|
|
|
Clears the broadcast guarded storage control block.
|
|
|
|
The guarded storage control block will no longer have the association
|
|
|
|
established by the
|
|
|
|
.B GS_SET_BC_CB
|
|
|
|
command.
|
|
|
|
.TP
|
|
|
|
.B GS_BROADCAST
|
2018-05-02 12:31:15 +00:00
|
|
|
Sends a broadcast to all thread siblings of the calling task.
|
2018-04-14 16:43:51 +00:00
|
|
|
Every sibling that has established a broadcast guarded storage control block
|
|
|
|
will load this control block and will be enabled for guarded storage.
|
2018-05-02 12:31:15 +00:00
|
|
|
The broadcast guarded storage control block is consumed; a second broadcast
|
2018-04-14 16:43:51 +00:00
|
|
|
without a refresh of the stored control block with
|
|
|
|
.B GS_SET_BC_CB
|
|
|
|
will not have any effect.
|
|
|
|
.PP
|
|
|
|
The
|
|
|
|
.I gs_cb
|
2018-05-02 12:34:32 +00:00
|
|
|
argument specifies the address of a guarded storage control block structure
|
|
|
|
and is currently used only by the
|
2018-04-14 16:43:51 +00:00
|
|
|
.B GS_SET_BC_CB
|
|
|
|
command; all other aforementioned commands ignore this argument.
|
|
|
|
.SH RETURN VALUE
|
|
|
|
On success, the return value of
|
|
|
|
.BR s390_guarded_storage ()
|
|
|
|
is 0.
|
|
|
|
.PP
|
|
|
|
On error, \-1 is returned, and
|
|
|
|
.IR errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
.I command
|
|
|
|
was
|
|
|
|
.BR GS_SET_BC_CB
|
|
|
|
and the copying of the guarded storage control block structure pointed by the
|
|
|
|
.I gs_cb
|
|
|
|
argument has failed.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
The value provided in the
|
|
|
|
.I command
|
2018-05-02 12:31:15 +00:00
|
|
|
argument was not valid.
|
2018-04-14 16:43:51 +00:00
|
|
|
.TP
|
|
|
|
.B ENOMEM
|
|
|
|
.I command
|
|
|
|
was one of
|
|
|
|
.BR GS_ENABLE " or " GS_SET_BC_CB ,
|
|
|
|
and the allocation of a new guarded storage control block has failed.
|
|
|
|
.TP
|
|
|
|
.B EOPNOTSUPP
|
2018-05-02 12:31:15 +00:00
|
|
|
The guarded storage facility is not supported by the hardware.
|
2018-04-14 16:43:51 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
.\" 916cda1aa1b412d7cf2991c3af7479544942d121, v4.12-rc1~139^2~56^2
|
|
|
|
This system call is available since Linux 4.12.
|
|
|
|
.SH CONFORMING TO
|
|
|
|
This Linux-specific system call is available only on the s390 architecture.
|
|
|
|
.PP
|
|
|
|
The guarded storage facility is available beginning with System z14.
|
|
|
|
.SH NOTES
|
|
|
|
Glibc does not provide a wrapper for this system call, use
|
|
|
|
.BR syscall (2)
|
|
|
|
to call it.
|
|
|
|
.PP
|
2018-05-02 12:34:32 +00:00
|
|
|
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"
|
2018-04-14 16:43:51 +00:00
|
|
|
beginning from the twelfth edition.
|
|
|
|
.PP
|
|
|
|
The
|
2018-05-02 12:27:46 +00:00
|
|
|
.I gs_cb
|
2018-04-14 16:43:51 +00:00
|
|
|
structure has a field
|
2018-05-02 12:27:46 +00:00
|
|
|
.I gsepla
|
2018-05-02 12:31:15 +00:00
|
|
|
(Guarded Storage Event Parameter List Address), which is a user-space pointer
|
2018-05-02 12:34:32 +00:00
|
|
|
to a Guarded Storage Event Parameter List structure
|
|
|
|
(that contains the address
|
2018-04-14 16:43:51 +00:00
|
|
|
of the aforementioned event handler in the
|
2018-05-02 12:27:46 +00:00
|
|
|
.I gseha
|
2018-04-14 16:43:51 +00:00
|
|
|
field), and its layout is available as a
|
|
|
|
.B gs_epl
|
|
|
|
structure type definition in the
|
2018-05-02 12:27:46 +00:00
|
|
|
.I asm/guarded_storage.h
|
2018-04-14 16:43:51 +00:00
|
|
|
header.
|
|
|
|
.\" .PP
|
|
|
|
.\" For the example of using the guarded storage facility, see
|
|
|
|
.\" .UR https://developer.ibm.com/javasdk/2017/09/25/concurrent-scavenge-using-guarded-storage-facility-works/
|
|
|
|
.\" the article with the description of its usage in the Java Garbage Collection
|
|
|
|
.\" .UE
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR syscall (2)
|