summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* Backout previous change (disabling of security checks for signals deliveredsobomax2005-02-132-26/+16
| | | | | | in emulation layers), since it appears to be too broad. Requested by: rwatson
* Set levels on all CPUs and attach a cpufreq device to each one. Sysctlnjl2005-02-131-22/+62
| | | | | | on dev.cpu.0 will affect all of the CPUs together. In the future, independent control will be supported but this is good enough for now. Check that the timecounter isn't TSC before switching (from Colin Percival.)
* Split out kill(2) syscall service routine into user-level and kernel part, thesobomax2005-02-132-16/+26
| | | | | | | | | | | | | | | | | former is callable from user space and the latter from the kernel one. Make kernel version take additional argument which tells if the respective call should check for additional restrictions for sending signals to suid/sugid applications or not. Make all emulation layers using non-checked version, since signal numbers in emulation layers can have different meaning that in native mode and such protection can cause misbehaviour. As a result remove LIBTHR from the signals allowed to be delivered to a suid/sugid application. Requested (sorta) by: rwatson MFC after: 2 weeks
* Add much needed descriptions for a number of the IPC related sysctl OIDs.csjp2005-02-123-24/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This information will be very useful for people who are tuning applications which have a dependence on IPC mechanisms. The following OIDs were documented: Message queues: kern.ipc.msgmax kern.ipc.msgmni kern.ipc.msgmnb kern.ipc.msgtlq kern.ipc.msgssz kern.ipc.msgseg Semaphores: kern.ipc.semmap kern.ipc.semmni kern.ipc.semmns kern.ipc.semmnu kern.ipc.semmsl kern.ipc.semopm kern.ipc.semume kern.ipc.semusz kern.ipc.semvmx kern.ipc.semaem Shared memory: kern.ipc.shmmax kern.ipc.shmmin kern.ipc.shmmni kern.ipc.shmseg kern.ipc.shmall kern.ipc.shm_use_phys kern.ipc.shm_allow_removed kern.ipc.shmsegs These new descriptions can be viewed using sysctl -d PR: kern/65219 Submitted by: Dan Nelson <dnelson at allantgroup dot com> (modified) No objections: developers@ Descriptions reviewed by: gnn MFC after: 1 week
* Add SIGTHR (32) into list of signals permitted to be delivered to thesobomax2005-02-111-0/+1
| | | | | | | | | | | | | | | suid application. The problem is that Linux applications using old Linux threads (pre-NPTL) use signal 32 (linux SIGRTMIN) for communication between thread-processes. If such an linux application is installed suid or sgid and security.bsd.conservative_signals=1 (default), then permission will be denied to send such a signal and the application will freeze. I believe the same will be true for native applications that use libthr, since libthr uses SIGTHR for implementing conditional variables. PR: 72922 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 2 weeks
* When processing a timeout() callout and returning it to the freeiedowse2005-02-111-1/+2
| | | | | | | | | list, set `curr_callout' to NULL. This ensures that we won't attempt to cancel the current callout if the original callout structure gets recycled while we wait to acquire Giant. This is reported to fix an intermittent syscons problem that was introduced by revision 1.96.
* Optimize the way reference counting is performed with Mbufs. Webmilekic2005-02-102-25/+39
| | | | | | | | | | | | | | do not need to perform an extra memory fetch in the Packet (Mbuf+Cluster) constructor to initialize the reference counter anymore. The reference counts are located in a separate memory region (in the slab header, because this zone is UMA_ZONE_REFCNT), so the memory fetch resulted very often in a cache miss. Additionally, and perhaps more significantly, optimize the free mbuf+cluster (packet) case, which is very common, to no longer require an atomic operation on free (to verify the reference counter) if the reference on the cluster has never been increased (also very common). Reduces an atomic on mbuf free on average. Original patch submitted by: Gerrit Nagelhout <gnagelhout@sandvine.com>
* Declare "cnt" (a number of bytes to read or write) as an "ssize_t", notcperciva2005-02-101-2/+4
| | | | | | as a "long" in dofileread() and dofilewrite(). Discussed with: jhb
* Make various vnode related functions staticphk2005-02-102-68/+12
|
* Make some file/filedesc related functions staticphk2005-02-101-2/+4
|
* Make various mountpoint related functions static.phk2005-02-103-9/+12
|
* Make a SYSCTL_NODE staticphk2005-02-102-2/+2
|
* MD5Pad() should never have been exposed.phk2005-02-101-3/+2
|
* make cluster_callback() staticphk2005-02-101-1/+2
|
* Make a SYSCTL_NODE and a mutex staticphk2005-02-101-2/+2
|
* Make another bunch of SYSCTL_NODEs staticphk2005-02-101-4/+4
|
* Make a bunch of SYSCTL_NODEs static.phk2005-02-101-22/+23
|
* Make a bunch of malloc types static.phk2005-02-108-8/+9
| | | | Found by: src/tools/tools/kernxref
* Don't pass NULL to vprint()phk2005-02-101-1/+1
|
* - Add more information to the getnewbuf() recycling KTR.jeff2005-02-101-2/+4
| | | | Sponsored by: Isilon Systems, Inc.
* - Add a new assert in the getnewvnode(). Assert that the usecount is stilljeff2005-02-081-2/+4
| | | | | | | 0 to detect getnewvnode() races. - Add the vnode address to a few panics near by to help in debugging. Sponsored by: Isilon Systems, Inc.
* - Remove an invalid KASSERT added in recent background write reshuffling.jeff2005-02-081-3/+0
| | | | Sponsored by: Isilon Systems, Inc.
* Add a new sysctl, "security.jail.chflags_allowed", which controls thecperciva2005-02-081-0/+5
| | | | | | | | | | | | | behaviour of chflags within a jail. If set to 0 (the default), then a jailed root user is treated as an unprivileged user; if set to 1, then a jailed root user is treated the same as an unjailed root user. This is necessary to allow "make installworld" to work inside a jail, since it attempts to manipulate the system immutable flag on certain files. Discussed with: csjp, rwatson MFC after: 2 weeks
* Background writes are entirely an FFS/Softupdates thing.phk2005-02-081-126/+5
| | | | | | | | | | | | | | | | Give FFS vnodes a specific bufwrite method which contains all the background write stuff and then calls into the default bufwrite() for the rest of the job. Remove all the background write related stuff from the normal bufwrite. This drags the softdep_move_dependencies() back into FFS. Long term, it is worth looking at simply copying the data into allocated memory and issuing the bio directly and not create the "shadow buf" in the first place (just like copy-on-write is done in snapshots for instance). I don't think we really gain anything but complexity from doing this with a buf.
* Drag another softupdates tentacle back into FFS: Now that FFS'sphk2005-02-082-8/+0
| | | | | vop_fsync is separate from the internal use we can do the full job there.
* Maxunit is inclusive so fix off-by-one in previous commit.njl2005-02-081-1/+1
|
* Update device_find_child(9) to return the first matching child if unitnjl2005-02-081-5/+15
| | | | | | is set to -1. Reviewed by: dfr, imp
* Implement a kern_pathconf() wrapper for pathconf() which can take thejhb2005-02-072-12/+24
| | | | filename from either a user space or a kernel space pointer.
* If the pointer to the new itimerval is NULL in kern_setitimer(), justjhb2005-02-071-0/+3
| | | | read the old value via kern_getitimer().
* - Tweak kern_msgctl() to return a copy of the requested message queue idjhb2005-02-075-270/+327
| | | | | | | | | | | | | | | | | structure in the struct pointed to by the 3rd argument for IPC_STAT and get rid of the 4th argument. The old way returned a pointer into the kernel array that the calling function would then access afterwards without holding the appropriate locks and doing non-lock-safe things like copyout() with the data anyways. This change removes that unsafeness and resulting race conditions as well as simplifying the interface. - Implement kern_foo wrappers for stat(), lstat(), fstat(), statfs(), fstatfs(), and fhstatfs(). Use these wrappers to cut out a lot of code duplication for freebsd4 and netbsd compatability system calls. - Add a new lookup function kern_alternate_path() that looks up a filename under an alternate prefix and determines which filename should be used. This is basically a more general version of linux_emul_convpath() that can be shared by all the ABIs thus allowing for further reduction of code duplication.
* Various and sundry style fixes.jhb2005-02-071-4/+4
|
* Access vmobject via the bufobj instead of the vnodephk2005-02-071-11/+11
|
* VOP_DESTROYVOBJECT() is no more.phk2005-02-071-7/+0
|
* Remove vop_stddestroyvobject()phk2005-02-071-13/+0
|
* Don't call VOP_DESTROYVOBJECT(), trust that VOP_RECLAIM() did whatphk2005-02-071-2/+3
| | | | was necessary.
* Add a missing prefix to a struct field for consistency.phk2005-02-071-7/+7
|
* Add a mechanism for associating a mutex with a callout when theiedowse2005-02-071-15/+106
| | | | | | | | | | | | | | | | | | | | | | callout is first initialised, using a new function callout_init_mtx(). The callout system will acquire this mutex before calling the callout function and release it on return. In addition, the callout system uses the mutex to avoid most of the complications and race conditions inherent in asynchronous timer facilities, so mutex-protected callouts have much simpler semantics. As long as the mutex is held when invoking callout_stop() or callout_reset(), then these functions will guarantee that the callout will be stopped, even if softclock() had already begun to process the callout. Existing Giant-locked callouts will automatically pick up the new race-free semantics. This should close a number of race conditions in the USB code and probably other areas of the kernel too. There should be no change in behaviour for "MP-safe" callouts; these still need to use the techniques mentioned in timeout(9) to avoid race conditions.
* Add support for relative cpufreq drivers. Such drivers modulate clocknjl2005-02-061-27/+192
| | | | | | frequency as a percentage of the base rate and do not change the base rate directly. The cpufreq framework combines these with absolute drivers to produce synthesized levels made of one or more settings.
* - Don't release BKGRDINPROG until after we've bufdone'd the copy.jeff2005-02-051-14/+15
| | | | Sponsored by: Isilon Systems, Inc.
* - Add ke_runq == NULL to the conditions which will cause us to abortjeff2005-02-041-2/+2
| | | | | | adjusting timeshare loads in sched_class(). This is only important if the thread has never run, otherwise the state checks should work as expected.
* Set the scheduling class of the idle threads to PRI_IDLE.ssouhlal2005-02-041-1/+2
| | | | | | | | While there, set their priority with sched_prio() instead of changing it 'by hand'. Reviewed by: jhb Approved by: grehan (mentor)
* Add the cpufreq framework. This code manages multiple drivers and presentsnjl2005-02-041-0/+532
| | | | a unified kernel and user interface for controlling cpu frequencies.
* Add an interface for cpufreq. The kernel interface lets other driversnjl2005-02-041-0/+92
| | | | | | select the CPU frequency level (say for cooling). The driver interface allows hardware drivers to announce themselves as capable of adjusting an individual frequency setting.
* - Move gets() function to libkern (I want to use it outside vfs_mount.c).pjd2005-02-031-44/+2
| | | | | | | | | | - Add buffer size limitations (overflow will not be possible anymore). - Add 'visible' option, which will allow for passphrase reading in the future. - Remove special treatment of '@' and '#', those two are only confusing. Discussed with: rwatson MFC after: 2 weeks
* - Correct a typo in kern_rename. tvfslocked should be initialized fromjeff2005-02-022-2/+2
| | | | | | | | tond and not fromnd. This could lead us to leak Giant, or unlock it twice, depending on the filesystems involved. renames within a single filesystem would not have caused any problems. Sponsored by: Isilon Systems, Inc.
* - Or MPSAFE with the correct set of flags in stat(). This affected onlyjeff2005-02-012-2/+2
| | | | | | the LOOKUP_SHARED case. Spotted by: jhb
* Update copyright, remove "all rights reserved" (since they are notbmilekic2005-02-011-5/+1
| | | | | | all reserved, as the lisence makes clear), and strike the third clause (now this is a 2-clause liberal BSDL as are the rest of files I hold copyright over).
* Extend kern_sendit() to take another enum uio_seg argument, which specifiessobomax2005-01-301-3/+4
| | | | | | | where the buffer to send lies and use it to eliminate yet another stackgap in linuxlator. MFC after: 2 weeks
* Fix build on AMD64 (and probably other arches where size_t != int).sobomax2005-01-301-1/+2
| | | | | Submitted by: Tinderbox MFC after: 2 weeks
* Fix spelling of integer in a comment.rwatson2005-01-301-1/+1
| | | | Beady eyes: ceri
OpenPOWER on IntegriCloud