Commit Graph

814 Commits

Author SHA1 Message Date
pooka 9dbaa03ccb Implement RUMP_ETFS_REG. Usable e.g. by firmload(9).
(well, it should probably be RUMP_ETFS_PATH, but simple things first)
2009-10-04 16:31:08 +00:00
pooka 8ec501e110 Include firmload. Although it may be used by devices, it's pure
vfs in nature, and therefore it belongs here (can't load a firmware
from a file system without file system support, right?).  Rename
rump_cwdi to cwdi0, since firmload depends on that name (naughty
firmload).
2009-10-04 13:29:36 +00:00
pooka a346a8ca77 Initialize suckets before domains since some domains install timers
which take softnet_lock and might run before the lock is actually
initialized.  Also, soinit() itself already calls soinit2(), so no
need to call it twice.
2009-10-04 13:24:58 +00:00
christos c9bb67bb7b Need proc_uidmatch 2009-10-03 22:55:48 +00:00
pooka cbdc6e568f pass unit number in mainbus attach args 2009-10-03 19:06:35 +00:00
elad 53ca19a3b3 First part of secmodel cleanup and other misc. changes:
- Separate the suser part of the bsd44 secmodel into its own secmodel
    and directory, pending even more cleanups. For revision history
    purposes, the original location of the files was

        src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
        src/sys/secmodel/bsd44/suser.h

  - Add a man-page for secmodel_suser(9) and update the one for
    secmodel_bsd44(9).

  - Add a "secmodel" module class and use it. Userland program and
    documentation updated.

  - Manage secmodel count (nsecmodels) through the module framework.
    This eliminates the need for secmodel_{,de}register() calls in
    secmodel code.

  - Prepare for secmodel modularization by adding relevant module bits.
    The secmodels don't allow auto unload. The bsd44 secmodel depends
    on the suser and securelevel secmodels. The overlay secmodel depends
    on the bsd44 secmodel. As the module class is only cosmetic, and to
    prevent ambiguity, the bsd44 and overlay secmodels are prefixed with
    "secmodel_".

  - Adapt the overlay secmodel to recent changes (mainly vnode scope).

  - Stop using link-sets for the sysctl node(s) creation.

  - Keep sysctl variables under nodes of their relevant secmodels. In
    other words, don't create duplicates for the suser/securelevel
    secmodels under the bsd44 secmodel, as the latter is merely used
    for "grouping".

  - For the suser and securelevel secmodels, "advertise presence" in
    relevant sysctl nodes (sysctl.security.models.{suser,securelevel}).

  - Get rid of the LKM preprocessor stuff.

  - As secmodels are now modules, there's no need for an explicit call
    to secmodel_start(); it's handled by the module framework. That
    said, the module framework was adjusted to properly load secmodels
    early during system startup.

  - Adapt rump to changes: Instead of using empty stubs for securelevel,
    simply use the suser secmodel. Also replace secmodel_start() with a
    call to secmodel_suser_start().

  - 5.99.20.

Testing was done on i386 ("release" build). Spearated module_init()
changes were tested on sparc and sparc64 as well by martin@ (thanks!).

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/09/25/msg006135.html
2009-10-02 18:50:12 +00:00
pooka 93992109b3 Include humanize and extent support in rumpkern. 2009-10-02 15:51:26 +00:00
pooka 9b32227de9 Hold on to your giantlocks while calling device autoconfusion. 2009-10-02 11:01:53 +00:00
pooka fb39ec98d5 panic if cv_wait() is called in non-threaded mode 2009-10-02 09:56:08 +00:00
pooka 73ad6a8b6e add a new init-related calls 2009-10-01 21:43:29 +00:00
pooka 5ef3483b17 children of mainbus, attach (well, one child, iff it happens to be around) 2009-10-01 15:21:38 +00:00
pooka 8de13bd4c6 regen: remove VNODE_LOCKDEBUG 2009-09-29 11:54:52 +00:00
pooka ca97c3aebc Load modules from all components which are linked into a rump binary
with -lrumpcomponent.  Previously only the first library component
containing a module would get loaded automatically.
2009-09-24 21:30:42 +00:00
pooka dedb61e364 remove a no longer necessary hack 2009-09-24 21:00:09 +00:00
pooka 9b040bc3a9 Split config_init() into config_init() and config_init_mi() to help
platforms which want to call config_init() very early in the boot.
2009-09-21 12:14:46 +00:00
pooka eeb94c804f attach mainbus 2009-09-20 23:16:09 +00:00
pooka dfd2ba19ba default to AB_SILENT 2009-09-20 23:02:31 +00:00
pooka 64d32972db arrr, implement softint_disestablish(). this code be needin' an enema, matey. 2009-09-19 14:18:01 +00:00
pooka 159d9b46b8 vax macro magic requires Sysmap (untested).
XXX: I should add the blanket userspace pmap back for vax, its
pmap.h just has too many inlines and macros for this to ever work.
2009-09-18 18:31:53 +00:00
pooka 11281f01a0 Replace a large number of link set based sysctl node creations with
calls from subsystem constructors.  Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL
2009-09-16 15:23:04 +00:00
pooka 4b1eb92699 include init_sysctl_base.c 2009-09-16 15:10:23 +00:00
pooka 66f04a7703 create interfaces only after ifnef is initialized 2009-09-16 13:30:41 +00:00
degroote 2d48ac808c Import pfsync support from OpenBSD 4.2
Pfsync interface exposes change in the pf(4) over a pseudo-interface, and can
be used to synchronise different pf.

This work was part of my 2009 GSoC

No objection on tech-net@
2009-09-14 10:36:48 +00:00
pooka 48b3a6f7a3 binutils 2.19 has changed the old behaviour of defining __start_SECTNAME
for orphaned sections to using PROVIDE.  What this means is that
unless a rump component internally references that symbol, it will
not be included in the component shared library, and hence cannot
be referenced when the component is loaded.  Add a workaround which
works both with 2.16 and 2.19: force a reference to the __start
symbol internally and hence retain it in the resulting library.
2009-09-13 22:51:41 +00:00
pooka f27984527b call prop_kern_init() 2009-09-13 19:09:13 +00:00
pooka a06e4d63b8 remove pool link set attach code 2009-09-13 19:07:18 +00:00
pooka 9367779abf initialize rnd if present 2009-09-08 20:15:51 +00:00
pooka 3939408d61 Add a few weak symbols for places where the kernel module boundaries
are not as perfect as theory.
2009-09-08 20:10:44 +00:00
pooka 795229a9f5 Use PTHREAD_MUTEX_ERRORCHECK. This enables rump deadlock detection
once again:
panic: rumpuser fatal failure 11 (Resource deadlock avoided)
2009-09-08 20:04:03 +00:00
pooka 23503a9bee provide pmf stubs 2009-09-07 20:56:04 +00:00
pooka 4b28bbe377 Run rump_dev_init() where available. 2009-09-06 20:54:19 +00:00
pooka 129104a3ac Rename rump_dev_makenodes() to rump_vfs_makedevnodes() -- while it
will most likely be used devices, the implementation requires
services provided by vfs (mkdir, mknod).
2009-09-06 20:42:25 +00:00
pooka cec76b1282 add a very simple version of pollsock()
XXX: it seems to exist purely for the pleasure of netsmb??
2009-09-06 20:02:49 +00:00
pooka 880deff995 move hppa cpp kludge to the end of the file 2009-09-06 19:14:54 +00:00
pooka 6694ae0257 zalloc new rumpfs nodes to make sure rn_vp is initially NULL.
Fixes problem pointed out by Nicolas Joly in private email.
2009-09-05 11:02:49 +00:00
pooka f42da03906 add a few global symbols required by kernel code 2009-09-04 17:15:21 +00:00
pooka c39c71d23c brace policy. no functional change. 2009-09-04 16:42:19 +00:00
pooka 77c3d9700d Actually, we cannot release the megalock before we take sleepermtx,
since that opens a race window for non-mpsafe code, so do it after.
Additionally, we cannot call mutex_enter() for sleepermtx, since
ltsleep/mtsleep should not block (i.e. release kernel lock) before
actually blocking, so busyloop in mutex_tryenter().  Finally, when
waking up, take kernel lock back only *after* releasing sleepermtx
to avoid deadlock against another thread holding the kernel lock
and wanting sleepermtx.
2009-09-04 16:41:39 +00:00
pooka 3f664c0a97 * wrap tsleep functions to drop die grosslock since we're going to
sleep anyway in a few flicks from the clock
* broadcast instead of signal in wakeup()
2009-09-04 13:58:57 +00:00
pooka adc720a745 allocate p_lock for virtual processes 2009-09-04 12:27:09 +00:00
pooka 208d98b320 add netsmb rump component
(yes, it's functionally a device instead of a networking domain,
since it provides and is accessed through /dev/nsmb instead of
being accessed through sockets)
2009-09-04 12:20:42 +00:00
he e6203cd52f Both amiga and atari needs <sys/lwp.h> explicitly included in order
for curlwp to be properly declared.
2009-09-04 08:57:00 +00:00
pooka de4fa6c51a Build & install rumpdev, a device component for rump. It currently
supports autoconf and is required for example by pseudo-device rump
components.
2009-09-03 15:35:58 +00:00
pooka a6ea870a1c descend into librumpcrypto for a local build 2009-09-03 12:35:19 +00:00
pooka 87afe0b831 add rumpuser_net_setsockopt() 2009-09-02 19:02:51 +00:00
pooka c597708331 add address space specifiers to do_sys_mk{dir,nod} calls 2009-09-02 16:55:07 +00:00
skrll 719e2eddb4 s/int/u_int/ for flags in pmap_enter and deal with this in rump.
Hi cegger.
2009-08-16 14:06:36 +00:00
skrll 4519d76c61 KNF 2009-08-16 14:02:08 +00:00
martin 1d37d9399f Use __sparc_v9__ instead of __sparc64__ - this hack is due to arch dependend
pmap peculiarities, and does not cover sparc64 code when compiled
with -m32.
2009-08-10 12:04:17 +00:00
skrll 364eb45f71 Fix vax.
Built by default options really should be tested better.
2009-08-09 09:22:16 +00:00
pooka 2a112e499e arm32 (but not arm26) wants to be different and #define pmap_remove()
as pmap_do_remove().  Compensate.
2009-08-08 00:46:56 +00:00
pooka 0ebb0c6cda Move genfs_io.c from rump SRCS to genfs SRCS.
Aesthetic commit, no functional change.
2009-08-07 18:52:56 +00:00
pooka 75f7f90d47 Switch rump from the handwritten vnode pager to the standard kernel
vnode pager.

It would have been nice to keep a separate version:
 * it has helped find file system bugs which the kernel pager
   treated as non-errors
 * it does not contain extra payload unnecessary in userspace

However, getting the details of the pager implementation correct
with all the flags, offsets and block/page size special cases is
*EXTREMELY* difficult (chuq > god).

On the plus side, LFS write now works for file data too instead of
just metadata.  Also, maybe being able to singlestep the genfs
vnode pager in the comfort of userspace will allow more people to
understand how the behemoth functions.
2009-08-06 12:07:56 +00:00
pooka 7f2a28a489 Add suicidal stubs for pmap_enter() and pmap_remove(). Hopefully
the MD bits for all the glorious archs went right.
2009-08-06 11:50:19 +00:00
pooka a19ded3606 g/c uvm_aio_biodone1(). not used anymore. 2009-08-05 14:11:57 +00:00
pooka 095aaa3428 Clear PG_PAGEOUT in uvm_aio_aiodone() 2009-08-05 14:05:22 +00:00
pooka b2ae25b4cd Use uvm_vnode.c instead of homerolled stuff. 2009-08-05 00:04:08 +00:00
pooka b46117f3cd * support uvm_pagermapin/out(), adapt uvm_pageratop()
Instead of doing actual page remapping, which we can't portably
  do in userspace without extensive trickery (read: signals), simply
  allocate the kva window with new physical backing, copy page
  contents, return, and copy contents back in mapout.  Since the
  pages are locked during the mapping cycle, we can do this without
  hazard.

* add lots of stubbies necessary for new stuff coming soon
2009-08-04 23:58:29 +00:00
pooka c8c1730cc4 terminate comment too 2009-08-04 20:01:06 +00:00
pooka 16de900c99 * supply pager flags in ubc_uiomove()
* implement uvm_aio_aiodone() (which is almost identical to the "real" one)
2009-08-04 19:54:16 +00:00
pooka 3ec4aae3c4 Do std vnode locking for specnodes located on rumpfs. 2009-08-04 12:40:42 +00:00
pooka fd3da5f6fe g/c cachepgmtx, i have no idea what it was supposed to be useful for. 2009-08-03 23:32:06 +00:00
pooka e9eda42d2c track number of pages associated with vm object 2009-08-03 17:10:51 +00:00
pooka 43ccc52f24 Support read/write in rumpblk via physio() 2009-08-03 16:22:00 +00:00
pooka eddab4e9bc * get rid of the old fakeblk registration interface. Instead,
introduce a new and improved "etfs" interface, which can be used
  to register host files accessible from rump fs namespace.  This
  new interface is not restriced to block devices, and neither does
  it require the same pathname in host namespace and rump namespace.
  Therefore, the same host file can be represented both as a char
  and block device in rump namespace.

* adjust rumpblk to make the above possible

* improve rumpfs: nodes are now created properly and not implicitly
  tied to the vnode lifecycle
2009-08-03 14:23:30 +00:00
pooka 35e55460ba Since rumpfs can now be used from publically exported routines,
convert unsupported checking KASSERTs to return EOPNOTSUPP.
2009-07-22 21:06:56 +00:00
pooka 22d6f86dee regen: fh syscalls 2009-07-21 23:59:19 +00:00
pooka dd081aad70 the consumers expect the aiodone workqueue to be mpsafe. make it so. 2009-07-21 00:33:28 +00:00
pooka 28631b61bf device subroutines and autoconfig support for rump. work in progress. 2009-07-20 18:04:13 +00:00
pooka d0095f0917 add crypto support for rump 2009-07-20 18:03:26 +00:00
pooka fd1eba5f43 realloc works much better if it actually uses realloc instead of malloc 2009-07-20 17:12:43 +00:00
apb 559e6ded07 Mark rumpuser_thread_exit() as __dead, to match its prototype.
Part of PR 41255 from Kurt Lidl.
2009-07-14 21:00:53 +00:00
pooka bbd95bc6d9 add reference 2009-06-30 15:28:01 +00:00
dholland 9b5247fa1c Another namei_simple like the previous ones; was added after I did the
initial sweep and I guess I missed it while merging.
2009-06-29 07:11:06 +00:00
pooka ab415fb3d5 MAXUSERS comes from Makefile.rump 2009-06-10 20:54:55 +00:00
pooka f4b516bb14 libkern is fully included in rumpkern, no need for cherry-picking
modules elsewhere.
2009-06-10 20:50:51 +00:00
pooka 98c3c6a157 indicate function of previous in comment 2009-06-10 18:36:33 +00:00
pooka 1c083dc02b Add rumpuser_dprintf(), which can be used as a "safe" debug print
routine -- the kernel printf does a lot of crud which is not always
nice and dandy especially when debugging locks.
2009-06-10 18:34:49 +00:00
pooka 3178a63559 Support VOP_MKNOD. This is so that components which need device
nodes (e.g. raidframe) can create them.
2009-06-10 12:12:23 +00:00
he 4ffd944fac Add a dummy uvm_readahead() function, to fix build issues after it
recently got added to the kernel.
OK'ed by pooka@
2009-06-10 11:41:43 +00:00
pooka ed545b8d69 check that interlock isn't null before releasing it 2009-06-09 23:26:19 +00:00
pooka 698910a47a simplelocks have been supported in rump for a while, allow their use. 2009-06-09 15:53:05 +00:00
pooka 162fa5811a Nuke some bss stuff which is coming from vfs_bio via rumpvfs. 2009-06-09 14:30:06 +00:00
pooka 99616de8dc Put some spunk into deadfs. 2009-06-09 14:20:42 +00:00
pooka 13c5258c1a pool_prime emulation 2009-06-03 16:07:21 +00:00
pooka 8f814de2c0 Add user vmspace locking and remapping routines. Obviously, these
currently work only if the vmspace is local to the rump kernel.
2009-06-03 16:06:10 +00:00
pooka 2c5f264f9b implement wakeup_one 2009-06-03 15:16:42 +00:00
pooka ca254ab879 include syscalls.c 2009-06-02 23:28:53 +00:00
wiz 53b002f1fb Use Nx for NetBSD. 2009-05-28 09:41:05 +00:00
pooka f731c31fa4 Use a bunch of weak symbols to determine which network components
are present.  This works in userspace as opposed relying in link
sets, which fail miserably.  Later, when the networking stack
becomes modularized, we can move to a dynamic scheme like with file
systems.

Also, this change allows us to do proper autoconfig, namely attach
the loopback interface iff it is present.
2009-05-28 00:02:16 +00:00
pooka 9523c2be23 Add a dummyif, which doesn't actually traffic any cargo, but since
it has no backend it can always be attached and is therefore
convenient for testing ifconfig.
2009-05-27 23:41:20 +00:00
pooka 7d6e9ec774 Support IPv6 in rump. I'd have liked to introduce a netinet6
component, but due to ifdef happiness permeating the sources, it's
a compile decision for now, so netinet pulls in both inet and inet6.

One issue, one single issue: the loopback interface still needs to
be created for IPv6 to work.  I have patches to take care of it
automatically if the appropriate component (net) is present, but
they require a bit more testing before commit.
2009-05-26 23:43:39 +00:00
pooka 387cc577e1 Add BSDCan 2009 paper to SEE ALSO. 2009-05-24 23:13:49 +00:00
mlelstv 57f2ff1bb6 <sys/syscallargs.h> requires <sys/sched.h> to define cpuset_t. 2009-05-24 20:10:50 +00:00
pooka aeedc12a43 Add compat routines for vattr translation over time_t change. 2009-05-22 10:51:54 +00:00
pooka 659f41e70a Add handrolled stat30 compat syscalls for calling post-time_t rump
kernels from pre-time_t userlands.
2009-05-22 08:59:32 +00:00
pooka ac42a021b0 Add rump_getversion(), which returns the version of NetBSD for the
rump kernel.
2009-05-22 08:34:14 +00:00
pooka 908a0b2534 fix __KERNEL_RCSID 2009-05-22 08:26:52 +00:00
pooka e11306504d Set vnode op vector properly for block devices too. Makes mounting
a real block device work again.
2009-05-19 13:42:35 +00:00
pooka 68136aad74 regen: removal of pad arguments from the public interfaces 2009-05-15 15:52:46 +00:00
pooka cd558b6419 Add rump_set_curlwp() for context switch to an existing lwp/proc. 2009-05-07 16:04:25 +00:00
pooka 825ba1eb35 Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.
2009-05-07 16:03:24 +00:00
pooka b142e2e100 Nuke RUMPCN_HASNTBUF. The inspiration behind it must've been ... deep. 2009-05-04 14:31:25 +00:00
pooka d98497528c set MNT_ROOTFS for the rootfs (the kernel, a logical piece of work) 2009-05-03 19:00:18 +00:00
pooka e3b3da7a9e Rename rump_cred_destroy() to rump_cred_put() -- they've been
refcounted since forever now.
2009-05-03 17:09:49 +00:00
pooka 3b98424735 define DEBUGPRINT 2009-05-03 16:53:54 +00:00
pooka f24be5ee8c Add rump_vfs_getmp(), which returns struct mount for a given path.
(yes, it does not take a reference to the mountpoint)
2009-05-03 16:01:44 +00:00
pooka 6e63908b9f Since rump_module_load() doesn't actually load the module, change
the name to rump_module_init().  Also, adjust the signature to take
a direct pointer to modinfo and allow passing of props.  Finally,
provide rump_module_fini().
2009-05-02 15:20:08 +00:00
pooka fae90815de Do not include securelevel, it includes too many dependencies on
vfs in its current form.
2009-05-02 14:16:52 +00:00
pooka 6b398beab3 in case of error, return instead of continuing 2009-05-01 11:01:34 +00:00
pooka 4f521cc9ba fix editing artifact 2009-05-01 11:00:49 +00:00
pooka 90b68ff919 remove outdated comment 2009-04-30 17:43:07 +00:00
pooka 580ab7a0ba print succinctly 2009-04-30 17:41:41 +00:00
pooka d03c5f2304 Stir up the stack a bit to help arc4random() decide on a more
"random" seed.  This is a quick hack, I'll play games with rnd(9)
later (no nethack).
2009-04-30 16:59:32 +00:00
skrll c5ea9b9669 Update to deal with the new hppa pmap. 2009-04-30 15:31:16 +00:00
skrll d560aa564f +#include <sys/atomic.h> 2009-04-30 15:30:55 +00:00
pooka a22ec3808b Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host.  I wrote this a while ago and am now
committing it mainly to avoid losing it.  It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel.  Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.
2009-04-29 17:51:47 +00:00
pooka c51cd914ad Add enough support to be able to create directories and perform
lookups through them.  This has two implications:

1) mountpoints can be created directly onto the rump rootfs.
   this is benefitial in test programs where we want the same
   program to be easily switched between testing against rump and
   testing against the host kernel.
2) fakeblk must be used (it used to work implicitly) to register
   block devices that should be used from the host fs namespace.
2009-04-29 16:05:41 +00:00
pooka e479d47c73 include proc0 in allproc 2009-04-29 15:49:28 +00:00
pooka ab0d880435 Use cwdinit() for proc0's cwdi. 2009-04-29 15:49:01 +00:00
pooka fd43b78759 catch locking-against-oneself already when taking the lock 2009-04-29 14:58:50 +00:00
pooka fa938330cb Free uao lock when destroying object. Fixes tmpfs rename leak
reported by njoly.
2009-04-28 14:00:42 +00:00
pooka 8a514cd619 initialize async before use 2009-04-27 18:36:43 +00:00
pooka e5d3ecb4f1 * expand syncing logic into rumpuser, since it has more freedom on
how to do it (e.g. fsync_range)
* hash out O_DIRECT support.  it's the fastest method of safely operating
  on a file, but we can't currently autodetect support, so it's not
  enabled by default
* sprinkle more event counters
2009-04-27 14:28:58 +00:00
pooka 1a8a4475a6 avoid namespace collision. no functional change. 2009-04-26 22:26:59 +00:00
pooka e2fddf883f * set syncdelay to 0 only if we don't have a syncer thread
* add some #if0'd debug code to unmount for printing event counters
2009-04-26 21:36:24 +00:00
pooka e06cd50d97 Don't drop kernel lock twice inside same operation. 2009-04-26 21:30:43 +00:00
pooka 125fe29b5a fix uninitialized 2009-04-26 20:44:50 +00:00
pooka aab61fc839 Fix getnano/microuptime to report actual uptime. 2009-04-26 20:41:24 +00:00
pgoyette adaec344ee Catch up with recent changes to sys/proc.h (Hello, rmind!) 2009-04-26 14:37:03 +00:00
pooka 2080685e3d * init pool linksets, makes proplib work. reported by Arnaud Ysmal.
(linksets, sigh)
* reduce #ifdef for RUMP_USE_REAL_ALLOCATORS
2009-04-24 13:27:03 +00:00
pooka 6bbcb27434 If running in multithreaded mode, create sched_sync thread. 2009-04-18 16:33:37 +00:00
pooka c3582bac59 * actually do syncer list add/remove instead of just pretending to
play VI_ONWORKLST games
* honor PGO_LOCKED in getpages wrt. to interlock (no, we don't have
  a fault routine, so we don't need to seriously honor it)
2009-04-18 16:30:58 +00:00
pooka 89e8e735e6 null putpages has to unlock interlock instead of just returning success 2009-04-18 15:41:36 +00:00
pooka 6d1ff74c7a Move genfs_null_putpages() from genfs_io.c to genfs_vnops.c -- it does
not really do i/o.
2009-04-18 15:40:33 +00:00
pooka dde8f9ba46 Allow bootstrap time specification of memory window size and count. 2009-04-17 12:29:08 +00:00
pooka eff94e356c Don't bzero in rumpuser_malloc, do it in the caller iff necessary. 2009-04-17 00:39:26 +00:00
pooka 8aea5469a6 Allocate vnodes properly with getnewvnode() and support reclaim. 2009-04-16 17:50:02 +00:00
pooka daebba810f When I switched to real kauth, I forgot to include a secmodel.
Fix this oversight by including bsd44.  Makes permissions for p2k
work again.
2009-04-16 14:07:17 +00:00
pooka 15db645a13 evcnt mmio window statistics 2009-04-16 10:26:34 +00:00
pooka 291176ecc3 Make it possible to use VCHR devices again. 2009-04-07 18:35:49 +00:00
pooka 47c972421f Fix typo that slipped in a while ago. Fixes non-file mounts. 2009-04-07 18:34:18 +00:00
pooka eafbd6f42b let drivers define DPRINTF 2009-04-06 20:41:29 +00:00
pooka 3099e2e65e In case using mmio, use windowing instead of trying to map the
entire image.

Benefits:
  * the whole image does not need to fit into VA
  * a core dump is not of gargantuan proportions

Performance is pretty close to one whopping mmap.  I'll finetune
the parameters later, although the current ones seem pretty good
in initial testing.
2009-04-06 20:40:33 +00:00
pooka c675da1b5a Be less verbose. (something like rump_dmesg with optional QUIET
would be nice, but needs work)
2009-04-01 14:37:00 +00:00
christos a329e3090a we want microuptime too. 2009-03-30 12:47:49 +00:00
christos e556421085 need getnanouptime not getmicrouptime 2009-03-30 02:01:09 +00:00
christos e475692a7c one more timeval -> timespec line 2009-03-30 00:31:59 +00:00
christos 9d8b358050 Catch up with kernel changes 2009-03-29 20:59:17 +00:00
pooka 7e97c7f98e include subr_evcnt 2009-03-29 18:22:08 +00:00
pooka 46d9c48ff8 regen: new syscalls 2009-03-28 16:34:34 +00:00
pooka 02040931ba Handle eof a bit differently. E.g. ffs and msdosfs seem to have
a quite different opinion about what happens in bmap beyond EOF,
so avoid calling it.
2009-03-26 08:22:22 +00:00
pooka c2f2875913 Need to compile with -D_REENTRANT, otherwise calling putchar() can
cause libc to commit suicide (!!!).
2009-03-25 14:05:03 +00:00
pooka e99fa0f61a massage comment. no functional change. 2009-03-23 11:52:42 +00:00
pooka 932c102c8b Support async writes, can benefit mmio case. 2009-03-23 11:48:32 +00:00
pooka ddeb7494ff fix recent bug: writable images were not mapped with MAP_SHARED 2009-03-23 10:26:49 +00:00
pooka 3a6a8a145f Remove clearly incorrect constraint: can't compare range against eof if
offset != start.
2009-03-22 13:38:54 +00:00
pooka b2ba089f62 Bounds-check requests in case we are operating directly on a regular file. 2009-03-22 09:51:05 +00:00
pooka c7a778f6c1 reference to ABC2009 paper 2009-03-22 05:41:49 +00:00
pooka f733e7ab3f need atomic.h 2009-03-20 08:30:52 +00:00
pooka 18c512728c Simple syscall_establish() support.
(should use kernel sources version, but it's buried inside a
module with a lot of junk in it, so shortcut for now)
2009-03-19 09:36:38 +00:00
pooka 18c141daf8 Make it possible to mount a file system through the mount() system
call in addition to the old rump_mnt_mount().  Some issues remain
(but require more deeprooted changes):
* it is possible to mount only to /
* unmount needs MNT_FORCE due to the new fs being root and having
  a bonus reference
* cwdi is not set (since there is no concept of a process)
2009-03-19 09:14:37 +00:00
pooka 40e16b3309 regen: rump_sys_mount() 2009-03-19 09:09:36 +00:00
uebayasi 2e8ee3c0d9 Fix build on LP64. While here KNF around. 2009-03-19 03:05:14 +00:00
pooka f9b03e467a Remember to kqueue_init() too so that non-timer events work. 2009-03-18 18:00:38 +00:00
pooka 471edf2cdf Support kqueue in the rump virtual kernel. 2009-03-18 17:56:15 +00:00
pooka 9f7fb39b1d regen: kevent and kqueue 2009-03-18 17:52:19 +00:00
pooka 6a77d87235 regen: arg -> callarg 2009-03-18 17:30:25 +00:00
pooka 938ad48315 When doing I/O to a regular file, try to use mmio instead of
read/write.  This makes a rump_fs file server around 5% faster.
2009-03-18 15:39:27 +00:00
pooka f09f82998f * allow to specify PROT_READ/PROT_WRITE when mmapping a file
* add msync
2009-03-18 15:32:27 +00:00
cegger df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
pooka 0d6fd70c22 Remember to commit the rumpuser bits necessary for if_shm: mmaping
a file and waiting for writes to it.
2009-02-28 15:49:12 +00:00
pooka 9c5ad216e7 decouple rumpuser gettime from struct timeval 2009-02-27 15:15:19 +00:00
pooka 89890e45af g/c debug printf 2009-02-26 15:25:52 +00:00
pooka 197a83bc73 When using an array as a ringbuffer, need to perform modulo arithmetic
with arraysize instead of arraysize-1.  Previously there was one
inconsistency in the code.  This might fix a crash reported by apb.

Also, g/c outdated comment.
2009-02-26 15:25:11 +00:00
pooka 51e345d0a5 decouple from host struct iovec 2009-02-26 00:59:31 +00:00
pooka 8c19023a4f Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.
2009-02-26 00:32:49 +00:00
ad 59fcf21389 PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
2009-02-22 20:28:05 +00:00
pooka 69c19242f6 need sys/syscall.h 2009-02-20 18:08:12 +00:00
pooka bbcc1462b6 Add local syscall proxy as the default. 2009-02-20 17:58:22 +00:00
pooka 7d67be65d2 regen: make syscalls through a table 2009-02-20 17:57:46 +00:00
pooka 0497bce990 Default to using threads. This doesn't affect the normal release build. 2009-02-17 16:01:15 +00:00
pooka 143addadfb Use p_nlwpid to store the next lwpid location. 2009-02-12 14:46:58 +00:00
pooka d600a654c8 Explain in comment why the RNG is private (no, not the Random Nethack God) 2009-02-10 20:44:57 +00:00
pooka fa73a97f70 Introduce simple random fault injection. It is currently controlled
by setting RUMP_BLKFAIL to control the frequency and optionally
RUMP_BLKFAIL_SEED, which seeds the "random" number generator.  Feel
free to extend the code if you want something "a little more" for
your purposes.
2009-02-10 20:43:01 +00:00
pooka 38b67104c9 catchup 2009-02-08 16:18:09 +00:00
pooka 9188159bb1 Make the clock interrupt tick based on absolute time instead of
relative time.  This prevents drifting.  Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value.  This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.
2009-02-07 01:50:29 +00:00
pooka d90ea96094 wipe out last vestiges of rumpspl 2009-02-06 23:35:27 +00:00
pooka b90ea1cecf Rip out the rwlock spl emulation code. It never did anything useful
except keep my feet warm by consuming an insane amount of cpu
cycles -- in rump our current "cpu" context is never interrupted
& we have MULTIPROCESSOR.

(itch i'm scratching: it made the networking stack 10-20% slower.
this is one of the places where fast code actually matters)
2009-02-06 20:01:41 +00:00
pooka 38ebe719b0 Add weak alias stubs for a few vfs routines used by the module code -
this allows us to link programs with only rumpkern and rumpnet again.
2009-02-06 19:49:13 +00:00
pooka 248ba1c364 Call uvm_page_unbusy() instead of manually yanking PG_BUSY out. 2009-02-06 18:29:19 +00:00
pooka a1b463523d * fix a bug where we would try to lock a PG_FAKE page twice
* do not panic if VOP_STRATEGY fails.  it's someone else's problem
* return the actual number of pages we provided, not just the ones
  which contain data
* sprinkle some debug prints
2009-02-05 19:59:35 +00:00
pooka b511f1cdcf Create the clock interrupt and soft interrupt workers as MPSAFE 2009-02-04 19:40:21 +00:00
pooka cd37e181af flags|=PG_WANTED instead of flags=PG_WANTED 2009-01-31 15:13:18 +00:00
pooka b6ffbc26cf Turn of real allocators and fall back to malloc(3) for the time
being.  Since we have many threads but pretend to have only one
cpu, the pool code runs into concurrency trouble for cpu-private
data.
2009-01-30 02:30:03 +00:00
pooka ac23346377 set error if anonmmap fails 2009-01-27 10:05:08 +00:00
pooka bd401b81df Instead of dynamically allocating and freeing the rumpuser async
io descriptors, just allocate an array statically and be happy.

Fixes a problem found by Arnaud Ysmal where a descriptor would be
allocated using kmem_alloc(9) and free'd using free(3).
2009-01-27 09:14:01 +00:00
pooka 8871312c01 Init rumpspl rwlock spinlock. Otherwise pthread_spin routines just
return EINVAL and result in not protecting what they are supposed
to protect.  This results in the counter value getting corrupted
and asserts firing.

Problem reported by Arnaud Ysmal.

While debugging this, take the opportunity to remove explicit
pthread_t comparisons and put everything under pthread_equal().
2009-01-26 19:34:12 +00:00
pooka 6aa12aa856 allocate proc_lock 2009-01-26 14:41:28 +00:00
pooka 5885120155 Init pool subsystem iff RUMP_USE_REAL_ALLOCATORS is defined. 2009-01-26 14:35:50 +00:00
pooka 786ad5478f regen for new syscalls 2009-01-26 12:21:24 +00:00
pooka 29d873b4c6 Support getsockname() and getpeername() in rumpuser.
XXX: all these rumpuser_net routines passing sockaddr should use proplib.
2009-01-26 12:08:38 +00:00
pooka e97a2018f3 Add a few stubs to allow to compile - i'll have to sort these out later. 2009-01-23 21:57:35 +00:00
pooka a03214170d include rtsock_50.c 2009-01-23 19:34:37 +00:00
pooka 597631204a regen: int *error is dead. 2009-01-23 19:30:16 +00:00
pooka d9eeb41285 rumpuser_seterrno() to set errno from a rump kernel context. 2009-01-23 19:19:32 +00:00
pooka 2b5cdf6147 last-minute pasto in previous 2009-01-23 14:24:43 +00:00
pooka 2ef0a5a5d9 Add a compile-time option to use kmem/vmem/pools from the kernel
sources instead of homegrown allocators.  Default to "on", even
though they appear to be a few percent slower at least on short
jobs (e.g. untar to tmpfs).
2009-01-23 13:14:16 +00:00
pooka 9559b180f5 Support mmapping anonymous memory.
XXX: this is mainly for the benefit of correct alignment, but
MAP_ALIGNED() is not portable.
2009-01-23 12:47:32 +00:00
pooka 10adbcff42 Inform the user that threads are not available instead of just abort()ing. 2009-01-22 16:05:34 +00:00
pooka 8e9ecb1ac9 It seems profiling really really doesn't like pthreads on my system
for some reason.  Because I don't have time to descends into the
depths to figure out why, give an alternative rumpuser_pth module,
which allows to link rump completely without pthreads.  Naturally,
this means that no threads can be used, but it's enough to get
profiling done in some cases.
2009-01-20 21:43:13 +00:00
he fddc3457b2 Change the use of formally undocumented features, which have now been
made to fail.  Specifically, change
.ifdef(SYMBOL) -> .ifdef SYMBOL or .if defined(SYMBOL),
and corresponding for .ifndef.

Also correct one error in lib/libm/Makefile (.ifdef (${MKCOMPLEX} != "no")?!?).
2009-01-18 20:42:11 +00:00
pooka 72bb699a15 #ifdef __powerpc__ -> #ifdef PPC_OEA in previous. Forgot that powerpc
has 57 billion different pmaps.
(not compile-tested for a full build)
2009-01-17 15:53:15 +00:00
pooka 574c2ab1b1 Do rump kernel symbol protection for vax. All archs support it now. 2009-01-14 23:22:09 +00:00
pooka 3ddaccb7cd regen: internal prototype for rump_syscalls.c 2009-01-14 19:41:08 +00:00
pooka 36c4acf6f5 Stub out some ppc routines to allow the evbppc build to pass through here. 2009-01-14 18:17:23 +00:00
pooka e158aeee4c Regen. We now have compat __RENAME(). E.g. what was previously
rump_sys___stat50() is now rump_sys_stat() from the code.
2009-01-13 22:31:42 +00:00
pooka 678db1b18d lf_init() 2009-01-13 11:40:55 +00:00
pooka eb9379b782 include vfs_lockf.c 2009-01-13 11:37:16 +00:00
pooka 3e5a8e03e3 misc cleanup, mainly header polish 2009-01-13 02:03:13 +00:00
pooka 07334a468f Implement block I/O as a real block driver instead of a hacked copy
of specfs.  That was easier years ago when rump didn't support
devices, but brings no gain now.  This allows us to include the
real specfs in rump.
2009-01-13 01:57:35 +00:00
pooka ceca66166d * Add adapted version of the userspace atomic_cas ops for platforms
lacking special instructions.  We always use the spinlocked version
  (could use RAS on UP NetBSD host, but it's not portable).
* Add platform-based symbol quirk tables for selectively not renaming
  toolchain symbols for some platforms.  Although, this should really
  depend on the (toolchain,platform)-tuple and not just the platform.

This allows arm, hppa, mips and sh3 to build succesfully with an
isolated rump kernel namespace.  ... now, one arch remains: vax.
you must compile vax.  then, only then will you MI be.
2009-01-12 02:22:55 +00:00
pooka 0f1f70a3d7 Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).
2009-01-12 02:04:35 +00:00
pooka 9ea72e7b8a Protect against nfssilly in RUMP_THREADS=0 2009-01-11 20:41:18 +00:00
pooka b555a5deca __rump_unavailable -> rump__unavailable 2009-01-11 16:19:35 +00:00
tsutsui 427f482fda Regen to pull proper "created from" revision strings. 2009-01-11 12:22:51 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
pooka a25e3b17bc Track mutex/rwlock/condvar status. This allows us to get rid of
the pthread_np calls which will not likely exist on other platforms.
2009-01-10 22:28:42 +00:00
pooka 6520945b68 Add a handcrafted assym.h to allow hp700 to build. This file should
really be autogenerated, but seems it's generally not required by
stuff in rump and guessing the location of the appropriate genassym.cf
is difficult without a major consultation.

Thanks to Havard for spotting the build failure.
2009-01-09 01:38:35 +00:00
pooka 2a81341f7a Remove vax MD source which is now brought in automatically via libkern. 2009-01-08 19:14:37 +00:00
pooka a378ac816b Put syspuffs_glueinit in the rump kernel namespace. 2009-01-08 03:27:10 +00:00
pooka 15509962b4 Explicitly pass a pointer to the kernel lock/unlock routines in
rumpuser init instead of magically relying on the linker giving us
the symbols.
2009-01-07 22:50:08 +00:00
pooka 5fc66a37cf _rump_init() - > rump__init() 2009-01-07 21:12:30 +00:00
pooka 39c896dd00 ksyms_init() 2009-01-07 21:11:19 +00:00
pooka 12a1e5010a provide kern_realloc 2009-01-07 21:06:53 +00:00
pooka 913883b2cd more namespacing: rua -> rumpuser_aio 2009-01-07 20:34:32 +00:00
pooka 0150192ebb Remove linux compat no longer necessary now that libkern is included
in librump.  Previously we relied on the symbols being magically
satisfied by libc.
2009-01-07 20:24:12 +00:00
pooka 4465a9263d Rename _rumpuser_malloc to rumpuser__malloc so that all exported
rumpuser symbols start with "rumpuser".
(no major bumps or compat will be provided)
2009-01-07 19:49:48 +00:00
pooka 1dbafce17b Add md crud to allow libkern softfloat code to build.
And while here, make alpha use the real elf relocation code.
2009-01-06 17:04:01 +00:00
pooka 835b96d4ab adjust LD32DIR comment. per discussion with mrg 2009-01-06 01:00:57 +00:00
pooka 80508c50c5 Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.
2009-01-05 21:42:37 +00:00
pooka 6ddc756654 Assemble with _LOCORE. 2009-01-05 14:35:47 +00:00
pooka 2f633898ae g/c unused rumpuser bswap routines 2009-01-05 01:51:31 +00:00
pooka b319317906 Include libkern contents in librump. 2009-01-04 20:30:21 +00:00
pooka 055c86bdde Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
  whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.
2009-01-02 16:18:59 +00:00
pooka b55ef665bd Add kludge to allow amd64 compat to build. This is not a proper
fix which most likely requires some compat lib build infra toggle.
2009-01-02 14:03:15 +00:00
pooka 624b664af1 Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.
2009-01-02 11:39:26 +00:00
pooka 72858b67bf Define -DMODULAR in Makefile.rump instead of the sys/rump/librump
Makefile.inc so that it gets picked up by UPDATE=1
2009-01-02 11:13:38 +00:00
pooka 167269d42c Include kernel printf routines in rump instead of relying on the
magic libc symbol.  This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c.  The host kernel bridging
is now done via rumpuser_putchar().
2009-01-02 02:54:13 +00:00
pooka bd4f61f139 add missing "arch/" as noted by a few people 2009-01-01 20:30:45 +00:00