summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2011-06-24machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andChristian Weisgerber
i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
2011-06-23Make mbufs and dma_alloc be contig allocations.Ariane van der Steldt
Requested by dlg@ ok oga@
2011-06-20serialize attach and detach of device sub-trees -- only one deviceTheo de Raadt
sub-tree may attach or detach at a time. attach and detach will sleep against each other. this is fixing (working around?) some bizzare corner cases that have been seen (but not fully diagnosed) where the device trees, disk registration subsystem, and other things could get messed up. one could argue though that this serialization is a very good thing; it is easier than adding piles of locks in various other places. ok matthew jsing
2011-06-19Minor cleanup for disk_lock() and disk_unlock().Matthew Dempsky
ok deraadt@
2011-06-19Add disk_lock_nointr() as a way to acquire the disk lock without beingMatthew Dempsky
interrupted by signals. ok deraadt@
2011-06-19Kill the "lockname" argument to disk_construct().Matthew Dempsky
ok deraadt@
2011-06-09Don't copy the first octet of the source IPv6 address where the destinationStuart Henderson
address should be, fixes broken fstat output for v6 socket connections. Problem noticed by dhill@, ok todd@, "i have no idea what that diff is touching, but it sure looks ok" halex@
2011-06-06Backout vmmap in order to repair virtual address selection algorithmsAriane van der Steldt
outside the tree.
2011-06-06push kernel malloc(9) and kernel stacks into non-dma memory, since thatTheo de Raadt
appears to be safe now. If not, we'll know soon where the bugs lie, so that we can fix them. This diff has been in snapshots for many months. ok oga miod
2011-06-05Move the bufcachepercent setting code to MI locations -- set it to 42%Theo de Raadt
for now; that is unlikely to hit some of the remaining starvation bugs. Repair the bufpages calculation too; i386 was doing it ahead of time (incorrectly) and then re-calculating it. ok thib
2011-06-03Get rid of the wlabel argument to bounds_check_with_label(). It'sMatthew Dempsky
never done anything in OpenBSD and just clutters disk drivers with silly flag handling. More cleanup to follow. ok deraadt@, millert@; no objections krw@
2011-06-02We will ignore retval2; it is not an issueTheo de Raadt
2011-06-01Add device_ref/device_unref calls to prevent a possible use-after-freeMatthew Dempsky
issue in disk_attach_callback. Assumes that the struct disk is part of the driver's softc, but this is always true in practice. Still other scary use-after-free races lying around here though... ok jsing@, deraadt@
2011-06-01regeneratePhilip Guenthe
2011-06-01Mark some system calls that don't require big lock with NOLOCKPhilip Guenthe
ok matthew@, deraadt@
2011-06-01sys_getpid() isn't really NOLOCK safe, as the compat bits inside it requirePhilip Guenthe
the p_pptr member to stay valid ok dlg@, matthew@, deraadt@, kettenis@, and others
2011-06-01Kill the nearly-15-years-dead cf_ivstubs field from struct cfdata.Matthew Dempsky
ok miod@, deraadt@ N.B.: If you're following -current, you MUST recompile config(8) and re-config your kernel or else ioconf.c will fail to compile.
2011-06-01Add a few KASSERTs to config_attach() for sanity to make sure we don'tMatthew Dempsky
try to reuse device unit numbers and to check that the device pointer array is allocated and large enough. Also, improve the panic message generated by config_detach() when we detect that we're detaching a device that still has children. Discussed with deraadt@ while trying to brainstorm ways that interleaving config_attach and config_detach could blow up.
2011-05-27Fix the return values from pipe_kqfilter - kqfilters should return anNicholas Marriott
errno not 0/1. ok guenther
2011-05-24Reimplement uvm/uvm_map.Ariane van der Steldt
vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
2011-05-20Avoid panic'ing on a bad pointer passed in by callers of msgsnd;Bret Lambert
uiomove() will do the right thing in that case. "This fix is right" kettenis@
2011-05-17Ban passing of kqueue descriptors via UNIX domain sockets. Currently,Philip Guenthe
they're tightly bound to struct filedesc, leading to NULL derefs during exit1(). ok henning@, millert@, kettenis@
2011-05-10tweak timeout_del so it can tell the caller if it actually did remove aDavid Gwynne
timeout or not. without this it is impossible to tell if the timeout was removed or if it is just about to run. if the caller of timeout_del is about to free some state the timeout itself might use, this could lead to a use after free. now if timeout_del returns 1, you know the timeout wont fire and you can proceed with cleanup. how you cope with the timeout being about to fire is up to the caller of timeout_del. discussed with drinking art and art, and most of k2k11 ok miod@
2011-05-08because bufs now come out of a pool rather than a global list of staticlyDavid Gwynne
allocated structs, they wont be shared. we dont have to do the silly B_WANTED dance anymore. get rid of a bunch of comments that talk about how we're stealing from the swapper, which is a lie now. tweaks from oga@ scrutiny by matthew@ ok miod@ oga@ thib@ beck@
2011-05-04Collapse m_pullup and m_pullup2 into a single function, as they'reBret Lambert
essentially identical; the only difference being that m_pullup2 is capable of handling mbuf clusters, but called m_pullup for shorter lengths (!). testing dlg@ ok claudio@
2011-05-03spacesMarco Peereboom
2011-05-02recognize SO_RTABLE socket option at the SOL_SOCKET level;Mike Belopuhov
discussed with and ok claudio
2011-04-28spacesMarco Peereboom
2011-04-26Allow the root device to be identified via its disklabel UID.Joel Sing
ok deraadt@ marco@ krw@
2011-04-19Put splice cleanup code into a common function sounsplice().Alexander Bluhm
ok claudio@
2011-04-18Revert the sigacts diff: NFS can apparently retain pointers to processesPhilip Guenthe
until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
2011-04-18Put back the change of pool and malloc into the new km_alloc(9) api.Artur Grabowski
The problems during the hackathon were not caused by this (most likely). prodded by deraadt@ and beck@
2011-04-16Use 'CLR(<buf>->b_flags, B_READ | B_WRITE | B_DONE)' regardless ofKenneth R Westerback
what the previous IO was. Less chance of copy and paste errors. Suggested by miod@.
2011-04-15In days of yore one could arbitrarily whack buffer flags. Those daysKenneth R Westerback
are past. Use CLR() and SET() to modify necessary flags while leaving the flags used by the buffer cache in peace. Should make bufcache code much less confused about the state of the bufs used in reading/writing disklabels. Other such flag abuses no doubt await a visit. Errors in original diff found by miod@. ok beck@ deraadt@
2011-04-15Correct the sharing of the signal handling state: stuff that shouldPhilip Guenthe
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
2011-04-11Move the DDB includes up in the file so that the m_print() prototype isClaudio Jeker
defined in all of uipc_mbuf.c. I use this function a lot for quick printf debugging.
2011-04-10Backout m_split_mbuf() from revision 1.150. It seems that m_split()Alexander Bluhm
got broken. Most /usr/src/regress/sys/kern/splice/args-oobinline-* regression tests fail when they split an mbuf at out-of-band data. ok claudio@, deraadt@
2011-04-07Revert previous diff decrementing bcstats.numbufpages here. This functionBob Beck
does not do what it purports to do, it shrinks mapping, not allocation, as the pages have already been given away to other buffers. This also renames the function to make this a little more obvious and art should not name funcitons ok thib@, art@
2011-04-07merge vfs_conf.c and vfs_init.c and retire vfs_conf.c;Thordur I. Bjornsson
The contents belong togather a long with other crud, that should get moved at some point. ok deraadt@, miod@
2011-04-06Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happeningArtur Grabowski
and we aren't sure what's causing them. shouted oks by many before I even built a kernel with the diff.
2011-04-05fix nasty buffer cache bug where we could forget about pages shrunk off of aBob Beck
buffer as the result of bread_cluster. ok art@ thib@
2011-04-05- use nitems() no binary change on amd64Jasper Lievisse Adriaanse
"reads OK" claudio@
2011-04-05Remove portalfs.Thordur I. Bjornsson
While it is a terribly cool idea, it's just awful and since noone has stepped up to the plate to keep it up with the current vop state, retire it to the attic. ok krw@, deraadt@, guenther@, miod@. comments from jmc@
2011-04-05Every single vop_default is set to eopnotsupp, so retire itThordur I. Bjornsson
and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
2011-04-05Push COMPAT_FREEBSD in front of a whale. Buggy, out of date, noPhilip Guenthe
one has been weeding it, and it makes life harder. Toasts of Brennivin for its passing from many; diff ok henning@
2011-04-05Passing M_WAITOK to mbuf functions is supposed to be a contract betweenBret Lambert
the caller and the function that the function will not fail to allocate memory and return a NULL pointer. However, m_dup_pkthdr() violates this contract, making it possible for functions that pass M_WAITOK to be surprised in ways that hurt. Fix this by passing the wait flag all the way down the functions that actually do the allocation for m_dup_pkthdr() so that we won't be surprised. man page update forthcoming ok claudio@
2011-04-05 - Change pool constraints to use kmem_pa_mode instead of uvm_constraint_rangeArtur Grabowski
- Use km_alloc for all backend allocations in pools. - Use km_alloc for the emergmency kentry allocations in uvm_mapent_alloc - Garbage collect uvm_km_getpage, uvm_km_getpage_pla and uvm_km_putpage ariane@ ok
2011-04-04both m_inject() and m_split() reached a point at which they neededBret Lambert
to cleave a single mbuf in twain, but managed to fail in divergent and horrible ways in doing so in anything resembling a sane manner introduce m_split_mbuf() and remake the previous into wrappers around that pounded by phessler@ ok claudio@
2011-04-04Correctly inherit and set the watermarks on socketbuffers.Claudio Jeker
This fixes the NFS problems reported on the mailing list and ensures that accepted sockets have correct socketbuffer setting. OK blambert@, henning@
2011-04-04Plug mbuf leaks in SO_PEERCRED by not double allocating mbufs intoClaudio Jeker
the same variable. Leak found with dlg's magic mbuf leakage finder. OK henning@, deraadt@