Commit Graph

123 Commits

Author SHA1 Message Date
pooka
4adce8f663 Use the /proc way for counting host cores on Cygwin. 2013-01-14 21:04:15 +00:00
pooka
e0f5e00388 Support Cygwin as a hypervisor. 2013-01-14 21:00:16 +00:00
pooka
44ba88ce59 .. and make it compile on said platforms. 2013-01-10 19:14:12 +00:00
pooka
a8f9daedd7 Provide an implementation of writewatchfile for platforms without kqueue
or inotify (it's a rather simple implementation ;)
2013-01-10 19:13:04 +00:00
pooka
1f06a056c7 FreeBSD and DragonFly also provide hosts cpus via sysctl hw.ncpu. 2012-12-14 10:48:48 +00:00
pooka
9a4570ee22 Apparently MAP_ANON mmap() on Linux requires MAP_PRIVATE to be specified
for the addr parameter to have a sane effect.  Make it so.
2012-12-13 15:35:09 +00:00
pooka
4c7d25c0e6 Support binaries which use DT_GNU_HASH instead of DT_HASH. 2012-12-11 21:16:22 +00:00
pooka
4fd1e9198b fix previous 2012-11-26 20:03:40 +00:00
pooka
48528ba2e9 One more thing required by DragonFly 2012-11-26 19:57:24 +00:00
pooka
149f3bccf4 Support DragonFly BSD. 2012-11-26 17:55:11 +00:00
pooka
0d8e694036 PTHREAD_PROCESS_SHARED private doesn't seem to work on DragonFly, so
init the spin lock _PRIVATE (we don't really care which it is).
2012-11-26 17:54:51 +00:00
pooka
303e3a3aa0 FreeBSD fixes.
from philip@freebsd.org
2012-11-26 17:03:15 +00:00
pooka
23a1592d75 const poison is the cure 2012-11-26 17:00:54 +00:00
pooka
2f56710909 Since SA_SETLEN() is used only for sockaddr_in, convert it to SIN_SETLEN()
to avoid compiler whining on breaking strict aliasing rules.
2012-11-26 16:30:14 +00:00
pooka
0163bf03f8 satisfy the slightly more picky clang 2012-11-22 21:23:08 +00:00
pooka
b65f40a8c1 export register_t to rump kernel users on solaris 2012-11-21 17:41:27 +00:00
pooka
6530621714 Fixes for Solarisa. 2012-11-18 19:29:40 +00:00
pooka
2b783d7193 Check return value of ftruncate(). Some versions of gcc give
warnings if I don't.
2012-11-14 09:22:58 +00:00
pooka
88593a2335 Actually define the klock/unlock pointers. Not having the storage
allocated for them created "interesting" effects with one compiler setup.
2012-11-06 18:33:00 +00:00
pooka
57b62be432 one more routine 2012-11-06 18:31:14 +00:00
pooka
2c32a204a7 implement mutex_owner() 2012-11-02 16:55:02 +00:00
pooka
cc24ac78d4 need rumpuser_mutex_init_kmutex() these days 2012-11-02 13:31:26 +00:00
pooka
8083a2e226 Start restoring the ability to run rump kernels on non-threading
hypervisors.

Step 1: make this compile again (it's not complete, but
at least it compiles).
2012-11-02 11:11:27 +00:00
pooka
edf42f21f8 Implement the writewatchfile routines for a Linux hypervisor. As a
result, the shmif network driver now works when hosted on Linux.
2012-10-10 11:15:57 +00:00
pooka
6bc4679626 call pthread_setname_np() on Linux too. 2012-10-08 18:02:04 +00:00
pooka
bf01f875b4 For the rumpsp protocol, don't assume that the bit representation of
errnos match on the client and server platforms (the syscall subprotocol
errnos are handled by the server compat code).
2012-09-21 14:33:03 +00:00
pooka
8b5f6f3669 Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.
2012-09-14 16:29:21 +00:00
pooka
82e980c205 More fixes for Linux (or glibc, really). 2012-09-03 11:33:35 +00:00
pooka
c62329f7d3 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).
2012-08-25 18:00:06 +00:00
pooka
3b3ffd7039 Once again, make the rump kernel hypercall layer work on Linux. 2012-07-27 09:09:05 +00:00
abs
9e66e6d75e Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2012-06-25 22:32:43 +00:00
matt
fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
joerg
a65b1aeb01 Disable reduced stack for now. It creates fallout I'm not willing to
deal with.
2012-03-09 21:03:09 +00:00
tls
f27d6532f5 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.
2011-11-28 08:05:05 +00:00
joerg
70b0796a0d Ensure that rumpuser_thread_exit doesn't return. 2011-05-23 20:49:08 +00:00
pooka
f347b4496a make work on nb5 again 2011-03-22 22:27:33 +00:00
njoly
603f3daee7 Convert hashtab to Elf_Symindx type, and use it directly to get symbol
count. Remove now unused GETVECWORDn macro.

This is needed to make it work on alpha which use non-standard 64bit
values for the symbol hash table section, unlike all other archs.
2011-03-16 11:44:01 +00:00
pooka
00e34b229c Use sendmsg() instead multiple calls to sendto(). It behaves
slightly better in the multithreaded exec case in terms of partial
frames sent.  Plus, it's theoretically a little cheaper.

There's still a gray area with partial transfer from sendmsg(),
but I'm not sure I care enough about some academic scenario to
start fixing it (it basically needs an OOB exec signaller).
2011-03-08 15:34:37 +00:00
pooka
91240244df Nuke all threads belonging to a process calling exec before allowing
the exec handshake to return.

In addition to being The Right Thing To Do, fixes some nasty
conditions for CLOEXEC fd's (or at least does so in theory, I
couldn't create any problems although I tried).
2011-03-08 12:39:28 +00:00
pooka
20446f99b9 return correct value when reading a short frame 2011-03-08 10:02:01 +00:00
pooka
fc3b823359 use nwork-adjusted amount of idle workers to decide is they are truly idle. 2011-03-07 21:57:15 +00:00
pooka
3129d3ab75 Cleanup server socket before sending back "ok" for halt. Fixes
some occasionally-seen race conditions in tests which do server
restarts (e.g. the raidframe tests).
2011-02-15 16:10:41 +00:00
pooka
5e301bc45b support HANDSHAKE_EXEC 2011-02-15 10:37:07 +00:00
pooka
2ba7fe5525 A bunch of changes which essentially make sshd work with a hijacked
rump tcp/ip stack:

* sshd likes to fork and then re-exec itself
  ==> trap execve() and augment the env with the current parameters
      essential to a rump kernel (kernel communication fd, information
      about dup2'd file descriptors)

* sshd likes to play lots of games with pipes, socketpairs and dup{,2}()
  ==> make sure we do not close essential rump client descriptors:
      dup() them to a safe place, except for F_CLOSEM where we
      simply leave them alone.  also, partially solved by the above,
      make sure the process's set of rump kernel descriptors persists
      over exec()

* sshd likes to chdir() before exec
  ==> for unix-style rump_sp(7) sockets save the full path on the
      initial exec and use it afterwards.  thread the path through
      the environment in execve()
2011-02-14 14:56:23 +00:00
pooka
8e6ede8c05 Turn the "idle workers available" from a flag into a counter so
that we can finally avoid all races (*knock knock*).
2011-02-08 11:21:22 +00:00
pooka
15fa3c8c84 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.
2011-02-06 21:05:53 +00:00
pooka
627ff529aa Fix a race condition in the worker thread caching logic: if we got
two or more syscall requests before any worker thread ran, we might
not have enough threads to handle the requests.  In some scenarios
this could lead to a deadlock.
2011-02-06 18:25:48 +00:00
yamt
7597b0c1e6 fix indent. no functional changes. 2011-02-05 13:51:56 +00:00
pooka
dac4423feb Pass the value of getprogname() from the client to the server and
record it in p_comm.  This is nice for things like sockstat, since
they now display the client command name:

pain-rustique:43:~> rump.sockstat
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     xulrunner- 16     0 tcp    192.168.2.114.65507   204.152.190.12.80
root     xulrunner- 16     1 tcp    192.168.2.114.65501   204.152.190.12.80
root     xulrunner- 16     2 tcp    192.168.2.114.65500   204.152.190.12.80
root     xulrunner- 16     3 tcp    192.168.2.114.65499   204.152.190.12.80
root     xulrunner- 16     5 tcp    192.168.2.114.65498   204.152.190.12.80
root     xulrunner- 16     6 tcp    192.168.2.114.65497   204.152.190.12.80
root     socket     62     0 tcp6   *.http                *.*
root     socket     62     1 tcp    *.http                *.*
root     socket     63     0 tcp6   *.81                  *.*
root     socket     63     1 tcp    *.81                  *.*
2011-01-28 19:21:28 +00:00
pooka
19a57922d0 Add reconnect code to librumpclient. In case the connection to
the kernel server is lost, the client will now automatically attempt
to reconnect.

Among other things, this makes it possible to "reboot" and restart
the TCP/IP stack from under firefox without any perceivable less
of service.  If pages were loading at the time the TCP/IP server
was killed, there may be some broken links, but nothing a ctrl-r
cannot fix.
2011-01-24 17:47:51 +00:00