Commit Graph

1771 Commits

Author SHA1 Message Date
pooka 2750f1b5f9 make the if-else logic more obvious 2011-03-11 12:11:00 +00:00
pooka 86a95d8e4b After my change to the "interface accepts this packet" logic
yesterday the CARP test stopped working, since CARP depends on
IFF_PROMISC (which was previously always accidentally enabled).
While making the interface honor IFF_PROMISC, also make it compare
the received frame's address against ifp->if_sadl instead of a
local enaddr value we cached when the interface was created.
2011-03-11 12:10:15 +00:00
pooka a6893ed075 Don't assume rump kernel PAGE_SIZE and host page size are the same. 2011-03-11 09:25:59 +00:00
wiz fd1ad431e8 When panicing, at least tell the _real_ reason. 2011-03-10 22:11:05 +00:00
pooka cd97edf46b autocreate /dev/zfs. requested by riz 2011-03-10 19:24:37 +00:00
pooka 8fa2364979 Support bpf. shmif_dumpbus(1) can be used for much the same effect,
but sometimes it's just more convenient to run tcpdump live.
2011-03-10 13:27:03 +00:00
pooka d377d1cc83 Pass packet up if it's *for* us, not if it's from someone else.
This fixes a rather curious forwarding/redirect/etc. storm which
happened when there were >2 shmif kernels on the same shmbus with
ip forwarding set on. (at least it stress-tested other code ;)
2011-03-10 13:20:54 +00:00
pooka df23472915 track lockdebug data even in the special path 2011-03-09 23:41:24 +00:00
pooka 49bc93eb11 Mark cv_wait mutex as locked before doing any further dances.
Fixes a LOCKDEBUG panic in case the uncommon condition is hit.
2011-03-09 18:15:39 +00:00
pooka d469e02a3b Create cgd block device files in the right directory.
hi pooka!
2011-03-09 11:56:17 +00:00
pooka 08f26b12e5 Duh, the nfsd hacks in tests still used RUMP_SYS_NETWORKING. It
appears that using nxr to search for users wasn't a very good idea.
Put networking back and make the test of the defines give out
#errors.

me be fixink this
2011-03-09 10:10:19 +00:00
pooka 53b769ebd0 g/c old-style syscall selection method 2011-03-08 18:35:10 +00:00
pooka ffad644563 regen: include rumpclient syscall headers from source tree instead of host 2011-03-08 18:31:11 +00:00
pooka 91240244df Nuke all threads belonging to a process calling exec before allowing
the exec handshake to return.

In addition to being The Right Thing To Do, fixes some nasty
conditions for CLOEXEC fd's (or at least does so in theory, I
couldn't create any problems although I tried).
2011-03-08 12:39:28 +00:00
pooka 9d382a98c5 Fill in a functional struct lwp (especially l_mutex) before exposing
it on p_lwps.
2011-03-07 21:04:47 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
joerg 8871ccf0f3 Fix spelling of MKZFS 2011-03-05 03:15:25 +00:00
pooka 67365afb80 We track page modified info with PG_CLEAN, so make clear_modify
return false.  This makes rump lfs unmount work on platforms which
use the pmap stub (i.e. non-x86, which already returned false here).
Otherwise, lfs would hang itself trying to flush some buffers but
couldn't fill a segment and therefore wouldn't actually write
anything.
2011-03-02 13:11:52 +00:00
pooka da0742f9b8 Reset node's parent pointer when it's removed. Technically the
parent still exists, but allows us to avoid complicated g/c algorithms
if the parent *is* removed.
2011-03-01 15:14:35 +00:00
pooka 405dec72d6 Pass accurate protection info from ubc_uiomove() to the pager.
Fixes nfs{,ro}_fileio tests on at least sparc64 (and probably macppc
and other fat endian machines).

The problem was that nfs was fooled to thinking read() caused a
write fault because of VM_PROT_WRITE being unconditionally set and
therefore set NMODIFIED on a r/o file system.  It is absolutely
beyond me why the test worked on i386/amd64.  Incidentally, I seem
to have "misplaced" a few goats.
2011-03-01 10:02:11 +00:00
pooka 9bd36d4186 tmpfs has two layers of uvm objects (vnode->uobj and the anon object
in tmpfs_node), so when playing with pages make sure we lock the
uvm object the pages belong to instead of the vnode's uvm object.

per test from Nicolas Joly (which I'm sure he will commit soon ;)
2011-02-27 13:37:39 +00:00
riz 7559b861a8 Use AUDIO_DEVICE instead of 0 as the minor number for /dev/audio since
0 is incorrect. While I'm here, add /dev/sound, audioctl, and mixer too.

ok pooka@
2011-02-25 19:27:05 +00:00
pooka 4d59265f95 Don't autogenerate a large number of unnecessary device nodes, just
slows bootstrap.
2011-02-25 18:56:20 +00:00
pooka db3f366798 Shuffle the pagedaemon algorithm a bit to record the number of
pageouts active and give up only if the pagedaemon could not free
memory and there are no outstanding pageouts.

This should fix the "out of memory" pauses reported by Mihai Chelaru
and Taylor R Campbell.  Tested by copying files to and from an ffs
backed by /dev/wd0 (with and without -o log) using a 1MB rump kernel
memory limit.
2011-02-22 20:17:37 +00:00
pooka 30a736a57d complete the incomplete pagesize rototill 2011-02-22 18:43:20 +00:00
pooka bfe95d83e2 omstart 2011-02-22 14:09:35 +00:00
pooka b4a00f1f22 regenagain: make returning off_t work (without breaking other return
types on some archs)
2011-02-22 14:06:29 +00:00
pooka 65fa004526 unregen 2011-02-22 13:05:07 +00:00
pooka 6578cf43da regen: cast rval to return type instead of just using rval[0] 2011-02-22 10:34:06 +00:00
pooka 686a05ebe4 regen: NOERR syscalls 2011-02-21 23:31:00 +00:00
pooka 5c02795ed4 regen: preadv/pwritev 2011-02-21 12:49:49 +00:00
pooka 2e56e2896f regen: always explicitly set errno (fixes some apps) 2011-02-21 11:33:36 +00:00
pooka a21e393066 commit regen for int -> pid_t fix 2011-02-21 11:32:26 +00:00
pooka dd69b8ebde Change the default sigmodel to "raise", it makes more sense than
causing a panic.
2011-02-20 13:09:57 +00:00
pooka 9b097994c2 Support FD_CLOEXEC in rump kernels. 2011-02-15 15:54:28 +00:00
pooka abcc13e159 Add an "exec" callback for the proxy code. The client can now
notify the rump kernel of an exec having taken place.
2011-02-15 10:35:05 +00:00
pooka 22c822c7f3 Make vmapbuf() return success/error and make physio deal with a
failure.
2011-02-10 14:46:44 +00:00
pooka fcae73ef09 Set b_error in vunmapbuf() if copyout_proc fails.
XXX: what if copyin fails in vmapbuf()?
2011-02-10 13:49:10 +00:00
pooka 1745060603 Explicitly zerofill some fields which are not within the boundaries
of p_start/endzero for whatever reasons.

Obviously, this fixes remote physio when running with MALLOC_OPTIONS J.
Otherwise PS_WEXIT is set in struct proc, proc_vmspace_getref() fails,
and copyout_proc() with it.

Reported by njoly
2011-02-10 13:40:35 +00:00
pooka 75b9ae3d27 zalloc struct vmspace to avoid having one full of garbage 2011-02-10 13:31:55 +00:00
pooka 651058f246 copy parent's p_comm when forking (if it exists) 2011-02-10 13:31:30 +00:00
pooka 922afc1884 support /dev/zero 2011-02-10 11:01:31 +00:00
pooka cb10f2594b Make it possible to specify a minor number for an autogenerated device node. 2011-02-10 11:00:45 +00:00
pooka d1c32169fe Use correct strtoululululu variant.
from Taylor R Campbell
2011-02-05 17:25:45 +00:00
pooka 8f6aa33e32 attach the compat_50_routedomain to make it actually work 2011-02-04 09:57:53 +00:00
pooka ff4f0c61df fix KASSERT snafu. spotted by tests, as usual. 2011-02-03 22:16:11 +00:00
pooka 1e892b4a1f * open backend device once when the rumpblk is registered instead of
every time the virtual device is opened.  this takes care of e.g.
  a midlife chmod crisis
* when mapping initial windows, consistently look at host size and
  host offset.  otherwise we might end up in a situation with 0
  initial windows mapped, and that will cause a crash later.
2011-02-03 15:36:30 +00:00
pooka 4dfafdead2 weakalias the "withsize" variant of rump_pub_etfs_register too 2011-02-03 11:01:51 +00:00
pooka 2f1c12f11d * fix blkno->offset calculation for simulated non-512 devices
* allows transfers only in multiples of block size
* g/c unused struct member
2011-02-03 10:06:06 +00:00
pooka 1b5df295f3 Allow etfs for CREATE lookups too. This takes care of O_CREAT calls
to open(), which act just like lookups if the node exists (found
from etfs).  If the node doesn't exist in etfs, nothing changes
from the previous situation.
2011-02-02 15:58:09 +00:00
pooka 9cf08a1e73 never open rumpblk backend with O_TRUNC
XXX: the rumpuser_open interface needs a beating
2011-02-02 15:55:22 +00:00
pooka d368e9df29 adjust inode size too if VOP_SETATTR changes size 2011-02-02 14:41:55 +00:00
pooka 047dbb35d9 regen for O_DIRECTORY 2011-02-01 21:21:34 +00:00
pooka 896d209af1 update todo from my private collection (which is now empty) 2011-02-01 15:26:46 +00:00
matt 4d5d6d9aa5 Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.
2011-02-01 01:39:19 +00:00
matt 658d254929 Define COMPAT_50 to be 1 just like config(8) would be opt_compat_netbsd.h 2011-02-01 01:15:51 +00:00
christos df0e963b6e enable this for amd64 too. 2011-01-31 00:10:06 +00:00
bouyer 21b1dbeb44 Move rumpuser_sp_fini() after the kernel has completed shuwdown
(and especially, after filesystems have been unmounted).
This way, rump.halt returns once the rump kernel is really out of the
game, which avoids races issues in test scripts using a rump kernel.
OK pooka@
2011-01-30 16:31:42 +00:00
pooka dac4423feb Pass the value of getprogname() from the client to the server and
record it in p_comm.  This is nice for things like sockstat, since
they now display the client command name:

pain-rustique:43:~> rump.sockstat
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     xulrunner- 16     0 tcp    192.168.2.114.65507   204.152.190.12.80
root     xulrunner- 16     1 tcp    192.168.2.114.65501   204.152.190.12.80
root     xulrunner- 16     2 tcp    192.168.2.114.65500   204.152.190.12.80
root     xulrunner- 16     3 tcp    192.168.2.114.65499   204.152.190.12.80
root     xulrunner- 16     5 tcp    192.168.2.114.65498   204.152.190.12.80
root     xulrunner- 16     6 tcp    192.168.2.114.65497   204.152.190.12.80
root     socket     62     0 tcp6   *.http                *.*
root     socket     62     1 tcp    *.http                *.*
root     socket     63     0 tcp6   *.81                  *.*
root     socket     63     1 tcp    *.81                  *.*
2011-01-28 19:21:28 +00:00
pooka 464ac5f9d7 Don't NULL out l_cpu, l_stat is the new rumpkernel way too. 2011-01-28 18:48:21 +00:00
pooka cedf6bdaf9 call procinit_sysctl to register the proc sysctl tree 2011-01-28 18:45:52 +00:00
pooka 0199e732f8 these days make sure we have an lwp lock (for lwp walker smiths) 2011-01-28 17:57:03 +00:00
pooka 840bf0206b If we are "unsleepable" due to a dying proc, yield() instead of
returning directly.  This allows other threads to run possible
setting a condition we are waiting on.

Fixes a busyloop condition which could be entered from vfs_unmountall()
where we were waiting for vrele_pending and the vrele thread could
not run since we were hogging the CPU.
2011-01-28 17:04:39 +00:00
pooka 96de0bb9fe Some lwp-walkers expect the correct value for l_stat, so use a flag
in l_flag instead of l_stat for the purpose of flagging lwps in a
dying proc.
2011-01-28 16:58:27 +00:00
pooka 99a6acb4bd fill in a default name for p_comm 2011-01-28 16:34:31 +00:00
pooka e5a2e2b285 Fill in l_wmesg since some proc-walkers assume it. 2011-01-27 21:55:25 +00:00
pooka 44d370c291 Fix syscall name for compat syscalls. Arguably makesyscalls.sh
should generate the right info, but it's easier to fix here now.

This fixes compat syscalls for rump servers with dynamically loaded
components.  Since the compat syscall revamp a little time ago e.g.
stat() didn't work on my system (which is 5.0-based) with e.g.
rump_server -lrumpvfs.  Static servers and non-compat syscalls
worked just fine, though, making this a little harder to spot that
the usual bug.
2011-01-27 17:36:27 +00:00
pooka 5c349f05f1 inverse inversely incorrect comment 2011-01-22 18:33:25 +00:00
pooka 1d9f8678bd In case sys_reboot() was called by a remote client, put the response
in the socket before we shut down.  This way the response to the
syscall travels to the caller and they know things worked correctly
instead of having to just assume.
2011-01-22 13:41:22 +00:00
pooka 0feb91da5d Add a comment explaning why uvm_reclaim_hook is not currently
necessary for rump.

XXX: strictly speaking, the zfs implementation does not work
correctly since it just wakes up a thread instead of performing
the scan in the context of the pagedaemon
2011-01-22 13:13:46 +00:00
pooka 8df353fe72 no longer used 2011-01-21 13:11:32 +00:00
pooka 0ec2770c3c Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...
2011-01-21 13:11:03 +00:00
pooka a230f6e23f don't perform tasks already done by zfs_modcmd 2011-01-21 12:23:29 +00:00
haad 61583090b2 Add support for compiling ZFS and Solaris modules as RUMP libraries. Add
some locking and rumpcopy primitives and refactor module building Makefiles
to work with both RUMP and kernel modules. This is first part of adding
support for regular test of zfs on NetBSD to hunt some bugs and make it
stable.

Ok by pooka@.
2011-01-18 22:21:22 +00:00
pooka 887a2b78c7 regen: more compat syscalls 2011-01-17 18:25:17 +00:00
pooka 111bbbce9e Missed pselect50 in previous (file was open in editor ... d0h).
Add mknod50 and fhstat50 too.
2011-01-17 18:24:17 +00:00
pooka 0e4497a140 use newstyle rump syscall compat 2011-01-17 16:25:39 +00:00
pooka 4b0482d05f regen: rework rump syscall stubs (see makesyscalls.sh log for details) 2011-01-17 16:24:04 +00:00
pooka 46b3b0f6ce use compat code from sys/compat/common 2011-01-17 16:20:20 +00:00
pooka cf864401d0 Support SIGMODEL_RAISE for non-local clients. 2011-01-14 13:11:08 +00:00
pooka bb583c67a3 Release etfs node's backing vnode before freeing the etfs node.
spotted from the LOCKDEBUG run that martin accidentally did
2011-01-14 11:07:42 +00:00
pooka a4d5652afb Introduce RUMP_LOCALPROC_P() macro and use it. 2011-01-13 15:38:29 +00:00
pooka 81d086b2f7 Respect DOWHITEOUT when removing a directory. 2011-01-13 10:26:47 +00:00
pooka bf67d44461 support MNT_RDONLY 2011-01-13 07:27:35 +00:00
pooka 5f240a5279 unionfs voodoo 2011-01-12 21:08:55 +00:00
pooka 0312c5cee5 Explicitly set *vpp to NULL in lookup. At least reluckup gets
upset if we don't explicitly nullify vpp in the error case.
2011-01-12 19:31:39 +00:00
pooka 0f41405209 reject r/o mount attempts 2011-01-12 17:20:54 +00:00
pooka 8c4600a2ed Mark rootfs r/w. Thanks to the incredible machine known as vfs,
the only one who noticed the inconsistency of writing to a r/o fs
was unionfs.
2011-01-12 17:14:34 +00:00
pooka 6f53b4a35d make this happy to compile standalone 2011-01-12 16:12:30 +00:00
pooka 2bd6ac2300 add spop_procexit 2011-01-12 12:51:47 +00:00
pooka b0bfbf33ac When the client and the rump kernel are the same host process, all
threads blocking in the kernel automatically exit when the process
exists.  However, for the sysproxy case this does not hold.
Typically it's ~harmless, but e.g. in the case of socket binding
following by poll it gets annoying.

Introduce sysproxy procexit, which wakes up all threads blocking
on a condition when a process's communication socket is closed.
The code is a little different from the regular kernel simply
because in a rump kernel l_mutex is not available at all times
(this is because scheduling happens on every kernel entry and exit,
and that path must be kept lockless for any reasonable performance).
Instead, use gating which makes sure all threads are either out of
the cv code or suspended in a well-known state.  Then, wake up the
threads and tell them to get the hell out of our galaxy.
2011-01-12 12:51:21 +00:00
kefren 6469d79cd6 add advlock to rumpfs, ok pooka@ 2011-01-11 14:05:32 +00:00
pooka 0de1b73a11 KASSERT we don't return back to userspace with the kernel lock held. 2011-01-11 10:49:20 +00:00
pooka a05de63f6b Ensure that a) loopback attaches after all the domains have attached
b) loopback is configured only after it has attached.

makes tests/net/if_loop work again
2011-01-11 09:24:05 +00:00
pooka 68ede6388b Add one more component level to networking: IFCFG.
It is executed after IF and the purposes to guarantee the right
order in cross-component interface address configuration.
(e.g. lo0 is attached by net but 127.0.0.1 is configured by netinet)
2011-01-11 09:22:32 +00:00
christos fb4e945aa5 regen 2011-01-10 04:42:24 +00:00
pooka 574a31f2de Shortcircuit remote 0-len copyin/out already in the kernel. 2011-01-09 14:12:37 +00:00
pooka 35e989d694 accept '\0' as a valid string 2011-01-09 13:49:57 +00:00
pooka 9a17e75e0e Autoconfigure 127.0.0.1 for lo0.
(testing bind/connect/etc. is now possible on a virgin rump kernel
without the need to ifconfig anything)
2011-01-09 12:22:34 +00:00
pooka 284c651488 Separate interface init and domain adding. 2011-01-09 12:20:53 +00:00