History log of /netbsd-current/sys/rump/include/rump/rumpuser.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.117 24-Sep-2023 martin

PR kern/57626: instead of an (arbitrary) FAKE_PAGE_SHIFT (and always
using 4k pages), query the hypervisor for the real page size of the host
kernel and use that for architectures that do not have compile time
constant page sizes.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.116 22-Mar-2020 pgoyette

Teach rump to process __link_set_evcnts entries. (Second part of
fix for PR kern/55088)


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.115 27-Dec-2017 ozaki-r

branches: 1.115.4;
Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG

Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.114 03-Jan-2015 pooka

branches: 1.114.10;
limit visibility of sysproxy calls to where they are needed


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.113 18-Jun-2014 alnsn

branches: 1.113.4;
Revert last change. This is not the right place for rumpuser_sync_icache().


# 1.112 17-Jun-2014 alnsn

Implement rumpuser_sync_icache hypercall.


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.111 27-Apr-2014 pooka

weak alias removal implication: rumpuser_dl_globalsym() can now sleep
with the fishes.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.110 16-Mar-2014 pooka

branches: 1.110.2;
remove unnecesary verbosity: s/RUMP_CURLWP_MODEL/RUMP_CURLWP/


# 1.109 15-Mar-2014 pooka

Allow compile-time optimizations to curlwp. This can have a pretty
staggering impact on performance. When running sendto() in a loop,
the improvement is 200k more calls per second with an inlined __thread
curlwp as opposed to the default. In other words, it shaves off hundreds
of CPU cycles per call (~20%). Even just eliminating the x86_curlwp()
call in favor of an inline gives an improvement of 60k calls per second.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.108 15-May-2013 pooka

branches: 1.108.2;
Looks like I'm done revamping, so bump interface version to 17,
where it will hopefully stay for all eternity (unless some snafus
are discovered before NetBSD 7).


# 1.107 15-May-2013 pooka

Add a generalized rumpuser_syncfd() call which allows the caller
to request a sync or a barrier for fd.


# 1.106 15-May-2013 pooka

Pass off_t over the hypercall interface as int64_t to avoid potential
problems in setups where off_t doesn't want to be 64bit.

I'm already excitedly waiting for 128bit off_t and _LARGE_LARGE_FILES


# 1.105 15-May-2013 pooka

Pass enums over the hypercall interface as ints to avoid some
pathological scenarios from arising in setups where enums might be
of a different size in the rump kernel and hypervisor.


# 1.104 15-May-2013 pooka

Add RUMPUSER_LWP_CLEAR instead of overloading RUMPUSER_LWP_SET.
This simplifies some alternative hypervisor implementations.


# 1.103 02-May-2013 pooka

Ok, maybe using int64 for nanoseconds in the (sec,nsec) tuple was
a bit too future-proof. I think long is enough there (let's just
hope nobody redefines "nano"). Also, make seconds signed just in
case someone wants their clock to be in 1901.


# 1.102 02-May-2013 pooka

Push rwlock upgrade and downgrade into the hypervisor where there's
at least a chance to implement them with minimal fuss.


# 1.101 02-May-2013 pooka

Inform the rump kernel hypervisor of valid thread contexts so
that the implementation can allocate and release storage for them
in an optimal fashion, if necessary.


# 1.100 30-Apr-2013 pooka

Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.99 30-Apr-2013 pooka

In kthread_create(), pass the priority and cpu index down to the
rump kernel hypervisor (though the current implementation doesn't take
advantage of them).


# 1.98 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.97 29-Apr-2013 pooka

Reduce hypercalls related to reading to essentially an amalgamation
of readv and preadv. ditto for writing. Hypercalls are so seldomly
used that it doesn't justify 3x the calls for syntactic sugar.


# 1.96 29-Apr-2013 pooka

remove accidentally committed bit


# 1.95 29-Apr-2013 pooka

Replace the various "get info from hypervisor" interfaces with one
unified rumpuser_getparam(), and make it return a plist. The
contents can come e.g. from the env or a config file. Make
identifiers starting with an underscore denote system identifiers
which must be implemented by hypervisor. (yea, j/k about the plist bit)


# 1.94 29-Apr-2013 pooka

The fsync hypercall is now used only with close, so get rid of it.
rumpuser_bio() should do the necessary syncing.


# 1.93 29-Apr-2013 pooka

Make the rump kernel upcalls which were previous available only to
the sysproxy module available for the entire hypervisor.


# 1.92 29-Apr-2013 pooka

regroup calls a bit and sprinkle comments
no functional change for a change


# 1.91 29-Apr-2013 pooka

RUMPUSER_OPEN_DIRECT is no longer necessary


# 1.90 29-Apr-2013 pooka

changes to bio hypercalls, part 3/n:

retire the filemmap/memsync hypercalls, they're no longer used


# 1.89 29-Apr-2013 pooka

Rework how the bio hypercalls work, part 1/n:

Reduce the set of hypercalls to one: "do block i/o". This not only
eliminates a lot of pseudo-duplicate code, it also gives the
hypervisor a lot more freedom on how to optimize the i/o.


# 1.88 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


# 1.87 28-Apr-2013 pooka

make the file monitoring hypercalls private to shmif


# 1.86 28-Apr-2013 pooka

The ioctl hypercall is used only by the usb host controller driver,
so make it exclusive to that component. I'm happy to see it gone.


# 1.85 27-Apr-2013 pooka

make the random hypercall more generic


# 1.84 27-Apr-2013 pooka

roll mutex init hypercalls into one (one of them already took a flag anyway)


# 1.83 27-Apr-2013 pooka

move struct lwp forward decl before its first use. otherwise it's rather
pointless. some whitespace landscaping too.


# 1.82 27-Apr-2013 pooka

wrap unportable register_t with a long. should do it in the front
of the house too, but at least this is a start.


# 1.81 27-Apr-2013 pooka

* treat kern_malloc.c as an unreal allocator (it's so lightweight)
* get rid of the rumpuser_realloc() hypercall
* pass size to rumpuser_free()


# 1.80 27-Apr-2013 pooka

Let the includer figure out where to get stdint or equivalent from.


# 1.79 27-Apr-2013 pooka

rumpuser_poll() is used only by sockin, so make the hypercall
private to that component.


# 1.78 27-Apr-2013 pooka

* integrate rumpuser_getversion() with the hypervisor initialization
* rename some identifiers to better match reality


# 1.77 27-Apr-2013 pooka

remove prototypes for interfaces no longer provided


# 1.76 27-Apr-2013 pooka

Try to make sure that the appropriate calls to mutex_enter() takes
a spin mutex (i.e. does not relinquish cpu context while trying to
take the mutex).

Bump the hypercall interface version number. I'll be doing a bunch
of other cleanups to simplify the interface for the benefit of
alternative hypervisor implementations. I'll be riding this bump
and doing a second one only after I'm finished with all of the
changes.


Revision tags: agc-symver-base
# 1.75 08-Mar-2013 pooka

Ensure that rump kernel component constructors from the main object
get processed. This applies to ones which were linked statically.
Unfortunately, that's where it got a bit tricky, since the dlsym()
interface searches the handle and all its dependencies. For the main
object the list of dependencies includes all the dynamic rump kernel
components that were included when the binary is linked. So, a long
story short, make only one pass through the objects to harvest all the
component entries, weed out the dupes, and initialize components from
an in-memory dupe-free list when so requested.


# 1.74 01-Mar-2013 pooka

limit use of rumpuser.h to where it is meant to be used from


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.73 14-Sep-2012 pooka

Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.72 15-Mar-2012 joerg

branches: 1.72.2;
Add __printflike attribution to use vprintf and friends with an argument
as format string.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.71 28-Nov-2011 tls

branches: 1.71.2;
Remove arc4random() and arc4randbytes() from the kernel API. Replace
arc4random() hacks in rump with stubs that call the host arc4random() to
get numbers that are hopefully actually random (arc4random() keyed with
stack junk is not). This should fix some of the currently failing anita
tests -- we should no longer generate duplicate "random" MAC addresses in
the test environment.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.70 29-Aug-2011 joerg

branches: 1.70.2;
Use __dead


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.69 23-May-2011 joerg

Mark rumpuser_exit and rumpuser_thread_exit as dead.


# 1.68 21-Mar-2011 pooka

Update copyright statements.

no functional change.


# 1.67 08-Mar-2011 pooka

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).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.66 15-Feb-2011 pooka

Add an "exec" callback for the proxy code. The client can now
notify the rump kernel of an exec having taken place.


# 1.65 28-Jan-2011 pooka

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 *.*


# 1.64 22-Jan-2011 pooka

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.


Revision tags: jruoho-x86intr-base
# 1.63 14-Jan-2011 pooka

branches: 1.63.2; 1.63.4;
Support SIGMODEL_RAISE for non-local clients.


# 1.62 12-Jan-2011 pooka

add spop_procexit


Revision tags: matt-mips64-premerge-20101231
# 1.61 02-Jan-2011 pooka

There is a use case where preserving the parent's fd table is
relevant, so to accommodate that change rump_lwproc_newproc() to
rump_lwproc_rfork(). The new interface has the rfork() fd table
semantics. The equivalent of rump_lwproc_newproc() is
rump_lwproc_rfork(RUMP_RFCFDG).


# 1.60 30-Dec-2010 pooka

Allow rump kernel to call dlsym(RTLD_DEFAULT).


# 1.59 16-Dec-2010 pooka

Print a banner a connecting client. The banner contains rump sp
protocol version, os name, os revision and machine.


# 1.58 12-Dec-2010 pooka

add rumpuser_sp_fini, which surpringly is the opposite of rumpuser_sp_init


# 1.57 01-Dec-2010 pooka

implement mutex_owner()


# 1.56 01-Dec-2010 pooka

rumpuser interface changed


# 1.55 01-Dec-2010 pooka

Track lwp as the rumpuser mutex owner instead of pthread_t (this
is done in rumpuser for simplicity, since on the kernel side things
we assume we have only one pointer of space). As a side-effect,
we can no longer know if the current thread is holding on to a
mutex locked without curlwp context (basically all mutexes inited
outside of mutex_init()). The only thing that called rumpuser_mutex_held()
for a non-kmutex was the giant lock. So, instead implement recursive
locking for the giant lock in the rump kernel and get rid of the
now-unused recursive pthread mutex in the hypercall interface.


# 1.54 30-Nov-2010 pooka

Require server to be explicitly initialized with rump_init_server(url).
Also, add rump_daemonize_begin() / rump_daemonize_end() to help
with the "can't daemon() after pthread_create()" problem. Applications
could accomplish the same, but since it's such a common operation,
provide a little help.


# 1.53 25-Nov-2010 pooka

*facepalm*, adjust remote copyinstr to work in cases where the end
of the max copyin extends to an unmapped page.

Noticed, as usual, by tests.


# 1.52 22-Nov-2010 pooka

Support physio for remote processes.
==> add support for remote vmspace vmapbuf/vunmapbuf
==> add proper support for copyin/out_vmspace
==> add support for remote vmspace uvm_io
==> add support for non-curproc rumpuser_sp_copyin/out
==> store remote context in vm_map->pmap instead of
pthread_specificdata

In short, makes read/write of most (all?) block devices work from
a remote rump client via rump syscalls.


# 1.51 19-Nov-2010 pooka

Pass routines necessary for multithreaded operation down to rumpuser_sp.


Revision tags: uebayasi-xip-base4
# 1.50 04-Nov-2010 pooka

bump rumpuser version


# 1.49 04-Nov-2010 pooka

Refactor the sysproxy code so that rumpuser contains only the server side.


# 1.48 01-Nov-2010 pooka

Missed a few symbols in previous ...

Also, reorganize rumpuser header inclusion to make sure problem is
caught already by the compiler.


# 1.47 01-Nov-2010 pooka

Make librumpuser linkage once again free of librump.

problem pointed out by <he>


# 1.46 27-Oct-2010 pooka

Start rework of system call proxying over socket ("sysproxy").
This incarnation is written in the user namespace as opposed to
the previous one which was done in kernel namespace. Also, rump
does all the handshaking now instead of excepting an application
to come up with the user namespace socket.

There's still a lot to do, including making code "a bit" more
robust, actually running different clients in a different process
inside the kernel and splitting the client side library from librump.
I'm committing this now so that I don't lose it, plus it generally
works as long as you don't use it in unexcepted ways: i've tested
ifconfig(8), route(8), envstat(8) and sysctl(8).


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.45 09-Jun-2010 pooka

Version rumpuser ABI with a lightweight mechanism.


# 1.44 09-Jun-2010 pooka

Add the ability to specify a preferred address the "map anon memory"
hypercall.


# 1.43 01-Jun-2010 pooka

Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there. Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().


# 1.42 31-May-2010 pooka

Support KTHREAD_JOINABLE/kthread_join(). Also fixes earlier bug
where all pthreads were created non-detached.


# 1.41 18-May-2010 pooka

Make it possible to use the scheduler lock as the rumpuser condvar
interlock. This is applicable in cases where the actual interlock
is the CPU the currently running thread is scheduled on. Borrowing
the scheduler lock as the mutex mandated by pthread_cond_wait()
does away with need to have an additional mutex. This both optimizes
runtime execution and simplifies code, as the extra lock typically
lead to quite some trickeries to avoid the dungeon collapsing due
to zaps from the wand of deadlock.


Revision tags: uebayasi-xip-base1
# 1.40 28-Apr-2010 pooka

Add rumpuser interface to fetch number of host cpus.


# 1.39 21-Apr-2010 pooka

Add rumpuser_kill, which sends a signal to a host process.


Revision tags: yamt-nfs-mp-base9
# 1.38 05-Mar-2010 pooka

branches: 1.38.2;
During bootstrap, process all modinfos in a DSO in one go. Get
rid of dependency tricks, since they are no longer necessary.


# 1.37 01-Mar-2010 pooka

Introduce RUMP_COMPONENT. It behaves mostly like a simplified
module which is linked into the kernel and cannot be unloaded.
The main purpose is to get the proper constructors run and create
any /dev nodes necessary for said component. Once more of the
kernel (e.g. networking stack and device drivers) are converted to
MODULE and devfs pops up from somewhere, rump components can be
retired.


# 1.36 26-Feb-2010 pooka

Rename rumpuser_dl_module_bootstrap() to rumpuser_dl_bootstrap(),
since it hasn't been involved only with modules for quite a while now.


Revision tags: uebayasi-xip-base
# 1.35 23-Dec-2009 stacktic

branches: 1.35.2;
Fixed ukfs build on non-NetBSD system.


Revision tags: matt-premerge-20091211
# 1.34 26-Nov-2009 pooka

Build the kernel symbol table in rumpuser bootstrap and feed it to
the rump kernel. After this change it is possible to use the
in-kernel linker and rump_sys_modctl() to load kernel modules at
runtime.

Previously loading modules at runtime was possible only through
using the host system ld.so. Note that it is still preferred to
use shared libs when possible, since they are PIC and n virtual
kernels will only require one copy of r/o segments. However, when
there is no access to source code, a binary kernel module is the
only thing available ...


# 1.33 19-Nov-2009 pooka

Create async i/o "interrupt" thread from within the kernel so that
it gets a kernel thread context.


# 1.32 11-Nov-2009 pooka

Make rumpuser_cv_timedwait take two int64's instead timespec to
uncouple it from the timespec layout. Also, change return value
to zero for "timeout didn't expire" and non-zero for "timeout
expired". This decouples the interface from errno assignments.


Revision tags: jym-xensuspend-nbase
# 1.31 24-Oct-2009 pooka

Pass modinit to rumpuser_dl_module_bootstrap() as a function pointer
to avoid linker rump -> rumpuser -> rump dependency which is annoying
redundancy in static linking.


# 1.30 24-Oct-2009 pooka

unused rumpuser_realpath is really dead


# 1.29 15-Oct-2009 pooka

Add prototype for wait operation variants which do not drop any
resources (because they should be holding any in the first place).


# 1.28 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.27 24-Sep-2009 pooka

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.


# 1.26 21-Sep-2009 pooka

<sys/stdint.h> is a non-standard header, so include it only from
kernel code (where it will be included from the NetBSD kernel source
tree). Use <stdint.h> in userland namespace, i.e. when compiling
librumpuser.


Revision tags: yamt-nfs-mp-base8
# 1.25 02-Sep-2009 pooka

add rumpuser_net_setsockopt()


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.24 10-Jun-2009 pooka

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.


Revision tags: yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 jym-xensuspend-base
# 1.23 27-Apr-2009 pooka

branches: 1.23.2;
* 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


Revision tags: nick-hppapmap-base3 nick-hppapmap-base
# 1.22 26-Apr-2009 pooka

Bump maximum number of outstanding async i/o's to 1024, 128 can
fill up really fast.


# 1.21 07-Apr-2009 pooka

Make it possible to use VCHR devices again.


# 1.20 18-Mar-2009 pooka

* allow to specify PROT_READ/PROT_WRITE when mmapping a file
* add msync


Revision tags: nick-hppapmap-base2
# 1.19 28-Feb-2009 pooka

Remember to commit the rumpuser bits necessary for if_shm: mmaping
a file and waiting for writes to it.


# 1.18 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.17 26-Feb-2009 pooka

decouple from host struct iovec


# 1.16 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.15 07-Feb-2009 pooka

branches: 1.15.2;
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.


# 1.14 06-Feb-2009 pooka

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)


# 1.13 27-Jan-2009 pooka

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).


# 1.12 26-Jan-2009 pooka

Support getsockname() and getpeername() in rumpuser.

XXX: all these rumpuser_net routines passing sockaddr should use proplib.


# 1.11 23-Jan-2009 pooka

rumpuser_seterrno() to set errno from a rump kernel context.


# 1.10 23-Jan-2009 pooka

Support mmapping anonymous memory.
XXX: this is mainly for the benefit of correct alignment, but
MAP_ALIGNED() is not portable.


Revision tags: mjf-devfs2-base
# 1.9 08-Jan-2009 pooka

branches: 1.9.2; 1.9.4;
missed this in previous commit:

Explicitly pass a pointer to the kernel lock/unlock routines in
rumpuser init instead of magically relying on the linker giving us
the symbols.

thanks to uwe for pointing out


# 1.8 07-Jan-2009 pooka

more namespacing: rua -> rumpuser_aio


# 1.7 07-Jan-2009 pooka

Rename _rumpuser_malloc to rumpuser__malloc so that all exported
rumpuser symbols start with "rumpuser".
(no major bumps or compat will be provided)


# 1.6 05-Jan-2009 pooka

g/c unused rumpuser bswap routines


# 1.5 02-Jan-2009 pooka

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().


# 1.4 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


Revision tags: haad-dm-base haad-dm-base2 haad-nbase2 ad-audiomp2-base
# 1.3 25-Nov-2008 pooka

Support PRU_BIND / PRU_LISTEN / PRU_ACCEPT in sockin.


# 1.2 18-Nov-2008 pooka

Pass biodone() to rumpuser as a callback instead of hardcoding it.
Also, explicitly init rumpuser async io thread.


# 1.1 17-Nov-2008 pooka

Move rump public headers to include/rump


# 1.116 22-Mar-2020 pgoyette

Teach rump to process __link_set_evcnts entries. (Second part of
fix for PR kern/55088)


Revision tags: ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.115 27-Dec-2017 ozaki-r

Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG

Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.114 03-Jan-2015 pooka

branches: 1.114.10;
limit visibility of sysproxy calls to where they are needed


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.113 18-Jun-2014 alnsn

branches: 1.113.4;
Revert last change. This is not the right place for rumpuser_sync_icache().


# 1.112 17-Jun-2014 alnsn

Implement rumpuser_sync_icache hypercall.


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.111 27-Apr-2014 pooka

weak alias removal implication: rumpuser_dl_globalsym() can now sleep
with the fishes.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.110 16-Mar-2014 pooka

branches: 1.110.2;
remove unnecesary verbosity: s/RUMP_CURLWP_MODEL/RUMP_CURLWP/


# 1.109 15-Mar-2014 pooka

Allow compile-time optimizations to curlwp. This can have a pretty
staggering impact on performance. When running sendto() in a loop,
the improvement is 200k more calls per second with an inlined __thread
curlwp as opposed to the default. In other words, it shaves off hundreds
of CPU cycles per call (~20%). Even just eliminating the x86_curlwp()
call in favor of an inline gives an improvement of 60k calls per second.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.108 15-May-2013 pooka

branches: 1.108.2;
Looks like I'm done revamping, so bump interface version to 17,
where it will hopefully stay for all eternity (unless some snafus
are discovered before NetBSD 7).


# 1.107 15-May-2013 pooka

Add a generalized rumpuser_syncfd() call which allows the caller
to request a sync or a barrier for fd.


# 1.106 15-May-2013 pooka

Pass off_t over the hypercall interface as int64_t to avoid potential
problems in setups where off_t doesn't want to be 64bit.

I'm already excitedly waiting for 128bit off_t and _LARGE_LARGE_FILES


# 1.105 15-May-2013 pooka

Pass enums over the hypercall interface as ints to avoid some
pathological scenarios from arising in setups where enums might be
of a different size in the rump kernel and hypervisor.


# 1.104 15-May-2013 pooka

Add RUMPUSER_LWP_CLEAR instead of overloading RUMPUSER_LWP_SET.
This simplifies some alternative hypervisor implementations.


# 1.103 02-May-2013 pooka

Ok, maybe using int64 for nanoseconds in the (sec,nsec) tuple was
a bit too future-proof. I think long is enough there (let's just
hope nobody redefines "nano"). Also, make seconds signed just in
case someone wants their clock to be in 1901.


# 1.102 02-May-2013 pooka

Push rwlock upgrade and downgrade into the hypervisor where there's
at least a chance to implement them with minimal fuss.


# 1.101 02-May-2013 pooka

Inform the rump kernel hypervisor of valid thread contexts so
that the implementation can allocate and release storage for them
in an optimal fashion, if necessary.


# 1.100 30-Apr-2013 pooka

Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.99 30-Apr-2013 pooka

In kthread_create(), pass the priority and cpu index down to the
rump kernel hypervisor (though the current implementation doesn't take
advantage of them).


# 1.98 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.97 29-Apr-2013 pooka

Reduce hypercalls related to reading to essentially an amalgamation
of readv and preadv. ditto for writing. Hypercalls are so seldomly
used that it doesn't justify 3x the calls for syntactic sugar.


# 1.96 29-Apr-2013 pooka

remove accidentally committed bit


# 1.95 29-Apr-2013 pooka

Replace the various "get info from hypervisor" interfaces with one
unified rumpuser_getparam(), and make it return a plist. The
contents can come e.g. from the env or a config file. Make
identifiers starting with an underscore denote system identifiers
which must be implemented by hypervisor. (yea, j/k about the plist bit)


# 1.94 29-Apr-2013 pooka

The fsync hypercall is now used only with close, so get rid of it.
rumpuser_bio() should do the necessary syncing.


# 1.93 29-Apr-2013 pooka

Make the rump kernel upcalls which were previous available only to
the sysproxy module available for the entire hypervisor.


# 1.92 29-Apr-2013 pooka

regroup calls a bit and sprinkle comments
no functional change for a change


# 1.91 29-Apr-2013 pooka

RUMPUSER_OPEN_DIRECT is no longer necessary


# 1.90 29-Apr-2013 pooka

changes to bio hypercalls, part 3/n:

retire the filemmap/memsync hypercalls, they're no longer used


# 1.89 29-Apr-2013 pooka

Rework how the bio hypercalls work, part 1/n:

Reduce the set of hypercalls to one: "do block i/o". This not only
eliminates a lot of pseudo-duplicate code, it also gives the
hypervisor a lot more freedom on how to optimize the i/o.


# 1.88 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


# 1.87 28-Apr-2013 pooka

make the file monitoring hypercalls private to shmif


# 1.86 28-Apr-2013 pooka

The ioctl hypercall is used only by the usb host controller driver,
so make it exclusive to that component. I'm happy to see it gone.


# 1.85 27-Apr-2013 pooka

make the random hypercall more generic


# 1.84 27-Apr-2013 pooka

roll mutex init hypercalls into one (one of them already took a flag anyway)


# 1.83 27-Apr-2013 pooka

move struct lwp forward decl before its first use. otherwise it's rather
pointless. some whitespace landscaping too.


# 1.82 27-Apr-2013 pooka

wrap unportable register_t with a long. should do it in the front
of the house too, but at least this is a start.


# 1.81 27-Apr-2013 pooka

* treat kern_malloc.c as an unreal allocator (it's so lightweight)
* get rid of the rumpuser_realloc() hypercall
* pass size to rumpuser_free()


# 1.80 27-Apr-2013 pooka

Let the includer figure out where to get stdint or equivalent from.


# 1.79 27-Apr-2013 pooka

rumpuser_poll() is used only by sockin, so make the hypercall
private to that component.


# 1.78 27-Apr-2013 pooka

* integrate rumpuser_getversion() with the hypervisor initialization
* rename some identifiers to better match reality


# 1.77 27-Apr-2013 pooka

remove prototypes for interfaces no longer provided


# 1.76 27-Apr-2013 pooka

Try to make sure that the appropriate calls to mutex_enter() takes
a spin mutex (i.e. does not relinquish cpu context while trying to
take the mutex).

Bump the hypercall interface version number. I'll be doing a bunch
of other cleanups to simplify the interface for the benefit of
alternative hypervisor implementations. I'll be riding this bump
and doing a second one only after I'm finished with all of the
changes.


Revision tags: agc-symver-base
# 1.75 08-Mar-2013 pooka

Ensure that rump kernel component constructors from the main object
get processed. This applies to ones which were linked statically.
Unfortunately, that's where it got a bit tricky, since the dlsym()
interface searches the handle and all its dependencies. For the main
object the list of dependencies includes all the dynamic rump kernel
components that were included when the binary is linked. So, a long
story short, make only one pass through the objects to harvest all the
component entries, weed out the dupes, and initialize components from
an in-memory dupe-free list when so requested.


# 1.74 01-Mar-2013 pooka

limit use of rumpuser.h to where it is meant to be used from


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.73 14-Sep-2012 pooka

Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.72 15-Mar-2012 joerg

branches: 1.72.2;
Add __printflike attribution to use vprintf and friends with an argument
as format string.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.71 28-Nov-2011 tls

branches: 1.71.2;
Remove arc4random() and arc4randbytes() from the kernel API. Replace
arc4random() hacks in rump with stubs that call the host arc4random() to
get numbers that are hopefully actually random (arc4random() keyed with
stack junk is not). This should fix some of the currently failing anita
tests -- we should no longer generate duplicate "random" MAC addresses in
the test environment.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.70 29-Aug-2011 joerg

branches: 1.70.2;
Use __dead


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.69 23-May-2011 joerg

Mark rumpuser_exit and rumpuser_thread_exit as dead.


# 1.68 21-Mar-2011 pooka

Update copyright statements.

no functional change.


# 1.67 08-Mar-2011 pooka

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).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.66 15-Feb-2011 pooka

Add an "exec" callback for the proxy code. The client can now
notify the rump kernel of an exec having taken place.


# 1.65 28-Jan-2011 pooka

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 *.*


# 1.64 22-Jan-2011 pooka

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.


Revision tags: jruoho-x86intr-base
# 1.63 14-Jan-2011 pooka

branches: 1.63.2; 1.63.4;
Support SIGMODEL_RAISE for non-local clients.


# 1.62 12-Jan-2011 pooka

add spop_procexit


Revision tags: matt-mips64-premerge-20101231
# 1.61 02-Jan-2011 pooka

There is a use case where preserving the parent's fd table is
relevant, so to accommodate that change rump_lwproc_newproc() to
rump_lwproc_rfork(). The new interface has the rfork() fd table
semantics. The equivalent of rump_lwproc_newproc() is
rump_lwproc_rfork(RUMP_RFCFDG).


# 1.60 30-Dec-2010 pooka

Allow rump kernel to call dlsym(RTLD_DEFAULT).


# 1.59 16-Dec-2010 pooka

Print a banner a connecting client. The banner contains rump sp
protocol version, os name, os revision and machine.


# 1.58 12-Dec-2010 pooka

add rumpuser_sp_fini, which surpringly is the opposite of rumpuser_sp_init


# 1.57 01-Dec-2010 pooka

implement mutex_owner()


# 1.56 01-Dec-2010 pooka

rumpuser interface changed


# 1.55 01-Dec-2010 pooka

Track lwp as the rumpuser mutex owner instead of pthread_t (this
is done in rumpuser for simplicity, since on the kernel side things
we assume we have only one pointer of space). As a side-effect,
we can no longer know if the current thread is holding on to a
mutex locked without curlwp context (basically all mutexes inited
outside of mutex_init()). The only thing that called rumpuser_mutex_held()
for a non-kmutex was the giant lock. So, instead implement recursive
locking for the giant lock in the rump kernel and get rid of the
now-unused recursive pthread mutex in the hypercall interface.


# 1.54 30-Nov-2010 pooka

Require server to be explicitly initialized with rump_init_server(url).
Also, add rump_daemonize_begin() / rump_daemonize_end() to help
with the "can't daemon() after pthread_create()" problem. Applications
could accomplish the same, but since it's such a common operation,
provide a little help.


# 1.53 25-Nov-2010 pooka

*facepalm*, adjust remote copyinstr to work in cases where the end
of the max copyin extends to an unmapped page.

Noticed, as usual, by tests.


# 1.52 22-Nov-2010 pooka

Support physio for remote processes.
==> add support for remote vmspace vmapbuf/vunmapbuf
==> add proper support for copyin/out_vmspace
==> add support for remote vmspace uvm_io
==> add support for non-curproc rumpuser_sp_copyin/out
==> store remote context in vm_map->pmap instead of
pthread_specificdata

In short, makes read/write of most (all?) block devices work from
a remote rump client via rump syscalls.


# 1.51 19-Nov-2010 pooka

Pass routines necessary for multithreaded operation down to rumpuser_sp.


Revision tags: uebayasi-xip-base4
# 1.50 04-Nov-2010 pooka

bump rumpuser version


# 1.49 04-Nov-2010 pooka

Refactor the sysproxy code so that rumpuser contains only the server side.


# 1.48 01-Nov-2010 pooka

Missed a few symbols in previous ...

Also, reorganize rumpuser header inclusion to make sure problem is
caught already by the compiler.


# 1.47 01-Nov-2010 pooka

Make librumpuser linkage once again free of librump.

problem pointed out by <he>


# 1.46 27-Oct-2010 pooka

Start rework of system call proxying over socket ("sysproxy").
This incarnation is written in the user namespace as opposed to
the previous one which was done in kernel namespace. Also, rump
does all the handshaking now instead of excepting an application
to come up with the user namespace socket.

There's still a lot to do, including making code "a bit" more
robust, actually running different clients in a different process
inside the kernel and splitting the client side library from librump.
I'm committing this now so that I don't lose it, plus it generally
works as long as you don't use it in unexcepted ways: i've tested
ifconfig(8), route(8), envstat(8) and sysctl(8).


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.45 09-Jun-2010 pooka

Version rumpuser ABI with a lightweight mechanism.


# 1.44 09-Jun-2010 pooka

Add the ability to specify a preferred address the "map anon memory"
hypercall.


# 1.43 01-Jun-2010 pooka

Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there. Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().


# 1.42 31-May-2010 pooka

Support KTHREAD_JOINABLE/kthread_join(). Also fixes earlier bug
where all pthreads were created non-detached.


# 1.41 18-May-2010 pooka

Make it possible to use the scheduler lock as the rumpuser condvar
interlock. This is applicable in cases where the actual interlock
is the CPU the currently running thread is scheduled on. Borrowing
the scheduler lock as the mutex mandated by pthread_cond_wait()
does away with need to have an additional mutex. This both optimizes
runtime execution and simplifies code, as the extra lock typically
lead to quite some trickeries to avoid the dungeon collapsing due
to zaps from the wand of deadlock.


Revision tags: uebayasi-xip-base1
# 1.40 28-Apr-2010 pooka

Add rumpuser interface to fetch number of host cpus.


# 1.39 21-Apr-2010 pooka

Add rumpuser_kill, which sends a signal to a host process.


Revision tags: yamt-nfs-mp-base9
# 1.38 05-Mar-2010 pooka

branches: 1.38.2;
During bootstrap, process all modinfos in a DSO in one go. Get
rid of dependency tricks, since they are no longer necessary.


# 1.37 01-Mar-2010 pooka

Introduce RUMP_COMPONENT. It behaves mostly like a simplified
module which is linked into the kernel and cannot be unloaded.
The main purpose is to get the proper constructors run and create
any /dev nodes necessary for said component. Once more of the
kernel (e.g. networking stack and device drivers) are converted to
MODULE and devfs pops up from somewhere, rump components can be
retired.


# 1.36 26-Feb-2010 pooka

Rename rumpuser_dl_module_bootstrap() to rumpuser_dl_bootstrap(),
since it hasn't been involved only with modules for quite a while now.


Revision tags: uebayasi-xip-base
# 1.35 23-Dec-2009 stacktic

branches: 1.35.2;
Fixed ukfs build on non-NetBSD system.


Revision tags: matt-premerge-20091211
# 1.34 26-Nov-2009 pooka

Build the kernel symbol table in rumpuser bootstrap and feed it to
the rump kernel. After this change it is possible to use the
in-kernel linker and rump_sys_modctl() to load kernel modules at
runtime.

Previously loading modules at runtime was possible only through
using the host system ld.so. Note that it is still preferred to
use shared libs when possible, since they are PIC and n virtual
kernels will only require one copy of r/o segments. However, when
there is no access to source code, a binary kernel module is the
only thing available ...


# 1.33 19-Nov-2009 pooka

Create async i/o "interrupt" thread from within the kernel so that
it gets a kernel thread context.


# 1.32 11-Nov-2009 pooka

Make rumpuser_cv_timedwait take two int64's instead timespec to
uncouple it from the timespec layout. Also, change return value
to zero for "timeout didn't expire" and non-zero for "timeout
expired". This decouples the interface from errno assignments.


Revision tags: jym-xensuspend-nbase
# 1.31 24-Oct-2009 pooka

Pass modinit to rumpuser_dl_module_bootstrap() as a function pointer
to avoid linker rump -> rumpuser -> rump dependency which is annoying
redundancy in static linking.


# 1.30 24-Oct-2009 pooka

unused rumpuser_realpath is really dead


# 1.29 15-Oct-2009 pooka

Add prototype for wait operation variants which do not drop any
resources (because they should be holding any in the first place).


# 1.28 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.27 24-Sep-2009 pooka

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.


# 1.26 21-Sep-2009 pooka

<sys/stdint.h> is a non-standard header, so include it only from
kernel code (where it will be included from the NetBSD kernel source
tree). Use <stdint.h> in userland namespace, i.e. when compiling
librumpuser.


Revision tags: yamt-nfs-mp-base8
# 1.25 02-Sep-2009 pooka

add rumpuser_net_setsockopt()


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.24 10-Jun-2009 pooka

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.


Revision tags: yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 jym-xensuspend-base
# 1.23 27-Apr-2009 pooka

branches: 1.23.2;
* 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


Revision tags: nick-hppapmap-base3 nick-hppapmap-base
# 1.22 26-Apr-2009 pooka

Bump maximum number of outstanding async i/o's to 1024, 128 can
fill up really fast.


# 1.21 07-Apr-2009 pooka

Make it possible to use VCHR devices again.


# 1.20 18-Mar-2009 pooka

* allow to specify PROT_READ/PROT_WRITE when mmapping a file
* add msync


Revision tags: nick-hppapmap-base2
# 1.19 28-Feb-2009 pooka

Remember to commit the rumpuser bits necessary for if_shm: mmaping
a file and waiting for writes to it.


# 1.18 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.17 26-Feb-2009 pooka

decouple from host struct iovec


# 1.16 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.15 07-Feb-2009 pooka

branches: 1.15.2;
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.


# 1.14 06-Feb-2009 pooka

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)


# 1.13 27-Jan-2009 pooka

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).


# 1.12 26-Jan-2009 pooka

Support getsockname() and getpeername() in rumpuser.

XXX: all these rumpuser_net routines passing sockaddr should use proplib.


# 1.11 23-Jan-2009 pooka

rumpuser_seterrno() to set errno from a rump kernel context.


# 1.10 23-Jan-2009 pooka

Support mmapping anonymous memory.
XXX: this is mainly for the benefit of correct alignment, but
MAP_ALIGNED() is not portable.


Revision tags: mjf-devfs2-base
# 1.9 08-Jan-2009 pooka

branches: 1.9.2; 1.9.4;
missed this in previous commit:

Explicitly pass a pointer to the kernel lock/unlock routines in
rumpuser init instead of magically relying on the linker giving us
the symbols.

thanks to uwe for pointing out


# 1.8 07-Jan-2009 pooka

more namespacing: rua -> rumpuser_aio


# 1.7 07-Jan-2009 pooka

Rename _rumpuser_malloc to rumpuser__malloc so that all exported
rumpuser symbols start with "rumpuser".
(no major bumps or compat will be provided)


# 1.6 05-Jan-2009 pooka

g/c unused rumpuser bswap routines


# 1.5 02-Jan-2009 pooka

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().


# 1.4 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


Revision tags: haad-dm-base haad-dm-base2 haad-nbase2 ad-audiomp2-base
# 1.3 25-Nov-2008 pooka

Support PRU_BIND / PRU_LISTEN / PRU_ACCEPT in sockin.


# 1.2 18-Nov-2008 pooka

Pass biodone() to rumpuser as a callback instead of hardcoding it.
Also, explicitly init rumpuser async io thread.


# 1.1 17-Nov-2008 pooka

Move rump public headers to include/rump


# 1.115 27-Dec-2017 ozaki-r

Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG

Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.114 03-Jan-2015 pooka

branches: 1.114.10;
limit visibility of sysproxy calls to where they are needed


Revision tags: netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.113 18-Jun-2014 alnsn

branches: 1.113.4;
Revert last change. This is not the right place for rumpuser_sync_icache().


# 1.112 17-Jun-2014 alnsn

Implement rumpuser_sync_icache hypercall.


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.111 27-Apr-2014 pooka

weak alias removal implication: rumpuser_dl_globalsym() can now sleep
with the fishes.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.110 16-Mar-2014 pooka

branches: 1.110.2;
remove unnecesary verbosity: s/RUMP_CURLWP_MODEL/RUMP_CURLWP/


# 1.109 15-Mar-2014 pooka

Allow compile-time optimizations to curlwp. This can have a pretty
staggering impact on performance. When running sendto() in a loop,
the improvement is 200k more calls per second with an inlined __thread
curlwp as opposed to the default. In other words, it shaves off hundreds
of CPU cycles per call (~20%). Even just eliminating the x86_curlwp()
call in favor of an inline gives an improvement of 60k calls per second.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.108 15-May-2013 pooka

branches: 1.108.2;
Looks like I'm done revamping, so bump interface version to 17,
where it will hopefully stay for all eternity (unless some snafus
are discovered before NetBSD 7).


# 1.107 15-May-2013 pooka

Add a generalized rumpuser_syncfd() call which allows the caller
to request a sync or a barrier for fd.


# 1.106 15-May-2013 pooka

Pass off_t over the hypercall interface as int64_t to avoid potential
problems in setups where off_t doesn't want to be 64bit.

I'm already excitedly waiting for 128bit off_t and _LARGE_LARGE_FILES


# 1.105 15-May-2013 pooka

Pass enums over the hypercall interface as ints to avoid some
pathological scenarios from arising in setups where enums might be
of a different size in the rump kernel and hypervisor.


# 1.104 15-May-2013 pooka

Add RUMPUSER_LWP_CLEAR instead of overloading RUMPUSER_LWP_SET.
This simplifies some alternative hypervisor implementations.


# 1.103 02-May-2013 pooka

Ok, maybe using int64 for nanoseconds in the (sec,nsec) tuple was
a bit too future-proof. I think long is enough there (let's just
hope nobody redefines "nano"). Also, make seconds signed just in
case someone wants their clock to be in 1901.


# 1.102 02-May-2013 pooka

Push rwlock upgrade and downgrade into the hypervisor where there's
at least a chance to implement them with minimal fuss.


# 1.101 02-May-2013 pooka

Inform the rump kernel hypervisor of valid thread contexts so
that the implementation can allocate and release storage for them
in an optimal fashion, if necessary.


# 1.100 30-Apr-2013 pooka

Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.99 30-Apr-2013 pooka

In kthread_create(), pass the priority and cpu index down to the
rump kernel hypervisor (though the current implementation doesn't take
advantage of them).


# 1.98 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.97 29-Apr-2013 pooka

Reduce hypercalls related to reading to essentially an amalgamation
of readv and preadv. ditto for writing. Hypercalls are so seldomly
used that it doesn't justify 3x the calls for syntactic sugar.


# 1.96 29-Apr-2013 pooka

remove accidentally committed bit


# 1.95 29-Apr-2013 pooka

Replace the various "get info from hypervisor" interfaces with one
unified rumpuser_getparam(), and make it return a plist. The
contents can come e.g. from the env or a config file. Make
identifiers starting with an underscore denote system identifiers
which must be implemented by hypervisor. (yea, j/k about the plist bit)


# 1.94 29-Apr-2013 pooka

The fsync hypercall is now used only with close, so get rid of it.
rumpuser_bio() should do the necessary syncing.


# 1.93 29-Apr-2013 pooka

Make the rump kernel upcalls which were previous available only to
the sysproxy module available for the entire hypervisor.


# 1.92 29-Apr-2013 pooka

regroup calls a bit and sprinkle comments
no functional change for a change


# 1.91 29-Apr-2013 pooka

RUMPUSER_OPEN_DIRECT is no longer necessary


# 1.90 29-Apr-2013 pooka

changes to bio hypercalls, part 3/n:

retire the filemmap/memsync hypercalls, they're no longer used


# 1.89 29-Apr-2013 pooka

Rework how the bio hypercalls work, part 1/n:

Reduce the set of hypercalls to one: "do block i/o". This not only
eliminates a lot of pseudo-duplicate code, it also gives the
hypervisor a lot more freedom on how to optimize the i/o.


# 1.88 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


# 1.87 28-Apr-2013 pooka

make the file monitoring hypercalls private to shmif


# 1.86 28-Apr-2013 pooka

The ioctl hypercall is used only by the usb host controller driver,
so make it exclusive to that component. I'm happy to see it gone.


# 1.85 27-Apr-2013 pooka

make the random hypercall more generic


# 1.84 27-Apr-2013 pooka

roll mutex init hypercalls into one (one of them already took a flag anyway)


# 1.83 27-Apr-2013 pooka

move struct lwp forward decl before its first use. otherwise it's rather
pointless. some whitespace landscaping too.


# 1.82 27-Apr-2013 pooka

wrap unportable register_t with a long. should do it in the front
of the house too, but at least this is a start.


# 1.81 27-Apr-2013 pooka

* treat kern_malloc.c as an unreal allocator (it's so lightweight)
* get rid of the rumpuser_realloc() hypercall
* pass size to rumpuser_free()


# 1.80 27-Apr-2013 pooka

Let the includer figure out where to get stdint or equivalent from.


# 1.79 27-Apr-2013 pooka

rumpuser_poll() is used only by sockin, so make the hypercall
private to that component.


# 1.78 27-Apr-2013 pooka

* integrate rumpuser_getversion() with the hypervisor initialization
* rename some identifiers to better match reality


# 1.77 27-Apr-2013 pooka

remove prototypes for interfaces no longer provided


# 1.76 27-Apr-2013 pooka

Try to make sure that the appropriate calls to mutex_enter() takes
a spin mutex (i.e. does not relinquish cpu context while trying to
take the mutex).

Bump the hypercall interface version number. I'll be doing a bunch
of other cleanups to simplify the interface for the benefit of
alternative hypervisor implementations. I'll be riding this bump
and doing a second one only after I'm finished with all of the
changes.


Revision tags: agc-symver-base
# 1.75 08-Mar-2013 pooka

Ensure that rump kernel component constructors from the main object
get processed. This applies to ones which were linked statically.
Unfortunately, that's where it got a bit tricky, since the dlsym()
interface searches the handle and all its dependencies. For the main
object the list of dependencies includes all the dynamic rump kernel
components that were included when the binary is linked. So, a long
story short, make only one pass through the objects to harvest all the
component entries, weed out the dupes, and initialize components from
an in-memory dupe-free list when so requested.


# 1.74 01-Mar-2013 pooka

limit use of rumpuser.h to where it is meant to be used from


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.73 14-Sep-2012 pooka

Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.72 15-Mar-2012 joerg

branches: 1.72.2;
Add __printflike attribution to use vprintf and friends with an argument
as format string.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.71 28-Nov-2011 tls

branches: 1.71.2;
Remove arc4random() and arc4randbytes() from the kernel API. Replace
arc4random() hacks in rump with stubs that call the host arc4random() to
get numbers that are hopefully actually random (arc4random() keyed with
stack junk is not). This should fix some of the currently failing anita
tests -- we should no longer generate duplicate "random" MAC addresses in
the test environment.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.70 29-Aug-2011 joerg

branches: 1.70.2;
Use __dead


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.69 23-May-2011 joerg

Mark rumpuser_exit and rumpuser_thread_exit as dead.


# 1.68 21-Mar-2011 pooka

Update copyright statements.

no functional change.


# 1.67 08-Mar-2011 pooka

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).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.66 15-Feb-2011 pooka

Add an "exec" callback for the proxy code. The client can now
notify the rump kernel of an exec having taken place.


# 1.65 28-Jan-2011 pooka

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 *.*


# 1.64 22-Jan-2011 pooka

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.


Revision tags: jruoho-x86intr-base
# 1.63 14-Jan-2011 pooka

branches: 1.63.2; 1.63.4;
Support SIGMODEL_RAISE for non-local clients.


# 1.62 12-Jan-2011 pooka

add spop_procexit


Revision tags: matt-mips64-premerge-20101231
# 1.61 02-Jan-2011 pooka

There is a use case where preserving the parent's fd table is
relevant, so to accommodate that change rump_lwproc_newproc() to
rump_lwproc_rfork(). The new interface has the rfork() fd table
semantics. The equivalent of rump_lwproc_newproc() is
rump_lwproc_rfork(RUMP_RFCFDG).


# 1.60 30-Dec-2010 pooka

Allow rump kernel to call dlsym(RTLD_DEFAULT).


# 1.59 16-Dec-2010 pooka

Print a banner a connecting client. The banner contains rump sp
protocol version, os name, os revision and machine.


# 1.58 12-Dec-2010 pooka

add rumpuser_sp_fini, which surpringly is the opposite of rumpuser_sp_init


# 1.57 01-Dec-2010 pooka

implement mutex_owner()


# 1.56 01-Dec-2010 pooka

rumpuser interface changed


# 1.55 01-Dec-2010 pooka

Track lwp as the rumpuser mutex owner instead of pthread_t (this
is done in rumpuser for simplicity, since on the kernel side things
we assume we have only one pointer of space). As a side-effect,
we can no longer know if the current thread is holding on to a
mutex locked without curlwp context (basically all mutexes inited
outside of mutex_init()). The only thing that called rumpuser_mutex_held()
for a non-kmutex was the giant lock. So, instead implement recursive
locking for the giant lock in the rump kernel and get rid of the
now-unused recursive pthread mutex in the hypercall interface.


# 1.54 30-Nov-2010 pooka

Require server to be explicitly initialized with rump_init_server(url).
Also, add rump_daemonize_begin() / rump_daemonize_end() to help
with the "can't daemon() after pthread_create()" problem. Applications
could accomplish the same, but since it's such a common operation,
provide a little help.


# 1.53 25-Nov-2010 pooka

*facepalm*, adjust remote copyinstr to work in cases where the end
of the max copyin extends to an unmapped page.

Noticed, as usual, by tests.


# 1.52 22-Nov-2010 pooka

Support physio for remote processes.
==> add support for remote vmspace vmapbuf/vunmapbuf
==> add proper support for copyin/out_vmspace
==> add support for remote vmspace uvm_io
==> add support for non-curproc rumpuser_sp_copyin/out
==> store remote context in vm_map->pmap instead of
pthread_specificdata

In short, makes read/write of most (all?) block devices work from
a remote rump client via rump syscalls.


# 1.51 19-Nov-2010 pooka

Pass routines necessary for multithreaded operation down to rumpuser_sp.


Revision tags: uebayasi-xip-base4
# 1.50 04-Nov-2010 pooka

bump rumpuser version


# 1.49 04-Nov-2010 pooka

Refactor the sysproxy code so that rumpuser contains only the server side.


# 1.48 01-Nov-2010 pooka

Missed a few symbols in previous ...

Also, reorganize rumpuser header inclusion to make sure problem is
caught already by the compiler.


# 1.47 01-Nov-2010 pooka

Make librumpuser linkage once again free of librump.

problem pointed out by <he>


# 1.46 27-Oct-2010 pooka

Start rework of system call proxying over socket ("sysproxy").
This incarnation is written in the user namespace as opposed to
the previous one which was done in kernel namespace. Also, rump
does all the handshaking now instead of excepting an application
to come up with the user namespace socket.

There's still a lot to do, including making code "a bit" more
robust, actually running different clients in a different process
inside the kernel and splitting the client side library from librump.
I'm committing this now so that I don't lose it, plus it generally
works as long as you don't use it in unexcepted ways: i've tested
ifconfig(8), route(8), envstat(8) and sysctl(8).


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.45 09-Jun-2010 pooka

Version rumpuser ABI with a lightweight mechanism.


# 1.44 09-Jun-2010 pooka

Add the ability to specify a preferred address the "map anon memory"
hypercall.


# 1.43 01-Jun-2010 pooka

Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there. Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().


# 1.42 31-May-2010 pooka

Support KTHREAD_JOINABLE/kthread_join(). Also fixes earlier bug
where all pthreads were created non-detached.


# 1.41 18-May-2010 pooka

Make it possible to use the scheduler lock as the rumpuser condvar
interlock. This is applicable in cases where the actual interlock
is the CPU the currently running thread is scheduled on. Borrowing
the scheduler lock as the mutex mandated by pthread_cond_wait()
does away with need to have an additional mutex. This both optimizes
runtime execution and simplifies code, as the extra lock typically
lead to quite some trickeries to avoid the dungeon collapsing due
to zaps from the wand of deadlock.


Revision tags: uebayasi-xip-base1
# 1.40 28-Apr-2010 pooka

Add rumpuser interface to fetch number of host cpus.


# 1.39 21-Apr-2010 pooka

Add rumpuser_kill, which sends a signal to a host process.


Revision tags: yamt-nfs-mp-base9
# 1.38 05-Mar-2010 pooka

branches: 1.38.2;
During bootstrap, process all modinfos in a DSO in one go. Get
rid of dependency tricks, since they are no longer necessary.


# 1.37 01-Mar-2010 pooka

Introduce RUMP_COMPONENT. It behaves mostly like a simplified
module which is linked into the kernel and cannot be unloaded.
The main purpose is to get the proper constructors run and create
any /dev nodes necessary for said component. Once more of the
kernel (e.g. networking stack and device drivers) are converted to
MODULE and devfs pops up from somewhere, rump components can be
retired.


# 1.36 26-Feb-2010 pooka

Rename rumpuser_dl_module_bootstrap() to rumpuser_dl_bootstrap(),
since it hasn't been involved only with modules for quite a while now.


Revision tags: uebayasi-xip-base
# 1.35 23-Dec-2009 stacktic

branches: 1.35.2;
Fixed ukfs build on non-NetBSD system.


Revision tags: matt-premerge-20091211
# 1.34 26-Nov-2009 pooka

Build the kernel symbol table in rumpuser bootstrap and feed it to
the rump kernel. After this change it is possible to use the
in-kernel linker and rump_sys_modctl() to load kernel modules at
runtime.

Previously loading modules at runtime was possible only through
using the host system ld.so. Note that it is still preferred to
use shared libs when possible, since they are PIC and n virtual
kernels will only require one copy of r/o segments. However, when
there is no access to source code, a binary kernel module is the
only thing available ...


# 1.33 19-Nov-2009 pooka

Create async i/o "interrupt" thread from within the kernel so that
it gets a kernel thread context.


# 1.32 11-Nov-2009 pooka

Make rumpuser_cv_timedwait take two int64's instead timespec to
uncouple it from the timespec layout. Also, change return value
to zero for "timeout didn't expire" and non-zero for "timeout
expired". This decouples the interface from errno assignments.


Revision tags: jym-xensuspend-nbase
# 1.31 24-Oct-2009 pooka

Pass modinit to rumpuser_dl_module_bootstrap() as a function pointer
to avoid linker rump -> rumpuser -> rump dependency which is annoying
redundancy in static linking.


# 1.30 24-Oct-2009 pooka

unused rumpuser_realpath is really dead


# 1.29 15-Oct-2009 pooka

Add prototype for wait operation variants which do not drop any
resources (because they should be holding any in the first place).


# 1.28 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.27 24-Sep-2009 pooka

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.


# 1.26 21-Sep-2009 pooka

<sys/stdint.h> is a non-standard header, so include it only from
kernel code (where it will be included from the NetBSD kernel source
tree). Use <stdint.h> in userland namespace, i.e. when compiling
librumpuser.


Revision tags: yamt-nfs-mp-base8
# 1.25 02-Sep-2009 pooka

add rumpuser_net_setsockopt()


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.24 10-Jun-2009 pooka

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.


Revision tags: yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 jym-xensuspend-base
# 1.23 27-Apr-2009 pooka

branches: 1.23.2;
* 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


Revision tags: nick-hppapmap-base3 nick-hppapmap-base
# 1.22 26-Apr-2009 pooka

Bump maximum number of outstanding async i/o's to 1024, 128 can
fill up really fast.


# 1.21 07-Apr-2009 pooka

Make it possible to use VCHR devices again.


# 1.20 18-Mar-2009 pooka

* allow to specify PROT_READ/PROT_WRITE when mmapping a file
* add msync


Revision tags: nick-hppapmap-base2
# 1.19 28-Feb-2009 pooka

Remember to commit the rumpuser bits necessary for if_shm: mmaping
a file and waiting for writes to it.


# 1.18 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.17 26-Feb-2009 pooka

decouple from host struct iovec


# 1.16 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.15 07-Feb-2009 pooka

branches: 1.15.2;
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.


# 1.14 06-Feb-2009 pooka

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)


# 1.13 27-Jan-2009 pooka

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).


# 1.12 26-Jan-2009 pooka

Support getsockname() and getpeername() in rumpuser.

XXX: all these rumpuser_net routines passing sockaddr should use proplib.


# 1.11 23-Jan-2009 pooka

rumpuser_seterrno() to set errno from a rump kernel context.


# 1.10 23-Jan-2009 pooka

Support mmapping anonymous memory.
XXX: this is mainly for the benefit of correct alignment, but
MAP_ALIGNED() is not portable.


Revision tags: mjf-devfs2-base
# 1.9 08-Jan-2009 pooka

branches: 1.9.2; 1.9.4;
missed this in previous commit:

Explicitly pass a pointer to the kernel lock/unlock routines in
rumpuser init instead of magically relying on the linker giving us
the symbols.

thanks to uwe for pointing out


# 1.8 07-Jan-2009 pooka

more namespacing: rua -> rumpuser_aio


# 1.7 07-Jan-2009 pooka

Rename _rumpuser_malloc to rumpuser__malloc so that all exported
rumpuser symbols start with "rumpuser".
(no major bumps or compat will be provided)


# 1.6 05-Jan-2009 pooka

g/c unused rumpuser bswap routines


# 1.5 02-Jan-2009 pooka

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().


# 1.4 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


Revision tags: haad-dm-base haad-dm-base2 haad-nbase2 ad-audiomp2-base
# 1.3 25-Nov-2008 pooka

Support PRU_BIND / PRU_LISTEN / PRU_ACCEPT in sockin.


# 1.2 18-Nov-2008 pooka

Pass biodone() to rumpuser as a callback instead of hardcoding it.
Also, explicitly init rumpuser async io thread.


# 1.1 17-Nov-2008 pooka

Move rump public headers to include/rump