summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2010-01-12Since ifinit() is now safe to be called earlier, call it just beforeTheo de Raadt
configure(), since some upcoming changes will require it. ok henning
2010-01-12Move initialization of the MCLGETI ticker to mbinit(), instead of ifinit()Theo de Raadt
ok henning
2010-01-11Negative offset or negative size in a buf is invalid. Treat just like otherKenneth R Westerback
invalid offsets and sizes: reject the i/o. ok deraadt@ beck@
2010-01-10Reimplement kvm_getproc2()'s support for reading crash dumps andPhilip Guenthe
/dev/mem to be direct instead of going through kvm_getprocs(), as that function is going to get more an more broken as we move stuff from struct proc to struct process for rthreads. To minimize the code copying, put the common logic of filling in a kinfo_proc2 structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from both the kernel and user-space. This also hides the KERN_PROC #define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's deprecated. Positive feedback from millert and blambert; so committing to unblock further rthreads work.
2010-01-09Add code to stop scheduling processes on CPUs, effectively halting that CPU.Mark Kettenis
Use this to do a shutdown with only the boot processor running. This should avoid nasty races during shutdown. help from art@, ok deraadt@, miod@
2010-01-08As advertised in the man page, make open(2) return ELOOP (insteadStefan Sperling
of EMLINK) if the O_NOFOLLOW flag is set and the target is a symlink. Aligns with Solaris and Linux behaviour. ok tedu@ thib@ guenther@
2010-01-04Don't decrement the refcnt on a plimits until after we're donePhilip Guenthe
copying it, so that the process can't sleep in pool_get() and have the source structure get pool_put() or modified behind its back. ok deraadt@
2010-01-03Use atomic operations to access the per-cpu scheduler flags.Mark Kettenis
2010-01-01copyright++;Miod Vallat
2009-12-28Sanity check flags in fork1(), banning some combos we don't supportPhilip Guenthe
and catching FORK_THREAD when RTHREADS wasn't compiled in. Simplify sys_rfork() based on that. Flesh out the Linux clone support with more flags, but stricter checks for missing support or bad combos. Still not enough for NPTL to work, mind you. ok kettenis@
2009-12-27Correct previous commit: match the errno return by thrsleep() inPhilip Guenthe
the already-timed-out case to be the same (EWOULDBLOCK) as when it times out after sleeping
2009-12-23The process's rdomain should be, well, per-process and not per-rthread,Philip Guenthe
so put it in struct process instead of struct proc. While at it, move the p_emul member inside struct proc so that it gets copied automatically instead of requiring manual assignment. ok deraadt@
2009-12-20When using ptrace(), death of the traced process should always sendPhilip Guenthe
SIGCHLD to the tracer, even if the real parent requested an alternate exit signal. So, delay clearing the P_TRACED flag from exit1() to sys_wait4() so that we don't send the wrong signal from reaper(). Originally discussed with kurt months ago "looks good" deraadt@
2009-12-20svr4_sys_waitsys() was seemingly implemented by copying sys_wait4()Philip Guenthe
and hacking on it. Since then, some of the details of finishing a wait have changed (p_exitsig handling), so factor out the common bit into into proc_finish_wait() and have both sys_wait4() and svr4_sys_waitsys() call that to kill the divergence. "looks good" deraadt@
2009-12-17if anyone vref()s a VNON vnode, panic. This should not happen.Owain Ainsworth
Written while trying to debug the nfs_inactive panics. Turns out it never got hit, but it's a useful check to have. ok beck@
2009-11-29Backout previous commit. There is a possible race which makes it possibleMark Kettenis
for sys_reboot() to hang forever.
2009-11-29- add net80211, from Vladimir KirillovStuart Henderson
- sort nnpfs alphabetically ok deraadt jasper
2009-11-27RegeneratePhilip Guenthe
2009-11-27Add setrdomain() and getrdomain() system calls. Committing now toPhilip Guenthe
catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
2009-11-27Convert thrsleep() to an absolute timeout with clockid to eliminate aPhilip Guenthe
race condition and prep for later support of pthread_condattr_setclock() "get it in" deraadt@, tedu@, cheers by others
2009-11-27Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tPhilip Guenthe
and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
2009-11-27Change threxit() to take a pointer to a pid_t to zero out from thePhilip Guenthe
kernel so that librthread can detect when a thread is completely done with its stack without need a kqueue. The dying thread moves itself to a GC list, other threads scan the GC list on pthread_create() and pthread_join() and free the stack and handle once the thread's thread id is zeroed. "get it in" deraadt@, tedu@, cheers by others
2009-11-27typo in documentation; missing full stop.Igor Sobrado
from Dawe.
2009-11-25Add a mechanism to stop the scheduler from scheduling processes on aMark Kettenis
particular CPU such that it just sits and spins in the idle loop, effectively halting that CPU. ok deraadt@, miod@
2009-11-23Make config_activate_children() more useable as a suspend-and-resumeTheo de Raadt
device tree walker, and add config_suspend() as well. ok mlarkin pirofti, discussion with kettenis
2009-11-23Replace in-line implementation of soqinsque with a call to soqinsque.Jacek Masiulaniec
"looks right" deraadt@
2009-11-22Add basic suspend/resume autoconf functionality.Paul Irofti
Okay deraadt@, kettenis@, mlarkin@.
2009-11-19Dell's SVR4 apparently mapped page zero to the executable. We don'tPhilip Guenthe
do that and, given the security issues it exacerbates, never will. So document it and delete the disabled support. ok deraadt@ tedu@
2009-11-13>15 year old buffer-read-1-byte-too-far in clrbits() [code I wrote, yeah]Theo de Raadt
with a subtle change to make it more clear (and more cache friendly) netbsd pr 42312, found by tlambert@apple.com ok miod
2009-11-13Extend the protosw pr_ctlinput function to include the rdomain. This isClaudio Jeker
needed so that the route and inp lookups done in TCP and UDP know where to look. Additionally in_pcbnotifyall() and tcp_respond() got a rdomain argument as well for similar reasons. With this tcp seems to be now fully rdomain save and no longer leaks single packets into the main domain. Looks good markus@, henning@
2009-11-09Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tNicholas Marriott
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and remove it from any occurences where both are used, except one for kqueue itself and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag). Based on a diff from tedu. ok deraadt
2009-11-04Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.Mark Kettenis
ok jsing@, miod@
2009-10-31Use suser when possible. Suggested by miod@.Federico G. Schwindt
miod@ deraadt@ ok.
2009-10-30pipeclose() calls pileseltimeout() which does the KNOTE(); therefore callingTheo de Raadt
KNOTE() a second time is not needed (and perhaps bad) ok claudio millert
2009-10-30Add missing KNOTE() calls after selwakeup() in ptcread() (to wake up writersNicholas Marriott
after the master side of the pty has finished reading) and in ttyflush(). ok tedu millert
2009-10-28For the TIOCSET* ioctls, validate that the tty speeds are positive (sinceTheo de Raadt
they are signed int) ok miod guenther
2009-10-16cancel the timeout upon disabling profiling / virtual timer; soMartynas Venckus
that the timeout doesn't happen if setitimer is called between the profiling / virtual timer expires and the timeout is scheduled. firefox triggered this Profiling timer expired problem when in uthread execve signal was being delivered after timer has already been disabled; as reported on ports@ recently. special thanks to kettenis@, kurt@, guenther@. agreed by kettenis@, tedu@. ok guenther@. reminded & ok fgs@. tested by ian@.
2009-10-14Remove a redundant if (maxpty == npty) in check_pty - this is also tested byNicholas Marriott
the two ifs at the start of the function and both variables are only altered under pt_softc_lock so cannot change between the checks. ok guenther@
2009-10-13Make sure we do not loop when allocating an extent region with EX_CONFLICTOKMiod Vallat
and the whole extent is used; the current code computations would wrap. Found the hard way by jsg@, fix discuss with kettenis@, and you get a regress test for free (which will spin if you compile it again an old subr_extent.c)
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-10-05Don't drop the big lock at the end of exit1(), but move it into the middle ofTheo de Raadt
sched_exit(). This means that cpu_exit() and whatever it does (for instance calling free(), as well as the deadproc p_hash handling are now locked as well. This may have been one of the causes of the reaper panics, especially with rthread patches... which were terminating a lot of threads very quickly onto the deadproc p_hash list. ok kurt kettenis miod
2009-09-29Having pty_isfree_locked() be inlined may make pty allocation a tinyTheo de Raadt
bit faster, but come on, inlining is supposed to be reserved only for things which *critically* need it. ok millert
2009-09-18Make sure we handle all possible ways regions can overlap when EX_CONFLICTOKMark Kettenis
is specified. ok miod@
2009-09-13M_DUP_PKTHDR() define -> m_dup_pkthdr() function to properly dealKenneth R Westerback
with m_tag_copy_chain() failures. Use m_defrag() to eliminate hand rolled defragging of mbufs and some uses of M_DUP_PKTHDR(). Original diff from thib@, claudio@'s feedback integrated by me. Tests kevlo@ claudio@, "reads ok" blambert@ ok thib@ claudio@, "m_defrag() bits ok" kettenis@
2009-09-08copyout() the correct size in sys_fhstatfs(), broken since 1.138.Miod Vallat
ok millert@ blambert@ otto@
2009-09-05sync comment to reality, off-page page headers go intoThordur I. Bjornsson
an RB tree, not into a hashtable.
2009-09-02check if we have access to the vnode before checking if we can write toFederico G. Schwindt
it. thib@ ok'd the idea and an earlier diff.
2009-09-02when you add a task to a workq, it allocates memory to handle theDavid Gwynne
task and shove it on a list. allocations can fail, so if something that wants to run a task later already has memory to handle the workq task then let it provide it via a new function called workq_queue_task. ok kettenis@
2009-08-26add commented out options for PAGEFASTRECYCLE, KVA_GUARDPAGES, shuffle VFSDEBUGThordur I. Bjornsson
around and add POOL_DEBUG as an enabled option, removing the define from subr_pool.c. comments & ok deraadt@.
2009-08-25If option DIAGNOSTIC, do not bother doing sanity checks, including anMiod Vallat
uvm_map_checkprot() call, if the memory we're about to return has just been allocated with uvm_km_kmemalloc() instead of coming from the freelist. No functional change but a very small speedup when the freelist for the given bucket is empty.