summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
AgeCommit message (Collapse)Author
2015-01-19unneccessary cmask variable; ok guentherTheo de Raadt
2015-01-13Many architectures call initmsgbuf() really really early, before uvm isMark Kettenis
initialized. Calling malloc(9) at that point is not a good idea. So initialize consbuf later. Fixes dmesg -s on sparc64 (and probably a few other architectures). ok miod@, deraadt@
2014-12-31copyright_year=$(date +%Y)Joel Sing
2014-12-28The greatest happiness is to scatter inferiour APIs, to drive themKenneth R Westerback
before you, to see their files reduced to ashes, to see those who love them shrouded in tears, and to gather into your API all their invocations. In other words, workq is no more. There is only taskq. ok kettenis@ dlg@ (creator of taskq) jmc@
2014-12-17Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterPhilip Guenther
doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
2014-12-16primary change: move uvm_vnode out of vnode, keeping only a pointer.Ted Unangst
objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
2014-12-15Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,Philip Guenther
eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
2014-12-10convert bcopy to memcpy. ok millertTed Unangst
2014-11-18Disable the page zeroing thread on MULTIPROCESSOR mips64 kernels as well.Miod Vallat
Regression spotted by tobiasu@. XXX I wonder if the page zeroing thread shouldn't perform explicit XXX pmap_update(pmap_kernel()) calls after each page zeroing... but that XXX might not be enough.
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-10-25Do not launch the page zeroing thread on MULTIPROCESSOR m88k systems. ThisMiod Vallat
causes a deadlock between reaper and zerothread I am currently investigating.
2014-10-17redo the performance throttling in the kernel.Ted Unangst
introduce a new sysctl, hw.perfpolicy, that governs the policy. when set to anything other than manual, hw.setperf then becomes read only. phessler was heading in this direction, but this is slightly different. :)
2014-10-13disable pagezero thread on hppa, until failure gets diagnosed, ok miod kettenisTheo de Raadt
2014-10-11back out; does not even compileTheo de Raadt
2014-10-11resurrect a many year old diff. move CPU throttling into the kernel,Ted Unangst
enabled by setting hw.setperf=-1. some other bugs preventing this from going in before have been fixed. my thanks to phessler for keeping the diff alive in the mean time. tested by several to not regress.
2014-10-03Introduce a thread for zeroing pages without holding the kernel lock. ThisMark Kettenis
way we can do some useful kernel lock in parallel with other things and create a reservoir of zeroed pages ready for use elsewhere. This should reduce latency. The thread runs at the absolutel lowest priority such that we don't keep other kernel threads or userland from doing useful work. Can be easily disabled by disabling the kthread_create(9) call in main(). Which perhaps we should do for non-MP kernels. ok deraadt@, tedu@
2014-08-14No need for raw_cb.hMartin Pieuchot
2014-07-11It's init as a process that's special, not init's original thread.Philip Guenther
Remember initprocess instead of initproc. ok matthew@ blambert@
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-06-15Fix a few format string bugs with -DDEBUGStefan Fritsch
2014-05-15Move from struct proc to process the reference-count-holding pointersPhilip Guenther
to the process's vmspace and filedescs. struct proc continues to keep copies of the pointers, copying them on fork, clearing them on exit, and (for vmspace) refreshing on exec. Also, make uvm_swapout_threads() thread aware, eliminating p_swtime in kernel. particular testing by ajacoutot@ and sebastia@
2014-05-04Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,Philip Guenther
and FORK_SYSTEM as a flag to set them. This eliminates needing to peek into other processes threads in various places. Inspired by NetBSD ok miod@ matthew@
2014-04-18Have each thread keeps its own (counted!) reference to the process's ucredsPhilip Guenther
to avoid possible use-after-free references when swapping ids in threaded processes. "Do I have the right creds?" checks are always made with the threads creds. Inspired by FreeBSD and NetBSD "right time" deraadt@
2014-03-31Grab the kernel lock before autoconf. This way device drivers can drop it inMark Kettenis
any context if they feel like it. ok deraadt@, guenther@ (who both suggested we could probably grab it even earlier)
2014-03-30Eliminates struct pcred by moving the real and saved ugids intoPhilip Guenther
struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
2014-03-29It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
ok dlg@ mpi@ deraadt@
2014-03-28Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofMartin Pieuchot
<uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
2014-03-26Move p_emul and p_sigcode from proc to process.Philip Guenther
Tweak the handling of ktrace EMUL when changing ktracing: only generate one per process (not one per thread) and pass the correct proc pointer down to the VFS layer. Permit generating of NAMI and CSW records inside ktrace(2) itself. ok deraadt@ millert@
2014-03-22Move p_sigacts from struct proc to struct process.Philip Guenther
testing help mpi@
2014-02-12Eliminate the exit sig handling, which was only invokable via thePhilip Guenther
Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@ confirms Opera runs in compat without this, so out it goes; one less hair to choke on in kern_exit.c ok tedu@ pirofti@
2014-01-20Threads can't be zombies, only processes, so change zombproc to zombprocess,Philip Guenther
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
2014-01-19Refactor rnd startup so arc4random/arc4random_buf can create a chacha stateTheo de Raadt
on first call, very early on, from boot-supplied entropy, then feed from that. Later when we have more subsystems ready, the main() can properly initialize the entropy-driven model. Lots of discussion with mikeb. ok kettenis markus mikeb
2014-01-19insane typoTheo de Raadt
2014-01-19oops, forgotten partTheo de Raadt
Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod
2014-01-19With the earlier initialization of the random subsystem, random_hostseed()Theo de Raadt
is no longer providing significant value. The random subsystem is in pretty good state, and moments later userland will feed the dmesg. ok jsing
2014-01-19We can call random_start() immediately after cpu_startup, that is theTheo de Raadt
point at which everything it does is safe, including msg buffer access. ok kettenis jsing
2014-01-01copyright++Federico G. Schwindt
2013-12-28oops, the fallback stack protector code must handle 64-bit guardsTheo de Raadt
spotted by kettenis
2013-12-28change the stack protector guard into a long word (removing the old legacyTheo de Raadt
compat pointed out by miod), and place it inside the ELF .openbsd.randomdata segment. Inside main(), only re-initialize the guard if the bootblocks failed to initialize it for us.
2013-12-28We can initialize the srandom/random system earlier from arc4random,Theo de Raadt
and do not need microtime.
2013-12-28We can random_start() earlier (not that it does too much) and callTheo de Raadt
arc4random() much earlier. Leading to random pids for anything besides 0 and 1.
2013-12-01Change 'mountlist' from CIRCLEQ to TAILQ. Be paranoid andKenneth R Westerback
use TAILQ_*_SAFE more than might be needed. Bulk ports build by sthen@ showed nobody sticking their fingers so deep into the kernel. Feedback and suggestions from millert@. ok jsing@
2013-10-29introduce tasks and taskqs as an alternative to workqs.David Gwynne
tasks are modelled on the timeout api, so users familiar with timeout_set, timeout_add, and timeout_del will already know what to expect from task_set, task_add, and task_del. i wrote this because workq_add_task can fail in the place you actually need it, and there arent any good ways of recovering at that point. workq_queue_task was added to try and help, but required external state to be stored for users of that api to know whether something was already queued or not. workqs also didnt provide a way to cancel or remove work. this has been percolating with a bunch of people. putting it in as i wrote it so i can apply their feedback to the code with the history kept in cvs.
2013-08-26move attach mpath before any hardware. the benefits being:David Gwynne
- the mpath hooks path drivers call dont have to parse autoconf structures to tell if mpath may attach in the future. it now either has already attached or never will, which is simpler to check. - i can get rid of the global mpath target array by moving it into the mpath softc because of the above. - makes reasoning about state transitions (especially around when to attach) when groups of paths are implemented a lot simpler the only real caveat is dmesg feng shui may be ruined. i can come back and look at this after i move mpath itself forward though. discussed with deraadt@ miod@ ok todd@ matthew@ krw@
2013-06-03Convert some internal APIs to use timespecs instead of timevalsPhilip Guenther
ok matthew@ deraadt@
2013-03-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2013-03-25reseed the random pool with 'dmesg' when more devices are attachedMarkus Friedl
from hshoexer@; ok tedu@, "looks good" deraadt@
2013-01-01copyright++;Jasper Lievisse Adriaanse
2012-11-05unifdef -D __HAVE_TIMECOUNTERMiod Vallat
2012-08-28Add __guard_local as a hidden symbol to ld.so, kernel, and everyMatthew Dempsky
executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.