Martin Lucina [Sun, 28 Dec 2014 17:12:40 +0000 (18:12 +0100)]
Implement wall clock time (rumprun-xen issue #13)
This change adds minios_clock_wall() as a global symbol to return wall
clock time from Xen. I did not reinstate the minios "gettime()" which is
available upstream as that relies on a definitition of struct timeval.
minios_monotonic_clock() is renamed to minios_clock_monotonic() for
consistency.
rumpuser_clock_gettime() is updated to support RUMPUSER_CLOCK_REWALL,
returning wall clock time.
All rumphyper calls to the minios NOW() macro are replaced with calls to
the properly namespaces minios_clock_monotonic().
Martin Lucina [Mon, 15 Dec 2014 21:02:27 +0000 (22:02 +0100)]
Mini-OS: netfront: Fix rx ring starvation in network_rx
In network_rx() we must push the same amount of requests back onto the
ring in the second loop that we consumed in the first loop. Otherwise
the ring will eventually starve itself of free request slots and no
packets will be delivered.
Martin Lucina [Fri, 12 Dec 2014 17:28:42 +0000 (18:28 +0100)]
Mini-OS: Add monotonic_clock to minios_ namespace
This is needed by rumphyper_base, among other things. Unclear how it is
possible that the build was working until now, separating the Mini-OS
and rumprun build systems exposed this.
Martin Lucina [Fri, 12 Dec 2014 17:18:50 +0000 (18:18 +0100)]
Extricate rumprun build system from Mini-OS
Moves the Mini-OS Makefile and associated bits to xen/, separating the
rumprun and Mini-OS build systems. This will hopefully prepare us better
for (possibly) merging with upstream Mini-OS.
Further changes arising from this:
- All minios and rumprun object files are now built under obj/
- MiniOS build installs the arch-specific ldscript under
obj/xen/minios.lds
- Rather than separately specifying the arch-specific startfile in
app-tools specs we link it into the final minios.o and use that as the
startfile.
The advantage of this approach is we no longer have to "hunt" for the
startfile _OR_ the arch-specific lib in the top-level Makefile. It
does mean the resulting application has a different memory layout due
to link order but this should not matter.
Martin Lucina [Wed, 3 Dec 2014 16:25:01 +0000 (17:25 +0100)]
app-tools: Remove useless objcopy from stunt ld
Discussed with Ian previously; the objcopy step was left over from
previous attempts at namespacing mini-os and is no longer required as
this is performed when linking minios.o.
Martin Lucina [Sun, 23 Nov 2014 21:02:12 +0000 (22:02 +0100)]
rumprun: Use blkid rather than file to detect fstype
The output of file differs between systems (and Linux distribution
versions!). Use blkid for now to detect block device filesystem type,
will need to be revisited or marked as a dependency on e2fsprogs for
*BSD.
Martin Lucina [Sun, 23 Nov 2014 20:58:19 +0000 (21:58 +0100)]
rumprun: Make diskspec backward compatible with Xen 4.1
Xen 4.1 is used in Debian stable; the diskspec used by xl is not clearly
documented and is just a passthrough to the xm disk stanza. We need mode
'w' rather than 'rw' which is also understood by (at least) Xen 4.4.
Martin Lucina [Fri, 14 Nov 2014 16:37:06 +0000 (17:37 +0100)]
Rename rumprun-xen to rumprun
To reflect the intent to support different stacks in future (eg. kvm),
rumprun-xen is renamed to just rumprun, with a mandatory STACK as its
first argument.
Martin Lucina [Thu, 13 Nov 2014 10:40:08 +0000 (11:40 +0100)]
Configure rumprun-xen application stacks from Xenstore
In order to run rumprun-xen applications that are actually useful, we
need to be able to configure block devices and network interfaces.
These changes implement a basic mechanism to do this using Xenstore.
Conceptually the changes consist of the following parts which work
together:
- The rumpconfig module provides _rumprun_config() and
_rumprun_deconfig() functions. These are called before and after the
application main() function, and also in the case of deconfig when
_exit() is called.
- These functions rely on keys like the following being present in
Xenstore at the time the domain is started:
- The "xr" driver script, currently located in app-tools/. The
motivation for this script is twofold:
Firstly, in order to write the configuration to Xenstore the domain
must be created in a paused state so that we can retrieve its unique
<domid>. Only then do we know where in Xenstore to write the
configuration data.
Secondly, it is my intention with this work to provide a
"docker-alike" interface for running rumprun applications. The "xr"
script is therefore the CLI for running such applications.
Note that in this initial version, only configuring IPv4 network
interfaces with DHCP is supported, and only using image files with ffs
or cd9660 filesystems for block devices is supported.
Martin Lucina [Tue, 11 Nov 2014 15:11:46 +0000 (16:11 +0100)]
rumpuser_exit(), _exit(): Cleanly halt Mini-OS.
rumpuser_exit() and _exit() were calling minios_do_exit() which is
intended to be called from an exception context and/or other "panic"
situation. This was causing the stack trace code in minios_do_exit() to
walk off into never never land when the rumprun-xen application called
exit() or returned from main().
This commit adds a new minios_do_halt(reason) function, with the reason
code intended to mirror SHUTDOWN_* in xen/sched.h. Of those, currently
only poweroff and crash are implemented.
We then modify the rumpuser_exit() and _exit() functions to correctly
shut down the domain by calling minios_stop_kernel() followed by
minios_do_halt(MINIOS_HALT_POWEROFF).
Martin Lucina [Fri, 7 Nov 2014 17:14:50 +0000 (18:14 +0100)]
Localize all non-public Mini-OS symbols
Pass 3 of X in Mini-OS namespace cleanup.
We define a set of prefixes in the Makefile for the symbol namespaces we
wish to keep. Then, when linking minios.o we use objcopy to localize all
other symbols. Note the sole exception of the arch-specific startup file
(x86_64.o) as this is used as the linker %startfile.
Martin Lucina [Fri, 7 Nov 2014 16:52:39 +0000 (17:52 +0100)]
Clean up Mini-OS public namespace
Pass 2 of X in cleaning up Mini-OS namespace:
- All Mini-OS functions called by rumprun-xen are renamed to minios_* or
_minios_* for strictly internal functions, except those in the
blkfront_*, netfront_*, pcifront_* and xenbus_* driver namespaces.
- In the case of drivers, eg. init|shutdown_blkfront are renamed to
blkfront_*.
- All global variables are either manually made local, or placed under
the _minios_* namespace, with the exception of HYPERVISOR_shared_info,
and those variables under driver namespaces kept above.
- All callers are updated to use the new names. Where it makes sense,
macros such as alloc_page are also renamed into the minios_ namespace.
Martin Lucina [Thu, 6 Nov 2014 16:11:24 +0000 (17:11 +0100)]
Build Mini-OS and rump kernel middleware as discrete objects
In order to be able to make Mini-OS symbols local using objcopy we need to
build Mini-OS as a discrete relocatable object. While we're here, put the
various rump kernel middleware (libc stubs, rumphyper implementation)
into its own object file also.
Martin Lucina [Thu, 6 Nov 2014 16:06:46 +0000 (17:06 +0100)]
Clean up x86_64.o entry point namespace
This is pass 1 of X of cleaning up mini-os symbol namespace:
- Namespace all globals in x86_64.o (except _start) as _minios_XXX.
- Fix dependent calling code to use the new namespace
(hypercall-x86_64.h, sched.h, xen/arch/x86/*.c).
Martin Lucina [Thu, 6 Nov 2014 09:58:25 +0000 (10:58 +0100)]
Remove old demo from build, add simple hello-world test
In preparation for cleaning up minios/xenos to resolve (among other
things) symbol namespacing issues, remove the old non-app-tools-based
demo from the build.
As a temporary replacement add in a simple (not configure-based) "Hello,
world!" in tests/hello.
Martin Lucina [Thu, 30 Oct 2014 15:28:18 +0000 (16:28 +0100)]
stunt ld: Drop (LTO) -plugin and -plugin-opt from ld command
With (at least) GCC 4.9 on Debian jessie the GCC spec files have changed
to always use -plugin / -plugin-opt and load the LTO plugin, even if
-flto is not specified to GCC.
This breaks stunt ld which does not understand these options. Dropping
them from the linker command appears to do no harm.
Antti Kantee [Thu, 24 Jul 2014 12:17:06 +0000 (12:17 +0000)]
Pull in latest rumpsrc for symbol aliasing improvements.
E.g. select is now available also as select, instead of as __select50
which is renamed using sys/select.h. this fixes e.g. configure scripts
which do not include headers.
Antti Kantee [Thu, 24 Jul 2014 08:55:39 +0000 (08:55 +0000)]
Speed up app-configure by a factor of many.
This is done by not linking in the full rump kernel at the configure
stage. A cross-configure configure script will only do compile tests and
it does not really care about what is present in the kernel. Since all
of the "libc" bits are in librump (apart from ones we handle directly on
top of minios), just linking in librump at the configure stage is enough.