master
add powerpc64 and riscv64 to tags arch list
Pull in <sys/time.h> for clock_ymdhms bits
all pools have their ipl set via pool_setipl, so fold it into pool_init.
Delete the last emulation callbacks: we're Just ELF, so declare exec_elf_fixup() and coredump_elf() in <sys/exec_elf.h> and call them and the MD setregs() directly in kern_exec.c and kern_sig.c
In the old gprof profiling subsystem, the simplistic profil() syscall told the kernel about the sample buffer, and then the normal exit-time _mcleanup() would finalize the buffer, open()'ed a file and write out the details. This file opening has become increasingly impossible because of our privsep / privdrop, chroot, setresuid uid-dropping, pledge, unveil, and other efforts. So people stopped using gprof. Programs which needed profiling needed substantial mitigation removal changes to put them under test.
Do not relock fdp in fdrelease(). This prevents unnecessary locking in the common case.
Always use new_vmcmd() from exec_subr.c, remove the macro which duplicated code with no benefit.
Tweak genassym code generation to force preprocessor conditional directives to always be put inside functions.
Rename sched_init_runqueues() to sched_init() since so we can use it for initial bringup of the scheduler. Add the boot processor to sched_all_cpus here to ensure that sched_all_cpus is not empty. OK mpi@ kettenis@ (as part of a larger diff)
sync
Rework per proc and per process time usage accounting
remove unused bufq_switch() bufq_requeue() ok kn@ miod@ tedu@
protect the CPU state statistics with a pclock
Constify strings in symbol-related ddb interfaces, and make the iterator callback interface a bit simpler. ok beck@ claudio@ mpi@
kqueue: Implement EVFILT_USER
kqueue: Improve EVFILT_USER compatibility
move tusage from a hand rolled prod/cons lock to the one i just committed.
Let the last thread of a process teardown its VM space in exit1().
Cleanup the start of sched_init() and move the addition of CPUs to sched_all_cpus to here. An application processor is only ready to take work once sched_idle() was entered. With this the bootup code no longer requires CPU stealing since work is no longer scheduled onto unhatched CPUs. Also document the fork1() bits to add more breadcrumbs on how all this works. OK mpi@ kettenis@
remove unused intrmap_align() intrmap_match() intrmap_one() ok dlg@
Mark exit1() and sigexit() as non-returning
Protects remaining ktrwrite*() with a KERNEL_LOCK dance.
Reinstate MP_LOCKDEBUG support for mutexes
Carefully prune sysctl nodes with #ifndef SMALL_KERNEL recover space lost to other bloaty software. ok bluhm
Remove Softdep.
Add IPV6_RECVTCLASS to the authorized setsockopt operations for IPPROTO_IPV6. Fixes recent chromium browser with IPv6. ok deraadt@
In db_show_all_procs check that p->p_cpu is not NULL before calling __mp_lock_held(). This function is called on ddb entry and needs to be extra careful. OK mpi@ kettenis@
Adjust lock requirements for ps_pptr, ps_ppid and ps_oppid.
make the sleep time argument in sleep_finish nanoseconds instead of ticks
zap a pile of dangling tabs
Do not retake the SCHED_LOCK when going out of mi_switch(). No code really depends on that and it is one extra mutex operation for no good reason.
Introduce sched_unpeg_curproc() to abstract the current implementation.
Add MI high-level software interrupt dispatcher
srp_finalize(9): tsleep(9) -> tsleep_nsec(9)
On systems without xonly mmu hardware-enforcement, we can still mitigate against classic BROP with a range-checking wrapper in front of copyin() and copyinstr() which ensures the userland source doesn't overlap the main program text, ld.so text, signal tramp text (it's mapping is hard to distinguish so it comes along for the ride), or libc.so text. ld.so tells the kernel libc.so text range with msyscall(2). The range checking for 2-4 elements is done without locking (because all 4 ranges are immutable!) and is inexpensive.
Assert that reference count is always positive.
Protect mbuf statistics counter with splnet.
taskq_del_barrier(9) and timeout_del_barrier(9) should always call taskq_barrier(9) and timeout_barrier(9) respectively.
Fix the clock_gettime() handler for pthread_getcpuclockid() to use the proper way to read tu_runtime. OK mpi@
interupt -> interrupt
Sync enc/dec routines with libc.
remove unneeded includes in sys/kern ok mpi@ miod@
Introduce a generic powerbutton_event() function that does everything we expect from a power button event in a consistent manner. This gets rid of some duplicated code and means all drivers now prevent shutdown within the first 10 seconds after resume.
Error out if one syscall ever takes more than 6 arguments.
Use cpuset_cardinality() and cpuset_complement() to calculate the number of active cpus instead of checking cpuset_isset() over and over again. This is still not really atomic but the loadavg calculation is really not worth more effort. Ok kettenis@ tb@
eliminate bremfree macro, just an alias for bufcache_take. ok claudio miod
introduce a new kern.autoconf_serial sysctl that can be used by userland to monitor state changes of the kernel device tree
spelling ok jmc@ guenther@ tb@
directly use dev_t for swdevt[], remove struct swdevt ok mpi@ miod@
Allow counters_read(9) to take an optional scratch buffer.
Implement extent_alloc_region_with_descr(9) which is the equivalent of extent_alloc_region(9) that uses a pre-allocated region descriptor.
preallocate hibernate work area during boot
Fix KUBSAN by adding invalid builtin detection, as needed by our current clang. ok anton@
Fix a "copy-and-paste" error that Coverity picked up in the augment code
witness: Improve handling of lock nesting
Add SMR_ASSERT_NONCRITICAL() in assertwaitok(). This eases debugging because now the error is detected before context switch.
This code no longer uses tick_nsec so there is no need for sys/kernel.h OK dlg@
All the device and file type ioctl routines just ignore FIONBIO, so stop calling down into those layer from fcntl(F_SETFL) or ioctl(FIONBIO) and delete the "do nothing for this" stubs in all the *ioctl routines.
Introduce ps_trapped -- a pointer to the struct proc that is stopped in the debugger trap.
Remove socket lock from soo_ioctl(FIOASYNC).
Remove some includes include-what-you-use claims don't have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels.
fix double words in comments feedback and ok jmc@ miod, ok millert@
change format strings to fix SEM_DEBUG build
Prevent a double free by unlinking the descriptor before unmaping & freeing it.
Re-add config includes
Remove almost unused `flags' argument of suser().
Update an old comment
remove VATTR_NULL() define, directly call vattr_null()
change some if statements to switch cases ok deraadt@ miod@
Split out handlers for SOCK_DGRAM unix(4) sockets from SOCK_STREAM and SOCK_SEQPACKET. Introduce `uipc_dgram_usrreqs' to store pointers for dgram specific handlers.
replace timeout_add_tv with timeout_add_nsec via TIMEVAL_TO_NSEC.
Get rid of unused `so' argument in sbappendcontrol(). No functional changes.
Switch solisten() from exclusive to shared netlock.
Move buf_realloc_pages in buf.h
Remove obsolete comment
remove unused vop_generic_kqfilter() ok mlarkin@
Drop MNT_LOCAL flag in corresponding `vfsconflist' fuse(4) entry instead of cleaning it in fusefs_mount().
namei operates on vnode not inode
Put the bowels of the various VOP_PRINT routines under defined(DEBUG) || defined(DIAGNOSTIC) || defined(VFSLCKDEBUG) as they won't be used otherwise.
remove the functionality of fs.posix.setuid sysctl. obsolete and dangerous. ok deraadt
Push the KERNEL_LOCK() down to vn_statfile() and unlock fstat(2).
Fail early in VOP_READDIR if the vnode is not a VDIR. OK miod@ dlg@ tedu@ deraadt@ rsadowski@