summaryrefslogtreecommitdiffstats
path: root/sys/kern (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Refactor out dosigsuspend() functionmatthew2014-07-122-22/+21
| | | | Discussed with guenther and kettenis
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-1244-179/+179
| | | | after discussions with beck deraadt kettenis.
* Remove the temporary dospartoff work around.jsing2014-07-121-19/+1
| | | | | | From Markus Mueller. ok krw@ miod@ tedu@
* Change config_deactivate(9) to always unset the DVF_ACTIVE flag sompi2014-07-121-12/+6
| | | | | | | | | | | that drivers can check for this flag to know they have to stop doing any hardware access and release their reference. While here makes the ca_activate() function optional and propagates DVACT_DEACTIVATE to the children of a device that do not implement this interface like it is done during suspend/resume. ok uebayasi@, deraadt@
* "It's not the years, honey; it's the mileage."tedu2014-07-111-5/+1
| | | | | | bluetooth support doesn't work and isn't going anywhere. the current design is a dead end, and should not be the basis for any future support. general consensus says to whack it so as to not mislead the unwary.
* reboot(9): Add MI reboot entry functionuebayasi2014-07-113-7/+18
| | | | | | | | Now, for kernel to "reboot" (reboot, halt, or shutdown), MD boot(9) is called in some places. This change introduces a new MI function reboot(9) which is simply a wrapper to call MD boot(9). OK kettenis@ deraadt@
* Use membar_producer() to force visibility instead of misusingguenther2014-07-111-6/+7
| | | | | | atomic_setbits_int() ok kettenis@
* It's init as a process that's special, not init's original thread.guenther2014-07-114-18/+23
| | | | | | Remember initprocess instead of initproc. ok matthew@ blambert@
* Flush the buffercache to 16MB on hibernate and restore its previous maxmlarkin2014-07-111-1/+33
| | | | | | size (kern.bufcachepercent) on resume, for better hibernate performance. ok beck@
* instead of defining two versions of bucketidx, just don't inline for small.tedu2014-07-101-14/+6
| | | | ok deraadt
* Add mallocarray(9)matthew2014-07-101-2/+36
| | | | | | | While here, change malloc(9)'s size argument from "unsigned long" to "size_t". ok tedu
* drain some boolean_t poisontedu2014-07-101-2/+2
|
* Stop using a shutdown hook for softraid(4) and explicitly shutdownmpi2014-07-101-1/+9
| | | | | | | | | | | | | | | | | | | the disciplines right after vfs_shutdown(). This change is required in order to be able to set `cold' to 1 before traversing the device (mainbus) tree for DVACT_POWERDOWN when halting a machine. Yes, this is ugly because sr_shutdown() needs to sleep. But at least it is obvious and hopefully somebody will be ofended and fix it. In order to properly flush the cache of the disks under softraid0, sr_shutdown() now propagates DVACT_POWERDOWN for this particular subtree of devices which are not under mainbus. As a side effect sd(4) shutdown hook should no longer be necessary. Tested by stsp@ and Jean-Philippe Ouellet. ok deraadt@, stsp@, jsing@
* pool_debug still needed for non-DIAGNOSTIC kernelsderaadt2014-07-101-2/+2
|
* syncderaadt2014-07-102-7/+7
|
* Add new sendsyslog(const char *, size_t) system call which simply passesderaadt2014-07-102-4/+81
| | | | | | | | | a message up into syslogd's /dev/log interface. This will be used to make syslog_r work during file descriptor exhaustion, or inside sandboxes which prohibit socket, connect, sendto, etc. The system call is being added about a week before the library and daemon changes. ok guenther tedu miod matthew
* hide the biglock thrashing under pool_debug so it can be turned offtedu2014-07-102-4/+4
|
* use explicit_bzero for stack and freed variablestedu2014-07-092-6/+6
|
* spellingtedu2014-07-091-2/+2
|
* Minor cleanups in wording in some comments and printfs, and added somemlarkin2014-07-091-6/+11
| | | | dprintfs to help debugging in the field (disabled by default)
* Don't use the suspending kernel's VA mapping for the piglet. It's farmlarkin2014-07-091-10/+14
| | | | | | | | | | easier and much less error-prone to just identity map it in the resuming kernel as we have more control over the VA space layout there (otherwise we are at the mercy of the suspending kernel's placement of the piglet VA). This diff also increases the size of the piglet to 4 chunks, to avoid an overwrite issue seen in m2k14 where the start of the kernel text was overwritten with a bounced chunk before unpack.
* Cleanup the chunk placement routine by removing the conflict resolver.mlarkin2014-07-091-106/+47
| | | | | | Chunks are now sorted by ascending PA and all chunks are bounced before unpack. This fixes an issue where the trampoline chunks were being placed at the end of the unpack ordering, causing overwrite during unpack.
* Teach rw_status() and rrw_status() to return LK_EXCLOTHER if it's writeguenther2014-07-092-4/+10
| | | | | | | locked by a different thread. Teach lockstatus() to return LK_EXCLUSIVE if an exclusive lock is held by some other thread. ok beck@ tedu@
* ext_type is set but never read. its a waste of space.dlg2014-07-091-2/+1
| | | | | | MEXTADD will be fixed later. ok henning@ deraadt@ mpi@
* Use suspending kernel's stack smash guard to avoid panicing during unpack.mlarkin2014-07-091-1/+15
| | | | ok deraadt@
* now that mclgeti doesnt do the rx ring accounting, cluster allocationdlg2014-07-091-9/+4
| | | | | | | | | | doesnt need to know which ifp an mbuf was allocated on so it can uncount it on free. while here, remove the ext_backend field which identifies the pool the cluster came from and use ext_arg instead. ok henning@ mpi@
* also use inverted poison patterns, to mix things up. ok deraadt miodtedu2014-07-081-2/+12
|
* Repair compilability after the recent uvmexp changes, especially formiod2014-07-082-2/+6
| | | | not compile-time-known page size platforms.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-0825-65/+30
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* pull the rx ring accounting out of the mbuf layer now that its all donedlg2014-07-082-152/+5
| | | | | | | | | | via if_rxring things. this effectively deprecates the third argument for MCLGETI and m_clget and makes the mbuf layer no longer care about interfaces and simplifies the allocation paths. the timeout used to measure livelock has been moved to net/if.c. ok mpi@
* cut things that relied on mclgeti for rx ring accounting/restriction overdlg2014-07-081-2/+4
| | | | | | | | | | to using if_rxr. cut the reporting systat did over to the rxr ioctl. tested as much as i can on alpha, amd64, and sparc64. mpi@ has run it on macppc. ok mpi@
* regenmatthew2014-07-072-11/+11
|
* Mark get{,e,res}{u,g}id() and getgroups() as NOLOCKmatthew2014-07-071-8/+8
| | | | | | | | | | A little while back, guenther moved user credentials to a per-process property, but also kept a per-thread cache that would remain stable for the duration of a thread's system call. These system calls now only access the thread's cached credentials, so they're safe to run without the kernel lock. ok kettenis, guenther
* fork1: FORK_THREAD requires FORK_SHAREFILESmatthew2014-07-071-2/+4
| | | | | | | | Now that file descriptor tables have moved from a per-thread resource to per-process, it's impossible to fork a thread without sharing the file descriptor table. ok guenther
* regenguenther2014-07-072-5/+5
|
* getentropy(2) doesn't need the kernel lock, so mark it with NOLOCK.kettenis2014-07-061-2/+2
| | | | ok matthew@
* Matthias Pfaller rescinded clauses three and four of his licensejsg2014-07-051-6/+1
| | | | http://mail-index.netbsd.org/source-changes/2009/10/18/msg002090.html
* Track whether a process is a zombie or not yet fully built via flagsguenther2014-07-047-73/+85
| | | | | | | | | | | PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's thread data. This eliminates the need for the thread-level SDEAD state. Change kvm_getprocs() (both the sysctl() and kvm backends) to report the "most active" scheduler state for the process's threads. tweaks kettenis@ feedback and ok matthew@
* Revert back to 1.129: pool_init() is called before rwlocks can beguenther2014-07-031-66/+60
| | | | used on some archs.
* this doesnt talk to uvm directly, so doesnt need uvm_extern.hdlg2014-07-021-2/+1
| | | | deraadt says go ahead
* matthew@ noticed i wasnt populating npages in the kinfo_pool sent todlg2014-07-021-1/+2
| | | | userland.
* Use real parameter types for u{dv,vn}_attach() instead of void *matthew2014-07-021-2/+2
| | | | ok guenther
* inline is the new __inlinedlg2014-07-021-3/+3
|
* use pool_count to report the number of pools to userland ratherdlg2014-07-021-34/+18
| | | | | | | than walking the list and counting the elements as we go. use sysctl_rdint, sysctl_rdstring, and sysctl_rdstruct instead of handcrafted copyouts.
* provide a pool_count global so we can figure out how many pools there aredlg2014-07-021-1/+4
| | | | active without having to walk the global pool_list.
* take the pools mutex when copying stats out of it in the sysctldlg2014-07-021-1/+5
| | | | path so we are guaranteed a consistent snapshot.
* add an explicit rwlock around the global state (the pool list and serialdlg2014-07-021-35/+49
| | | | | | | | | number) rather than rely on implicit process exclusion, splhigh and splvm. the only things touching the global state come from process context so we can get away with an rwlock instead of a mutex. thankfully. ok matthew@
* info about pools is currently given to userland by copying eachdlg2014-07-021-10/+25
| | | | | | | | | | | | | | | | | | | | | | | pools struct out. however, struct pool in the kernel contains lots of things that userland probably isnt interested in, like actual mutexes, and probably shouldnt get easy access to, like pointers to kernel memory via all the lists/trees. this implements a kinfo_pool structure that has only the data that userland needs to know about. it cuts the sysctl code over to building it from struct pool as required and copying that out instead, and cuts userland over to only handling kinfo_pool. the only problem with this is vmstat, which can read kernel images via kvm, which needs some understanding of struct pool. to cope, the struct pool definition is guarded by if defined(_KERNEL) || defined(_LIBKVM) as inspired by sysctl which needs to do the same thing sometimes. struct pool itself is generally not visible to userland though, which is good. matthew@ suggested struct kinfo_pool instead of struct pool_info. the kinfo prefix has precedent. lots of people liked this.
* Do not KASSERT an unsigned value being >= 0 after decrementing it; instead,miod2014-06-271-2/+2
| | | | | KASSERT it being > 0 before decrementing. ok dlg@
* If the kernel generates a deadly trap signal (SEGV, BUS, etc) forguenther2014-06-211-1/+12
| | | | | | | | | an untraced process but finds it blocking or ignoring it, just kill the process instead of looping. It's undefined behavor in POSIX but quite annoying when encountered in practice. improvements from kettenis@ ok matthew@