kernel: Remove the COMPAT_43 kernel option along with all related code. It is commented out in our default kernel config files for almost five years now, since 9466f37df5258f3bc3d99ae43627a71c1c085e7d. Approved-by: dillon Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2946>
kernel - Major signal path adjustments to fix races, tsleep race fixes, +more * Refactor the signal code to properly hold the lp->lwp_token. In particular the ksignal() and lwp_signotify() paths. * The tsleep() path must also hold lp->lwp_token to properly handle lp->lwp_stat states and interlocks. * Refactor the timeout code in tsleep() to ensure that endtsleep() is only called from the proper context, and fix races between endtsleep() and lwkt_switch(). * Rename proc->p_flag to proc->p_flags * Rename lwp->lwp_flag to lwp->lwp_flags * Add lwp->lwp_mpflags and move flags which require atomic ops (are adjusted when not the current thread) to the new field. * Add td->td_mpflags and move flags which require atomic ops (are adjusted when not the current thread) to the new field. * Add some freeze testing code to the x86-64 trap code (default disabled).
kernel - Move mplock to machine-independent C * Remove the per-platform mplock code and move it all into machine-independent code: sys/mplock2.h and kern/kern_mplock.c. * Inline the critical path. * When a conflict occurs kern_mplock.c will KTR log the file and line number of both the holder and conflicting acquirer. Set debug.ktr.giant_enable=-1 to enable conflict logging.
kernel - Move MP lock inward, plus misc other stuff * Remove the MPSAFE flag from the syscalls.master file. All system calls are now called without the MP lock held and will acquire the MP lock if necessary. * Shift the MP lock inward. Try to leave most copyin/copyout operations outside the MP lock. Reorder some of the copyouts in the linux emulation code to suit. Kernel resource operations are MP safe. Process ucred access is now outside the MP lock but not quite MP safe yet (will be fixed in a followup). * Remove unnecessary KKASSERT(p) calls left over from the time before system calls where prefixed with sys_* * Fix a bunch of cases in the linux emulation code when setting groups where the ngrp range check is incorrect.
AMD64 - Refactor uio_resid and size_t assumptions. * uio_resid changed from int to size_t (size_t == unsigned long equivalent). * size_t assumptions in most kernel code has been refactored to operate in a 64 bit environment. * In addition, the 2G limitation for VM related system calls such as mmap() has been removed in 32 bit environments. Note however that because read() and write() return ssize_t, these functions are still limited to a 2G byte count in 32 bit environments.
Remove the FreeBSD 3.x signal code. This includes osendsig(), osigreturn() and a couple of structures that these syscalls depended on. Split the sigaction(), sigprocmask(), sigpending(), sigsuspend(), sigaltstack() and kill() syscalls. Move the 4.3BSD signal syscalls osigvec(), osigblock(), osigsetmask(), osigstack() and okillpg() to the 43bsd subtree. I'm not too sure if these will even work with the FreeBSD-4 signal trampoline code, but they do compile and link. Implement linux_signal(), linux_rt_sigaction(), linux_sigprocmask(), linux_rt_sigprocmask(), linux_sigpending(), linux_kill(), linux_sigaction(), linux_sigsuspend(), linux_rt_sigsuspend(), linux_pause(), and linux_sigaltstack() with the new in-kernel syscalls. This patch kills 7 stackgap allocations in the Linuxolator.