Commit Graph

7582 Commits

Author SHA1 Message Date
jruoho 795224299a From jmcneill@: call config_deferred(9) in rescan_with_cfdata(). 2010-08-16 17:29:52 +00:00
pgoyette bf43b300a1 Keep condvar wmesg within 8 char limit 2010-08-11 12:04:49 +00:00
pgoyette 8be3483a20 Keep condvar wmesg within 8-char limit 2010-08-11 11:46:32 +00:00
jruoho 72795172e5 Like with mqueue(3), create and remove the aio(3) sysctl nodes dynamically. 2010-08-06 18:36:09 +00:00
pooka 5777f63fd9 Remove overzealous KASSERT: the refcount can be non-zero if another
thread attempts to use a non-open file descriptor.  from ad

fixes PR kern/43694
2010-08-04 14:25:16 +00:00
hannken c84e81cad1 Add vm page flag PG_MARKER and use it to tag dummy marker pages
in genfs_do_putpages() and uao_put().
Use 'v_uobj.uo_npages' to check for an empty memq.
Put some assertions where these marker pages may not appear.

Ok: YAMAMOTO Takashi <yamt@netbsd.org>
2010-07-29 10:54:50 +00:00
jruoho c28dcae1e0 Get rid of SYSCTL_SETUP.
We want the sysctl variables also when mqueue(3) is loaded as a module.
2010-07-28 20:49:12 +00:00
hannken 3a7edffde9 ext2fs,ffs: free on disk inodes in the reclaim routine.
Remove now unneeded vnode flag VI_FREEING.

Welcome to 5.99.38.

Ok: Andrew Doran <ad@netbsd.org>
2010-07-28 11:03:47 +00:00
hannken 2ac44efee2 Modify vn_lock():
- Take v_interlock before examining v_iflag
- Must always be called without v_interlock taken,
  LK_INTERLOCK flag is no longer allowed.
2010-07-28 09:30:21 +00:00
jakllsch 359dcd7f55 Use 'z' printf format modifier to print size_t in debug code. 2010-07-27 14:25:23 +00:00
hannken 87506b0c16 When both vget() and vrelel() call vn_lock() we know VI_XLOCK is clear.
No need to use LK_INTERLOCK or LK_RETRY here.
The return value of vn_lock() is already examined here.

Ok: Antti Kantee <pooka@netbsd.org>
2010-07-26 15:22:16 +00:00
hannken 1968478248 Add an assertion: it makes no sense to call vget() with LK_RETRY. 2010-07-25 10:23:40 +00:00
hannken fb62bef947 Make holding v_interlock mandatory for callers of vget().
Announced some time ago on tech-kern.
2010-07-21 17:52:09 +00:00
hannken 1664eae7f3 Using vfinddev() leads to vnode races as it returns an unreferenced
vnode that may disappear before the caller has a chance to reference it.

Reference the vnode while the specfs cache is locked.

Welcome to 5.99.37.

No objections on tech-kern.
2010-07-21 09:06:37 +00:00
hannken e698a5d246 Using cache_revlookup() leads to vnode races as it returns an unreferenced
vnode that may disappear before the caller has a chance to reference it.

Reference the vnode while the name cache is locked.

No objections on tech-kern.
2010-07-21 09:01:35 +00:00
pooka 7f9f73897e Include <rump/rump_syscalls_compat.h> from rump_syscalls.h. This
file will contain compat defs which are not autogenerated.
2010-07-19 15:25:47 +00:00
pooka c99c5d9840 Don't leak kernel stack into userspace. 2010-07-13 15:38:15 +00:00
rmind 25ce398524 sel_setevents: fix error - match event-set, as intended.
Spotted by Enami Tsugutomo.
2010-07-12 11:04:25 +00:00
rmind 6269e5af55 Disable direct select for now, since it still brings problems. 2010-07-11 11:17:58 +00:00
rmind 2903a8dcf1 sel_setevents: fix direct injecting of fd bit for select() case. 2010-07-10 17:04:25 +00:00
rmind 21b26eb64e sel_do_scan: do not bother to assert for SEL_SCANNING state before blocking,
as it might also be SEL_BLOCKING due to spurious wake-ups.  That has no harm.
2010-07-08 23:15:23 +00:00
rmind ce9dfd6a44 Implement direct select/poll support, currently effective for socket and
pipe subsystems.  Avoids overhead of second selscan() on wake-up, and thus
improves performance on certain workloads (especially when polling on many
file-descriptors).  Also, clean-up sys/fd_set.h header and improve macros.

Welcome to 5.99.36!
2010-07-08 12:23:31 +00:00
chs 33fa5ccbbf many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.
2010-07-07 01:30:32 +00:00
hannken 245651a23d Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode.  All LK_* flags move from sys/lock.h to sys/vnode.h.  Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
2010-07-01 13:00:54 +00:00
rmind 3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +00:00
pooka 6376b2136c Enable kernel-internal symlink creation with do_sys_symlink().
I did this a while ago already, but can't remember why i didn't
commit it then.
2010-06-30 15:44:54 +00:00
pgoyette 224f73d8d9 1. Add an allocator for 'struct module *' and use it instead of local
allocations.

2. Add a new member mod_flags to the 'struct module *' and define
   MODFLG_MUST_FORCE.  If this flag is set and the entry is on the list
   of builtins, it means that the module has been explicitly unloaded
   and any re-loads will require the MODCTL_LOAD_FORCE flag. Provide a
   module_require_force() method to set this flag;  once set, it should
   never be unset.

3. Rename original module_init2() to module_start_unload_thread() to be
   more descriptive of what it does.

4. Add a new module_builtin_require_force() routine that sets the
   MODFLG_MUST_FORCE flag for any module that has not yet successfully
   been initialized.  Call it after module_init_class(MODULE_CLASS_ANY)
   to disable remaining built-in modules.

This makes built-in versions of the xxxVERBOSE modules work once more,
resolving breakage reported by jruoho@ and njoly@.

Discussed on tech-kern, and comments and suggestions implemented.  No
additional discussion for last week.  Tested only on amd64 systems, but
there's nothing here that should be port- or architecture-specific (no
more specific than existing module implementation) so others should not
break.
2010-06-26 07:23:57 +00:00
tsutsui 7b11ac5304 Rather than referring a global variable rootvnode in autoconf(9),
prepare and use an internal "root_is_mounted" flag for config_mountroot(9).

Should fix annoying dependency problem in librump reported by Paul Goyette
on current-users@:
http://mail-index.NetBSD.org/current-users/2010/06/25/msg013771.html
2010-06-26 06:43:13 +00:00
tsutsui 9aa0a261b5 Add config_mountroot(9), which defers device configuration
after mountroot(), like config_interrupt(9) that defers
configuration after interrupts are enabled.
This will be used for devices that require firmware loaded
from the root file system by firmload(9) to complete device
initialization (getting MAC address etc).

No objection on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/18/msg008370.html
and will also fix PR kern/43125.
2010-06-25 15:10:42 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
hannken f6c438ba23 Clean up vnode lock operations:
- VOP_LOCK(vp, flags): Limit the set of allowed flags to LK_EXCLUSIVE,
   LK_SHARED and LK_NOWAIT.  LK_INTERLOCK is no longer allowed as it
   makes no sense here.

- VOP_ISLOCKED(vp): Remove the for some time unused return value
  LK_EXCLOTHER.  Mark this operation as "diagnostic only".
  Making a lock decision based on this operation is no longer allowed.

Discussed on tech-kern.
2010-06-24 07:54:46 +00:00
rmind 1840edb963 Implement high priority (XC_HIGHPRI) xcall(9) mechanism - a facility
to execute functions from software interrupt context, at SOFTINT_CLOCK.
Functions must be lightweight.  Will be used for passive serialization.

OK ad@.
2010-06-22 18:29:01 +00:00
hannken 2c090918c7 Remove the concept of recursive vnode locks by eliminating
vn_setrecurse(), vn_restorerecurse() and LK_CANRECURSE.
Welcome to 5.99.31

Discussed on tech-kern.
2010-06-18 16:29:01 +00:00
pooka 5b19556a02 Set kinfo_lwp to 0 before filling it so that if someone removes
variable assignments from here, kernel memory does not leak to
userspace.

Bug found, a little bit suprisingly, by the atf ps test which failed
due to the column width between the -o holdcnt column being too
wide due to the contents displayed being garbage.
2010-06-16 18:49:22 +00:00
hannken 9ddf309cbe When mounting a file system re-lookup and lock the directory we mount on
after the file system is setup by VFS_MOUNT().  This way recursive vnode
locks are no longer needed here and mounts on null mounts no longer fail
as described in PR #43439 (mount_null panic: lockdebug_wantlock: locking
against myself).

Based on a proposal from  and
Reviewed by: David A. Holland <dholland@netbsd.org>
2010-06-15 09:43:36 +00:00
simonb 599c2850cf KNF nit. 2010-06-13 13:43:02 +00:00
yamt d512e902b3 aio_enqueue_job: don't bother to check curjob.
- it's an undefined behaviour anyway.
- the check sometimes prevent legal reuse of userland aiocb.
  note that the userland can notice the i/o completion and reuse the aiocb
  before the aio_worker kernel thread clears curjob.
2010-06-13 04:45:50 +00:00
yamt d5dec378f9 increment p_nrlwps in lwp_create rather than letting callers do so
as it's always decremented by lwp_exit.  this fixes error recovery of
eg. aio_procinit.
2010-06-13 04:13:31 +00:00
yamt ef7d7e9667 update a comment. 2010-06-13 03:34:19 +00:00
yamt e38edea451 use NULL instead of 0 for pointers. 2010-06-13 03:32:47 +00:00
pooka 9dac69e895 Fix DIAGNOSTIC. Moral of the story: don't comment xen kernels out of the
build even if you'd like to go to sleep earlier.
2010-06-11 07:32:32 +00:00
pooka 51542301d2 lwp0 seems like an lwp instead of a process, so move bits related
to it from kern_proc.c to kern_lwp.c.  This makes kern_proc
"scheduling-clean" and more easily usable in environments with a
non-integrated scheduler (like, to take a random example, rump).
2010-06-10 20:54:53 +00:00
pooka 13ce287a55 rump stubs for _ksem* 2010-06-10 19:09:03 +00:00
pooka 36e68995ca smoke the smoke, hack the hack, *beep* the *beep*, _KERNEL_OPT the _KERNEL_POT 2010-06-10 19:06:26 +00:00
hannken 62bfdd2b21 Change layered file systems to always pass the locking VOP's down to the
leaf file system.  Remove now unused member v_vnlock from struct vnode.
Welcome to 5.99.30

Discussed on tech-kern.
2010-06-06 08:01:30 +00:00
skrll 1c518780b3 Follow the correct locking protocol when creating an LWP and the process
is stopping.

Problem found by running the gdb testsuite (gdb didn't have pthreads
support)

Thanks to rmind for help with this.
2010-06-06 07:46:17 +00:00
dholland c2fc97579a Improve previous: there were two printfs and I'd only noticed and fixed
one of them. PR 43217.
2010-06-06 06:20:16 +00:00
rmind 189974619e proc_alloc: move kdtrace_proc_ctor() out of the proc_lock. 2010-06-04 23:02:18 +00:00
njoly fe0d8c08a5 Rumpify pathconf(2)/fpathconf(2)
ok from pooka@
2010-06-04 16:32:00 +00:00
pooka d71ac89211 Report result of pool_reclaim() from pool_drain_end(). 2010-06-03 10:40:17 +00:00
pooka 41bed623f4 .. except we need to check the flag while still clinging to iLock. 2010-05-27 23:58:38 +00:00
pooka 072ab7f0ce Assert that a VI_CLEAN vnode is not succesfully vget'd. 2010-05-27 23:54:35 +00:00
pooka f0c67b0751 Feed dust to a few linkset uses and explicitly call the constructor. 2010-05-26 23:53:21 +00:00
pgoyette c77c96962b Move definition of module_load_vfs_vec from kern_module_vfs.c to
kern_module.c - keeps rump happy.

Thanks, pooka!
2010-05-24 16:37:17 +00:00
pgoyette c269eb06dd Clean up kern_module.c rev 1.66, thanks to pooka@ for review & suggestions 2010-05-24 15:34:48 +00:00
pgoyette 2c4465aaa0 Protect against attempting to load modules from the filesystem until we
have mounted the root file-system.  This allows us to load built-in and
boot-loader-provided modules much earlier during startup.
2010-05-24 03:50:25 +00:00
pooka 42da46e1d2 Don't namei while holding vnode lock. kern/43328 2010-05-21 16:48:55 +00:00
drochner 8239dc73b5 fix sigwaitinfo/sigtimedwait:
-allow NULL "info" pointer
-return signal number
2010-05-20 17:10:42 +00:00
njoly a00a76ca8d Add multiple inclusion protection to rump_syscalls.h. 2010-05-17 12:35:20 +00:00
cegger dfa8eb2f81 Move PMAP_KMPAGE to be used in pmap_kenter_pa flags argument.
'Looks good to me' gimpy@
2010-05-14 05:02:05 +00:00
haad 6b319cec0e Fix bogus KASSERT, typo and KNFize my previous patch. 2010-05-12 15:53:20 +00:00
rmind 70f6a0718b pool_{cache_}get: improve previous diagnostic by checking for panicstr,
so it wont trigger the assert while trying to dump core on crash.
2010-05-12 08:11:16 +00:00
rmind b3d53a5f95 - Sprinkle asserts to catch calls from interrupt context on IPL_NONE pools.
- Add diagnostic drain attempt.
2010-05-12 03:43:46 +00:00
rmind 6bf9a07036 execve1: move few PNBUF_PUT() outside the lock paths. 2010-05-12 03:40:38 +00:00
haad 6af3749398 Add support for kthread_join in our kernel thread implementation. This is used
by zfs but I think that it can be generaly usefull. Thread need to be created
with KTHREAD_JOINABLE flag and can be joined only once.
When joinable thread was created it will not e automatically reaped from system
and kthread_join must be called on it to reap it.

Ok by ad@.
2010-05-11 22:26:00 +00:00
pooka a96791040e remove unnecessary #ifdef 2010-05-11 20:21:56 +00:00
pooka 14d288df20 _RUMPKERNEL -> _KERNEL 2010-05-11 20:09:11 +00:00
pooka b2cb120dee This not working on ews4800mips has nothing to do with rump, so:
_RUMPKERNEL -> _MACHINE != ews4800mips
2010-05-11 20:07:40 +00:00
pooka 5fd51e5ff8 the crowd went crazy
as typo left the stage
2010-05-11 09:30:29 +00:00
christos 242fd69b63 give the name of the dup initialization. 2010-05-05 02:20:42 +00:00
kardel a2c1ee7188 switch to nanotime() for 100ns resolution 2010-05-04 19:23:56 +00:00
tsutsui 9a9555d932 Some KNF. 2010-05-04 14:14:54 +00:00
tsutsui 25362a67ff Don't #error on invalid LABELSECTOR or LABELOFFSET on __RUMPKERNEL build.
As mentioned in src/sys/rump/dev/lib/libdisk/Makefile,
rump(4) builds don't check if each ${MACHINE} actually supports
MBR in MD readdisklabel(9) ops while it pulls MD <machine/disklabel.h>.

Workarounds so long broken build of ews4800mips.
2010-05-04 12:20:50 +00:00
darran 17b7c13057 DTrace: Fix several bugs where the mod_ctf_get() function could return
success even though no CTF section was present in the kernel or module.
This fixes the panic that several people saw when trying out the FBT
provider without updating /boot or missing a CTF section in /netbsd.
2010-05-03 09:51:36 +00:00
dholland 05d90ebea1 Blanking the path buffer only needs to be done when DIAGNOSTIC.
(I meant to set it back this way before committing but evidently forgot
last night. Thanks to rmind for noticing.)
2010-05-02 23:22:51 +00:00
pooka 193bcc771a If a builtin dependency is missing, error instead of panic. As
pointed out by martin, configurations like builtin nfsserver can
be succesfully linked without including all dependencies (specifically,
nfs).  Until all such weirdosities are fixed, opt for at least a
semifunctional system.
2010-05-02 11:01:03 +00:00
dholland 30c9deb259 Don't printf a userspace pointer; print the copied-in kernel version
instead, now that it's readily available. Fixes PR 43217.
2010-05-02 06:35:21 +00:00
dholland 54f6c52ba9 Remove the nameidata from struct exec_package. It was used only for two
things: passing an argument to check_exec, which is better done explicitly,
and handing back the resolved pathname generated by namei, which we can
make an explicit slot for in struct exec_package instead. While here,
perform some related tidyup, and store the kernel-side copy of the path
to the executable as well as the pointer into userspace. (But the latter
should probably be removed in the future.)
2010-05-02 05:30:20 +00:00
dyoung b875f6ccc8 IPL_VM is the highest interrupt priority where alldevs is read/written,
and acquiring alldevs_mtx already blocks those interrupts, so delete the
splhigh()/splx() in config_alldevs_lock()/_unlock().

Release alldevs_mtx while freeing memory with kmem_free(9); according to
new documentation, kmem_free(9) can sleep! :-) Thanks to rmind@ for the
tip.

Next step: use finer-grained locking, probably by adding a mutex to
    cfdriver_t.

And after that: make sure that all threads of execution are out of the
    device_t and/or softc before releasing their memory.
2010-04-30 21:17:22 +00:00
pooka 6e3fa8db54 Add translation from vtype to dirent type. Convert rumpfs now.
I'll convert the rest of the file servers in need after the next
version bump to avoid the coding module crisis.
2010-04-30 10:03:13 +00:00
martin ffb5896ed4 Add a CTASSERT to make sure the cexp and ldavg arrays are kept in sync 2010-04-30 10:02:00 +00:00
dyoung 3f82819ca5 Add data types, function prototypes, and stub implementations
for pci_chipset_tag_create() and pci_chipset_tag_destroy().  On
architectures that support it, an MI PCI bus driver can override the
architecture's default pci(9) and pci_intr(9) implementation.

Coming up next: documentation.
After that: x86 implementation.
Last but not least: make cbb(4) use MI PCI overrides.
2010-04-28 20:33:52 +00:00
pooka 6ec71a1c75 Use sys_nomodule for modular rump system calls so that they can be
autoloaded.
2010-04-27 10:57:46 +00:00
pooka da792af712 Add an optional hook for adjusting module string table after load.
Currently to be used for rump "SAOS" namespace trick.
2010-04-26 22:58:53 +00:00
rmind 3144d8ae3f Revert rev1.6, it shall return ETIMEDOUT for pthread calls. 2010-04-26 16:26:11 +00:00
ad a0f75dc2db Allocate the cpu_infos array dynamically. 2010-04-25 15:57:59 +00:00
ad 3f21f42490 - console spam.
- atomic_dec_uint -> vfs_destroy.
2010-04-25 15:56:00 +00:00
ad 2e2855a6f2 Make select/poll work with more than 32 CPUs.
No ABI change.
2010-04-25 15:55:24 +00:00
ad caac34d32b MAXCPUS -> maxcpus 2010-04-25 11:49:22 +00:00
ad b445fb5178 MAXCPUS -> __arraycount 2010-04-25 11:49:04 +00:00
rmind 5b61593723 mq_timed{send,receive}: as required by POSIX, return EINVAL on invalid
timeout and thread would have blocked, instead of ETIMEDOUT.  Change is
to abstimeout2timo(), thus also affects _lwp_park(2).

Reported by Stathis Kamperis some months ago.
2010-04-23 19:29:23 +00:00
rmind 13f624ca0f Remove lwp_uc_pool, replace it with kmem(9), plus add some consistency.
As discussed, a while ago, with ad@.
2010-04-23 19:18:09 +00:00
rmind d8eaa1fed9 Remove M_IOV (missed in previous commit) and M_1394DATA types. 2010-04-23 19:09:15 +00:00
pooka 0c20c076ce Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation.  The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).
2010-04-23 15:38:46 +00:00
rmind d00df28408 Replace M_IOV and some malloc(9)s with kmem(9), and while there:
- Fix invalid free (M_TEMP vs M_IOV) in do_sys_recvmsg(), spotted by jakllsch@.
  Also, same fix in osf1_sys_sendmsg_xopen().
- Fix attempt to free non-allocated memory in error path in netbsd32___getfh30().
- Plug a memory leak in compat_43_netbsd32_orecvmsg().
2010-04-23 15:19:19 +00:00
pooka 33de26e6c6 dumdidumdum, need _KERNEL in previous for fsck. noticed by moof 2010-04-21 19:50:57 +00:00
pooka 34244e1069 Reduce #ifdef spew by attaching wapbl as a module.
(no, it's still too ifdef-ridden to be able to actually do anything
useful and module-like like load into any kernel)
2010-04-21 16:51:24 +00:00
pooka 593dfe42a8 make get/setrlimit as rump-capable 2010-04-21 16:17:04 +00:00
rmind f08aebed01 sched_pstats: fix previous, exclude system/softintr threads from loadavg. 2010-04-20 16:49:48 +00:00
dyoung ad6e139a80 Add default implementations for bus_space_is_equal(9),
bus_space_tag_create(9), and bus_space_tag_destroy(9).  Use
bus_space_is_equal(9) throughout the kernel to compare
bus_space_tag_t's.  Tested on i386 and on sparc64.
2010-04-19 18:24:26 +00:00
jruoho 1cbdcd8dc6 Use CTLTYPE_BOOL. 2010-04-19 11:20:56 +00:00
pooka d8c5395931 Don't loop eternal if init of a builtin module fails. 2010-04-16 11:51:23 +00:00
rmind 5f0ac9a4fa - Merge sched_pstats() and uvm_meter()/uvm_loadav(). Avoids double loop
through all LWPs and duplicate locking overhead.

- Move sched_pstats() from soft-interrupt context to process 0 main loop.
  Avoids blocking effect on real-time threads.  Mostly fixes PR/38792.

Note: it might be worth to move the loop above PRI_PGDAEMON.  Also,
sched_pstats() might be cleaned-up slightly.
2010-04-16 03:21:49 +00:00
rmind 93deacb9f4 Remove mclpool_allocator, which is unnecessary since mb_map removal. 2010-04-16 02:57:15 +00:00
pooka cc69e4568b will it include, that is the question
(to everyone's disappointment on some archs it didn't)
2010-04-15 20:46:08 +00:00
pooka 0d8b367e2d Need a few funny #defines in kern_syscall.c too. 2010-04-14 15:15:37 +00:00
pooka 64d6a27dc2 need opt_modular.h in kern_syscall 2010-04-14 15:12:44 +00:00
pooka 7ea24651a7 Move routines related to syscall establishment from kern_subr.c and
kern_stub.c to kern_syscall.c.
2010-04-14 14:46:59 +00:00
pooka 00dd646066 regen: rump vnodeif went on a diet 2010-04-14 14:00:04 +00:00
pooka fcde1e9ca0 Make rump vnode interface lightweight: the only things we
really need are:

  0) provide VOP_OP in the alternate RUMP_VOP_OP namespace

  and for each op:
  1) schedule rump cpu
  2) call VOP_OP
  3) unschedule rump cpu

While here, take the opportunity to get rid of _t lossage in the
rump-exported interfaces.
2010-04-14 13:58:51 +00:00
pooka 592f1701c5 regenefactor for comment and whitespace changes 2010-04-14 12:21:04 +00:00
pooka 7b0c00ddf9 Print "end of special cases" only where special cases end and not
a second time at the end of the file.  Adjust whitespace for the
sheer functional joy of it.

(i hope i didn't ruin someone's joke by missing a humorous implication
that all vnode operations are considered a little special)
2010-04-14 12:19:50 +00:00
pooka 794d5a7111 _KERNEL_OPT 2010-04-13 22:46:10 +00:00
pooka 2c4f731dd6 tyop 2010-04-12 23:20:18 +00:00
christos 302c1e42ae void police! 2010-04-12 23:09:28 +00:00
pooka 290fe400e0 Separate lwp specificdata data structure management from lwp cpu/vm
management.

No functional change.

(specificdata routines went from kern_lwp.c to subr_lwp_specificdata.c)
2010-04-12 22:15:31 +00:00
mrg 18d175fa3c reject attempts to write CTLTYPE_BOOL nodes with a value other than 0 or 1. 2010-04-11 01:50:25 +00:00
pooka cfff0936d1 regen: remove unused vdesc_transports 2010-04-10 19:44:02 +00:00
pooka 790df5ab8d "Not yet" since 4.4BSD is quite a lot of "not yet", so remove
vdesc_transports from vnodeop_desc until we have a "not not yet"
situation.

Ride 5.99.27 bump (full build still in progress.  i wanted to get
this in as soon as possible to most effectively ride the bump.)
2010-04-10 19:41:54 +00:00
njoly cb925a949e Make lwp_ctl_alloc() return 0 instead of EINVAL, when lwpctl user
address already exists. This allow calling _lwp_ctl(2) more than once
on the same LWP.
2010-04-09 11:47:17 +00:00
njoly 4f2ea8f3c9 Add a new clock_gettime1() function that holds most of the
clock_gettime syscall code (except for the copyout). Adjust all
corresponding syscalls to make use of it.
2010-04-08 11:51:13 +00:00
christos 2909eda13b fix build for ports that don't have PT_STEP (Havard Eidnes) 2010-04-07 13:10:46 +00:00
christos ca843a73b0 PR/43128: Paul Koning: Threads support in ptrace() is insufficient for gdb to
debug threaded live apps: Add an optional lwpid in PT_STEP and PT_CONTINUE to
indicate which lwp to operate on, and implement the glue required to make it
work.
2010-04-06 13:50:22 +00:00
he d399695a05 Follow christos' suggestions, and make ks_active a u_short, and
also only use 16 u_shorts instead of 32 ints.  Also add panic()
calls for under- and overflow of the ks_active members under
DIAGNOSTIC.  The MAXBUCKET constant ended up in sys/mallocvar.h
and not sys/param.h, as the latter caused build problems.

Ride the kernel revision bump of my previous change.
2010-04-05 08:03:41 +00:00
he bb89b7208d Extend struct malloc_type to count the number of active allocations
per size, and make vmstat report this information under the "Memory
statistics by type" display, which is only printed when the kernel
has been compiled with KMEMSTATS defined, like this:

Memory statistics by type                                Type  Kern
           Type InUse  MemUse HighUse   Limit   Requests Limit Limit Size(s)
          wapbl    15   4192K   4192K  78644K     376426     0     0 32:0,256:3,512:6,131072:1,262144:2,524288:3

Since struct malloc_type is user-visible and is changed, bump kernel
revision to 5.99.26.

While it is true that malloc(9) is in general on the path of slowly
being replaced by kmem(9) (kmem_alloc/kmem_free), there remains a
lot of points of usage of malloc/free, and this could aid in finding
any leaks.  (It helped finding the leak fixed in PR#42661.)

This was discussed with and somewhat hestitantly OKed by rmind@
2010-04-05 07:16:12 +00:00
jnemeth bc239ea58a don't leak a vnode and don't call namei (implicitly) twice 2010-04-04 17:18:04 +00:00
njoly 0876f873dd Move most clock_getres syscall code, except for coypout call, to a new
clock_getres1() function which can be used by emulations. Adjust all
clock_getres syscalls to now make of use it.
2010-04-03 17:20:05 +00:00
tsutsui 55bc1f1a41 Use time_t (not long) to save time_second value. 2010-04-02 23:31:42 +00:00
christos 8c20e0e884 fix debugging printf. 2010-04-02 14:11:18 +00:00
ad 78f9946c6b Fix copyrights. 2010-03-31 19:59:39 +00:00
pooka 242bf1c3e7 Stop exposing fifofs internals and leave only fifo_vnodeop_p visible. 2010-03-29 13:11:32 +00:00
pooka 8b70574df1 Add init/fini for components (modules etc.). These eat the standard
driver/attach/data typically present and once some locking is grown
in here, these routines can be made to fail or succeed a component
attachment/detachment atomically.
2010-03-25 19:23:18 +00:00
drochner 713b10dc38 When choosing the start address of a dynamic (ie relocatable) executable,
respect the alignment in the ELF phdr.
Also, for correctness, use the maximum alignment of the PT_LOAD
sections rather than just the first one found.
Also, use more meaningful types.
2010-03-22 22:10:10 +00:00
christos b691db097d more debugging compilation fixes. 2010-03-20 01:52:16 +00:00
christos 7fa75c35d6 fix debugging code. 2010-03-20 01:47:12 +00:00
christos 6d16572ef4 minimize ifdefs and avoid duplicated code. 2010-03-20 01:45:30 +00:00
christos 3e2a63c711 - Make maximum memory limits for various things #define constants and use the
consistently across the code.
- Re-do note parsing code to read the section headers instead of the program
  headers because the new binutils merge all the note sections in one program
  header. This fixes all the pax note parsing which has been broken for all
  binaries built with the new binutils.
- Add diagnostics to the note parsing code to detect malformed binaries.
- Allocate and free note scratch space only once, not once per note.
2010-03-19 22:08:13 +00:00
pooka 1c55854229 Print builtin "use -f" message only if not autoloading. Otherwise
it'll get spammy.

XXX: this should probably be printed iff the toplevel module is
not being autoloaded (i.e. there is a human to interpret the error).
Otherwise disabled dependencies give a misleading EPERM.
2010-03-18 18:25:45 +00:00
pooka d76b630321 Never autounload builtin modules (they will never be autoloaded if disabled). 2010-03-18 17:33:18 +00:00
christos 724aa20200 rename DEBUG_ASLR -> PAX_ASLR_DEBUG 2010-03-15 20:35:19 +00:00
darran 0ede06284a DTrace: Make the CTF handling conditional on KDTRACE_HOOKS for now since
it breaks the boot of the atari kernel (and possibly others).
2010-03-14 21:27:49 +00:00
christos 05cb23b544 call accept_filter_init int setopt so that don't use an uninitialized lock
from the setsockopt path.
2010-03-13 23:03:39 +00:00
christos e8cb686278 make this compile. 2010-03-13 16:27:06 +00:00
christos 04140a33ca make this compile. 2010-03-13 01:41:14 +00:00
darran 38c72d335c DTrace: Add support for CTF sections in the netbsd elf image, load these
at boot.
Add a ksyms_mod_foreach() function to iterate a callback function over the
set of elf symbols for a specific module (netbsd included).
Add kern_ctf.c and mod_ctf_get() to allow the retrieval and decompression
of CTF sections for a specific module.
2010-03-12 21:43:10 +00:00
pooka effc302a58 Make module_{lookup,enqueue}() static now that it's possible again
(effectively reverts my kern_module rev. 1.53 from some months ago)
2010-03-05 20:10:05 +00:00
pooka ee7bfacd73 Move builtin modules to a list in init and load them from there
instead of using linksets directly.  This has two implications:

1) It is now possible to "unload" a builtin module provided it is
   not busy.  This is useful e.g. to disable a kernel feature as
   an immediate workaround to a security problem.  To re-initialize
   the module, modload -f <name> is required.
2) It is possible to use builtin modules which were linked at
   runtime with an external linker (dlopen + rump).
2010-03-05 18:35:01 +00:00
pooka 7363f77230 Replace unsafe use of TAILQ_FOREACH: as the comment says, the
structures are pulled off the list in the loop and it's anyone's
guess where they go after that.
2010-03-03 17:58:36 +00:00
pooka 4a21cd9096 Remove fs_lfs now that the syscall is always defined. 2010-03-03 00:49:39 +00:00
yamt b1521a3612 remove redundant checks of PK_MARKER. 2010-03-03 00:47:30 +00:00