Home | History | Annotate | Download | only in librumpuser
History log of /src/lib/librumpuser/rumpuser.c
RevisionDateAuthorComments
 1.68  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.
 1.67  16-Aug-2015  pooka Fix return value inspection for clock_nanosleep() (not displayed in the
diff, need to look at the entire file for context).

from Robert Millan <rmh@freebsd.org> via rumpkernel-users
 1.66  27-Jul-2015  pooka Print the "halted\n" from previous commit to stdout, not stderr.

The putchar hypercall writes to stdout, so this change restores
the original "functionality" (which was not intended to change).

from gson, via tests
 1.65  24-Jul-2015  pooka Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.
 1.64  05-Nov-2014  pooka check clock_gettime() rv
 1.63  25-Jul-2014  justin Clean up error handling in rumpuser_init()
 1.62  22-Jul-2014  justin Clean up random implementation for librumpuser

Use /dev/urandom for platforms without arc4random, not srandom(),
deduplicate code, do not read excessive random bytes

Reviewed by pooka@
 1.61  10-Jul-2014  justin Reinstate include of netdb.h, needed on some cross builds
 1.60  09-Jul-2014  justin Split out file and memory access in librumpuser

This allows alternate implementations to reuse these parts, and the file
parts will at the next hypercall revision be moved to their own driver.

Discussed with pooka@
 1.59  02-Apr-2014  pooka branches: 1.59.2;
Always use sysconf() to query host processor count instead of separate
tricks for each platform.
 1.58  16-Mar-2014  njoly Do not use uninitialized pointer if posix_memalign() fails.
 1.57  20-Feb-2014  pooka make implementation of rumpuser_kill() match the documentation
 1.56  20-Feb-2014  pooka Translate signal numbers between rump kernel and (POSIX) host.
 1.55  27-Oct-2013  rmind librumpuser: add some #ifdef __APPLE__ and missing bits to build it on OS X.
OK pooka@
 1.54  14-Aug-2013  pooka Change the default value of rump kernels CPUs to 2. It used to be
the number of host cores, but that value is overkill for most uses,
especially with massively multicore hosts. Dozens of useless virtual
CPUs are relatively speaking expensive in terms of bootstrap time and
memory footprint. On the other end of the spectrum, defaulting to 2
might shake out some bugs from the qemu test runs.
 1.53  15-May-2013  pooka Add a generalized rumpuser_syncfd() call which allows the caller
to request a sync or a barrier for fd.
 1.52  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.51  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.50  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.49  01-May-2013  pooka avoid Wunused on !NetBSD
 1.48  30-Apr-2013  pooka Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.
 1.47  30-Apr-2013  pooka Translate error codes between the hypervisor and rump kernel.
 1.46  30-Apr-2013  pooka Some systems don't provide preadv/pwritev (hi Solaris!), so implement
that with lseek + readv/writev instead (and avoid rewinding the
pointer with soon-to-be documentation).
 1.45  30-Apr-2013  pooka Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.
 1.44  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.43  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.42  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.41  29-Apr-2013  pooka Make the rump kernel upcalls which were previous available only to
the sysproxy module available for the entire hypervisor.
 1.40  29-Apr-2013  pooka RUMPUSER_OPEN_DIRECT is no longer necessary
 1.39  29-Apr-2013  pooka changes to bio hypercalls, part 3/n:

retire the filemmap/memsync hypercalls, they're no longer used
 1.38  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.37  28-Apr-2013  pooka don't need event.h here anymore
 1.36  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.35  28-Apr-2013  pooka make the file monitoring hypercalls private to shmif
 1.34  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.33  27-Apr-2013  pooka make the random hypercall more generic
 1.32  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.31  27-Apr-2013  pooka rumpuser_poll() is used only by sockin, so make the hypercall
private to that component.
 1.30  27-Apr-2013  pooka * integrate rumpuser_getversion() with the hypervisor initialization
* rename some identifiers to better match reality
 1.29  18-Mar-2013  pooka Terminate result of readlink(). Makes writefilewatch_setup() work in
cases when the buffer doesn't accidentally contain suitable zeroes.

Thanks to Juan RP who debugged this with me!
 1.28  14-Jan-2013  pooka Use the /proc way for counting host cores on Cygwin.
 1.27  10-Jan-2013  pooka .. and make it compile on said platforms.
 1.26  10-Jan-2013  pooka Provide an implementation of writewatchfile for platforms without kqueue
or inotify (it's a rather simple implementation ;)
 1.25  14-Dec-2012  pooka FreeBSD and DragonFly also provide hosts cpus via sysctl hw.ncpu.
 1.24  13-Dec-2012  pooka Apparently MAP_ANON mmap() on Linux requires MAP_PRIVATE to be specified
for the addr parameter to have a sane effect. Make it so.
 1.23  18-Nov-2012  pooka Fixes for Solarisa.
 1.22  14-Nov-2012  pooka Check return value of ftruncate(). Some versions of gcc give
warnings if I don't.
 1.21  10-Oct-2012  pooka Implement the writewatchfile routines for a Linux hypervisor. As a
result, the shmif network driver now works when hosted on Linux.
 1.20  14-Sep-2012  pooka Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.
 1.19  25-Aug-2012  pooka branches: 1.19.2;
Make librumphijack compile and work on Linux. Do not try to hijack
calls which are not supported on Linux and therefore cannot be
handled by the rump kernel side syscall emulation (not that they'd
be present in the calling binaries anyway).
 1.18  27-Jul-2012  pooka Once again, make the rump kernel hypercall layer work on Linux.
 1.17  25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.16  28-Nov-2011  tls 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.
 1.15  06-Feb-2011  pooka branches: 1.15.4;
Support query of the partition size in case underlying device is
a wedge. This still lacks the proplibistic query of the sector
size and just assumes 512. It's good that we make asking a file's
size as simple as requiring one stat(), one open() and three (3)
different ioctls plus some proplist mumbojumbo. I'm surprised it's
available at all by means other than #wish.

code mostly from Taylor R Campbell, rant from me.
 1.14  22-Jan-2011  pooka happiness is a quiet lint
 1.13  20-Jan-2011  pooka include pid of rump server in hostname
 1.12  05-Jan-2011  pooka branches: 1.12.2;
Fix fd leak also in non-NetBSD code path.
 1.11  05-Jan-2011  wiz Fix fdleak in error case. Found by cppcheck.
 1.10  15-Nov-2010  pooka Make int *error and optional parameter (i.e. it can be NULL).
Sometimes the caller just doesn't care which errno close() might
throw.
 1.9  11-Aug-2010  pooka * if kevent() fails with EINTR, try again instead of returning an error
* stuff rumpuser_dprintf to stderr instead of stdout
 1.8  09-Jun-2010  pooka Version rumpuser ABI with a lightweight mechanism.
 1.7  09-Jun-2010  pooka Add the ability to specify a preferred address the "map anon memory"
hypercall.
 1.6  02-Jun-2010  pooka Check return value of posix_memalign ... always helpful to not return
garbage memory in case of failure.
 1.5  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.4  28-Apr-2010  pooka Add rumpuser interface to fetch number of host cpus.
 1.3  21-Apr-2010  pooka Actually, support rumpuser_kill() only on NetBSD, since signal
numbers may not match on non-NetBSD hosts.
 1.2  21-Apr-2010  pooka Add rumpuser_kill, which sends a signal to a host process.
 1.1  26-Feb-2010  pooka librumpuser is not _KERNEL code and does not belong in sys. Move
the source files from src/sys/rump/librump/rumpuser to src/lib/librumpuser
(from where it is already built). Even so, keep rumpuser.h in
sys/rump/include for kernel source tree self-containment.
 1.12.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.15.4.5  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.4.4  23-Jan-2013  yamt sync with head
 1.15.4.3  16-Jan-2013  yamt sync with (a bit old) head
 1.15.4.2  30-Oct-2012  yamt sync with head
 1.15.4.1  17-Apr-2012  yamt sync with head
 1.19.2.4  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.2.3  23-Jun-2013  tls resync from head
 1.19.2.2  25-Feb-2013  tls resync with head
 1.19.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.59.2.1  10-Aug-2014  tls Rebase.

RSS XML Feed