freebsd-dev/sys/compat/freebsd32
Konstantin Belousov 146fc63fce Add a way to manage thread signal mask using shared word, instead of syscall.
A new syscall sigfastblock(2) is added which registers a uint32_t
variable as containing the count of blocks for signal delivery.  Its
content is read by kernel on each syscall entry and on AST processing,
non-zero count of blocks is interpreted same as the signal mask
blocking all signals.

The biggest downside of the feature that I see is that memory
corruption that affects the registered fast sigblock location, would
cause quite strange application misbehavior. For instance, the process
would be immune to ^C (but killable by SIGKILL).

With consumers (rtld and libthr added), benchmarks do not show a
slow-down of the syscalls in micro-measurements, and macro benchmarks
like buildworld do not demonstrate a difference. Part of the reason is
that buildworld time is dominated by compiler, and clang already links
to libthr. On the other hand, small utilities typically used by shell
scripts have the total number of syscalls cut by half.

The syscall is not exported from the stable libc version namespace on
purpose.  It is intended to be used only by our C runtime
implementation internals.

Tested by:	pho
Disscussed with:	cem, emaste, jilles
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D12773
2020-02-09 11:53:12 +00:00
..
freebsd32_capability.c Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
freebsd32_ioctl.c Move 32-bit compat support for FIODGNAME to the right place. 2018-10-26 17:59:25 +00:00
freebsd32_ioctl.h Move 32-bit compat support for FIODGNAME to the right place. 2018-10-26 17:59:25 +00:00
freebsd32_ipc.h Rename kernel-only members of semid_ds and msgid_ds. 2018-03-02 22:10:48 +00:00
freebsd32_misc.c Copy out aux args after the argument and environment vectors. 2019-12-09 19:17:28 +00:00
freebsd32_misc.h
freebsd32_proto.h sysent: regenerate after r354835 2019-11-18 23:31:12 +00:00
freebsd32_signal.h
freebsd32_syscall.h sysent: regenerate after r352747. 2019-09-26 15:41:10 +00:00
freebsd32_syscalls.c sysent: regenerate after r352747. 2019-09-26 15:41:10 +00:00
freebsd32_sysent.c Jail and capability mode for shm_rename; add audit support for shm_rename 2019-11-18 13:31:16 +00:00
freebsd32_systrace_args.c sysent: regenerate after r354835 2019-11-18 23:31:12 +00:00
freebsd32_util.h Use uintptr_t instead of register_t * for the stack base. 2019-12-03 23:17:54 +00:00
freebsd32.h
Makefile sysent targets: further cleanup and deduplication 2020-01-18 20:37:45 +00:00
syscalls.conf Use the main capabilities.conf for freebsd32. 2018-11-14 00:46:02 +00:00
syscalls.master Add a way to manage thread signal mask using shared word, instead of syscall. 2020-02-09 11:53:12 +00:00