Commit Graph

14750 Commits

Author SHA1 Message Date
pooka ba7613308e Fix LE softfloat (mostly theoretical) and comment.
from Alessandro Forin
2011-02-25 11:53:07 +00:00
pooka 8c15d641b0 Fix static fallback path. 2011-02-24 14:22:04 +00:00
pooka b8eb9b59e8 Make the rumphijack dlsym trampoline call from rumpclient a "real"
function call instead of a call through a function pointer.
Apparently powerpc ld.elf_so gets __hackish_return_address() wrong
if the call is done through a function pointer (digging deeper into
that stuff is beyond my interest).

Thanks to riz for providing access to a macppc for debugging.
Unthanks to the broken toolchain in the default installation which
wasted approximately 4 hours of time last night.
2011-02-24 12:25:44 +00:00
pooka e1463ae3cd Die with a sensible error message if a symbol cannot be found. 2011-02-24 09:52:34 +00:00
joerg 1631a78097 Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-02-24 04:28:41 +00:00
pooka edac4b359f duh, remember to cvs add hijack.h too...
from pgoyette
2011-02-23 18:18:24 +00:00
pooka 7e61a6ce53 Return value audit: properly set errno and return -1.
Fixes at least cross-kernel mv(1).
2011-02-23 15:44:38 +00:00
pooka 2350034b27 +access(2) 2011-02-23 15:29:21 +00:00
pooka 247a92b203 Put the dlsym-from-this-object trampoline into a separate source
module which is compiled -fno-optimize-sibling-calls instead of
trying to fool the optimizer in various ways in the trampoline.

thanks to yamt for the tip
2011-02-23 15:23:15 +00:00
skrll 1548def5e3 Remove old hack for broken binutils. 2011-02-23 10:26:09 +00:00
tron fb1591b100 Remove "NOLINT" setting that was apparently committed by accident and
breaks the build.
2011-02-22 17:32:49 +00:00
pooka 27ec9b9d1d Add support for a byteswapped disklabel so that I can mount
NetBSD/sparc anita images on my i386.
2011-02-22 15:42:15 +00:00
pooka 97c20c765b Disable string aliasing for rump_syscalls.c. I can't figure out
how to otherwise make the kernel's register_t coreography to work
with the return value here in a MI fashion.
2011-02-22 14:02:54 +00:00
joerg 9674b81ed9 Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.
2011-02-22 05:45:05 +00:00
christos 10e6f9749d remove duplicate weak aliases 2011-02-21 22:07:44 +00:00
pooka a63f48d68d If minfd for F_DUPFD is >= hijackoff, assume it means a minimum
value in the rump kernel and adjust accordingly.
2011-02-21 20:11:56 +00:00
pooka b1f4a8807b disallow mmap(MAP_FILE) from a rump kernel fd 2011-02-21 13:19:35 +00:00
pooka dc0a4e21dd Actually, we need both lseek and _lseek so that out-of-libc references
go to the right place instead of directly to __lseek.  Seeking in
mplayer works now.
2011-02-21 12:55:21 +00:00
pooka 463ea53fc5 hijack:
1) {,f,l}chflags (used e.g. by cp(1))
  2) p{read,write}{,v} (used by many)
2011-02-21 12:51:06 +00:00
pooka 611baabe1a xfer rump_server(1), downgrade experimentalness level a bit 2011-02-21 08:50:45 +00:00
pooka aa7f369f19 v-node -> vnode
(for consistency)
2011-02-21 07:11:11 +00:00
joerg 4bf46019d9 Redo the SSP wrappers to be transparent on the resulting object files.
This works by having the inline wrapper calling a second function which
uses renaming to output the correct function name.
2011-02-21 00:40:07 +00:00
pooka 3c9255c1a2 fix tests/lib/librumphijack/t_asyncio:invafd -- dual poll on invalid fd 2011-02-20 23:47:04 +00:00
pooka d9a5e73fe5 minor clarification 2011-02-20 14:21:04 +00:00
pooka 6d9d147305 fix symlink pathname examination (rationale-to-joerg: so that it works) 2011-02-19 19:17:33 +00:00
pooka 9c67a5d8a0 hijack __getcwd() 2011-02-19 13:10:35 +00:00
pooka bfd70564a0 and now with less crazy whitespace 2011-02-19 13:09:40 +00:00
pooka 9cb130af6b support PF_OROUTE and PF_MPLS where available 2011-02-19 13:07:53 +00:00
joerg e189b01ad3 Support the different weakref semantic in GCC 4.2 and clang. 2011-02-18 23:41:57 +00:00
joerg 86df96f692 Allow building with the changed weakref semantic in GCC 4.2 and clang. 2011-02-18 23:37:36 +00:00
christos 01d6c84859 PR/44599: Steven Vernon: libedit acts as if no data read if editmode is turned
off because nread is uninitialized in the edit disabled case.
2011-02-18 20:53:05 +00:00
pooka 5191458a1c hijack libc-internal name for lseek so that libc-internal callers
go to the right kernel too.
2011-02-18 19:27:06 +00:00
pooka 4674f09289 I think I skipped the class where they taught that multiplication
is done before addition...
2011-02-18 16:22:10 +00:00
pooka f836d17195 Improve isrmt() check: it cannot be a rmt fd if there are no pipes
open for the fd.  Prevents collision with rumphijack.

Also, prevent potential hyperspace memory access.

Does someone want to write tests for this facility?
2011-02-18 16:10:09 +00:00
pooka c0f2e1965c block cross-kernel rename in the other direction also 2011-02-18 14:44:46 +00:00
pooka ff90450826 fix rename 2011-02-18 14:33:11 +00:00
pooka b8883bd5ec uhm, put PF_LOCAL on the socketlist 2011-02-18 14:25:04 +00:00
pooka 0e29006e71 give the signmonkey a banana 2011-02-18 13:04:52 +00:00
pooka c89b586dc4 Document .Ev RUMPHIJACK 2011-02-18 12:22:46 +00:00
pooka 45c58b6c6a Use the env variable RUMPHIJACK to specify what facilities should
be hijacked.  If it's not specified, the default is
"path=/rump,socket=all:nolocal".

So, if you're moof and want to relive your domain/os days (??),
you can do this:

pain-rustique:51:~> setenv RUMPHIJACK 'path=//'
pain-rustique:52:~> df //dev
Filesystem   1K-blocks       Used      Avail %Cap Mounted on
rumpfs                1          1          0 100% /
pain-rustique:53:~> df /dev
Filesystem   1K-blocks       Used      Avail %Cap Mounted on
/dev/wd0a       1019864     280640     688232  28% /
2011-02-18 11:41:32 +00:00
pooka aedd7db813 Support rest of file types in vtype -> s_ifmt 2011-02-17 17:55:36 +00:00
pooka 7379975cf9 Support mount/unmount too. So, things are now generally at a stage
where you can mount a file system with a userspace server *without*
it having to go through puffs.

Say, you first start a server with ffs capability and map a host
ffs image into it:

	rump_server -lrumpvfs -lrumpfs_ffs \
	    -d key=/ffsimg,hostpath=ffs2.img,size=e unix:///tmp/ffsserv

Then, configure your shell to talk to the rump server:

	setenv RUMP_SERVER unix:///tmp/ffsserv
	setenv LD_PRELOAD /usr/lib/librumphijack.so

Create a mountpoint and mount the file system:

	pain-rustique:60:~> sh
	$ cd /rump
	$ ls
	dev
	$ ls -l
	total 1
	drwxr-xr-x  2 root  wheel  512 Feb 17 18:00 dev
	$ mkdir mnt
	$ mount_ffs /ffsimg /rump/mnt
	mount_ffs: Warning: realpath /ffsimg: No such file or directory
	$ df -h mnt
	Filesystem        Size       Used      Avail %Cap Mounted on
	/ffsimg           496M       380M        91M  80% /mnt
	$ du -sckh *
	192K    dev
	380M    mnt
	381M    total
	$ umount -R mnt
	$ df -h mnt
	Filesystem        Size       Used      Avail %Cap Mounted on
	rumpfs            1.0K       1.0K         0B 100% /
	$

(note, you need -R to umount due to various degrees of unsuccesful
magic it attempts to perform without it)
2011-02-17 17:18:08 +00:00
wiz cd90032d22 Use more appropriate markup. Fix a typo. 2011-02-17 17:03:17 +00:00
joerg 6f7bc0c1ed Deal with changes in the weak_reference semantic in GCC 4.2 and later. 2011-02-17 16:44:48 +00:00
pooka 78bedf0f20 st_blocks is in units of DEV_BSIZE, not st_blksize.
from Derrik Pates
2011-02-17 15:41:34 +00:00
pooka b4ff8b5f63 In case dup2(n, n+FDOFF) is done, the caller thinks there are two
distinct file descriptors, but the rump kernel thinks they are both
the same.  Now, if either one is closed by the application, "both"
will be closed in the rump kernel.  To fix this, maintain an
alias-mask.  It's not a perfect solution, though (consider e.g.
F_SETFL).  Maybe we should actually dup the fd and maintain a
mapping table?

Also, prevent the host from opening file descriptors onto the places
in the fd namespace that have been dupped.

These together fix "cat < /rump/foo" in a hijacked /bin/sh.
(the first one makes sure stdin is open in cat and the second one
makes sure it doesn't try to cat something from /usr/share/locale
instead of stdin)
2011-02-17 15:20:10 +00:00
pooka df19bb20b9 fix signature. from pgoyette 2011-02-17 12:52:33 +00:00
pooka 4d5a38cb17 Hijack pathname-based system calls. Now all paths starting with
/rump are hijacked to go to the rump server.  So you can e.g. start
a hijacked shell and cd to /rump:

$ cd /rump
$ pwd
/rump
$ ls -l dev/null
crwxr-xr-x  1 root  wheel  2, 2 Feb 17 12:35 dev/null
$ ls -l /dev/null
crw-rw-rw-  1 root  wheel  2, 2 Dec 22  2009 /dev/null
$ chmod 0 /dev/null
chmod: /dev/null: Operation not permitted
$ chmod 0 dev/null
$ ls -l /rump/dev/null
c---------  1 root  wheel  2, 2 Feb 17 12:35 /rump/dev/null

(of course the rump server must have vfs loaded for that to work)
2011-02-17 12:23:58 +00:00
pooka cd3bc9a153 sprinkle a few references (just a diet sprinkling really) 2011-02-16 23:51:50 +00:00
pooka 2e866e7646 add some excuse of a manpage for librumpclient 2011-02-16 23:45:40 +00:00
tron aa934b7969 Include "sys/null.h" to get the definition of NULL. 2011-02-16 22:35:41 +00:00
tron f1f20d6adf Fix build with SSP enabled. 2011-02-16 20:20:25 +00:00
pooka f8af939582 fix signature of rumpclient_fork() 2011-02-16 19:58:01 +00:00
pooka 246da2148a document RUMPHIJACK_RETRYCONNECT 2011-02-16 19:46:42 +00:00
pooka 2e5776377c * set default server connection retry to 0 (no reconnection attempts).
while for some cases attempting retry after server restart works
  brilliantly (e.g. firefox), in other cases it's quite disasterous
  (sshd doesn't like its file descriptors going missing and does not
  attempt to reopen them, leading to a quite catastophic loop of
  EBADF once the server does come back)
* rename RUMPHIJACK_RETRY to the slightly more sensible
  RUMPHIJACK_RETRYCONNECT
2011-02-16 19:26:58 +00:00
pooka 36f6818061 Support vfork. Add rumpclient wrapper for daemon(3). 2011-02-16 17:56:46 +00:00
pooka f4ba3dcd9e Push the fiddly tasks for exec and fork from rumphijack to rumpclient.
This makes it possible easily execute those operations also from
non-hijacked rump clients (plus fixes one memory leak in an error
branch).
2011-02-16 15:33:46 +00:00
christos c464e0ebc5 Fix non-fortify build. 2011-02-15 16:29:09 +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 172a314918 dup() is now implemented using fcntl() 2011-02-15 14:01:52 +00:00
pooka 8b62780ace Properly implement fcntl commands: F_DUPFD, F_CLOSEM, F_MAXFD 2011-02-15 13:59:28 +00:00
pooka 5e301bc45b support HANDSHAKE_EXEC 2011-02-15 10:37:07 +00:00
matt 9fbae4ec6b Add -D_KMEMUSER to CPPFLAGS 2011-02-14 18:27:24 +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
christos 26104203c2 Don't forget to set errno. Pointed out by yamt. 2011-02-13 23:58:40 +00:00
matt 12923fd008 Need to build libsaslc 2011-02-12 22:24:40 +00:00
pooka b981a177b2 Fix select() if no fds are set.
patch from Alexander Nasonov, PR lib/44552
2011-02-12 10:25:46 +00:00
pooka 84d55c436c play the important typecast game 2011-02-11 14:02:12 +00:00
pooka 7f4c3562b7 ssh mostly ignores the return value of select(), so if the timeout
expired it would assume that all input set descriptors had activity.

In case we get rv == 0 from the poll backend, zero out the fd sets
to signal that in fact no descriptors have activity.

Before this commit ssh was "jittery" when run through a rump tcp/ip
stack (interactive sessions kept blocking on stdin and you had to
"peddle" the connection).  Now it works smoothly ... or at least
smoothly enough so that this commit could be done through a rump
tcp/ip stack:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     ssh        125    0 tcp    localhost.65517       cvs.netbsd.org.22
2011-02-11 12:46:41 +00:00
matt 5f8868401d Make liblzf and the lvm2 libraries during the library stage. This also makes
them get built for MKCOMPAT.
2011-02-10 20:57:22 +00:00
blymn 01cc4b6151 Fix typo. 2011-02-10 08:54:12 +00:00
pooka 82aa883702 The following happens when sending mail with mutt via a rump
TCP/IP stack:

* mutt prepares to exec the smtp client: it forks and closes all
  file descriptors
* when the next networking syscall is done, rumpclient detects that
  the communication fd returned EBADF and does a reconnect,
  gets descriptor 0 for the socket and descriptor 1 for kqueue
* mutt opens the mail file and implicitly assumes it'll get 0-2,
  but in fact gets 2-4
* mutt execs the smtp agent which tries to read the mail from
  stdin (rumpclient communication socket) and fails

Even if mutt correctly did dup2() things would go south when trying
to communicate with the kernel server the next time, since rumpclient
would actually be talking with some mail body instead (well, it
could work, but in that case you'd need to write *really* weird
mails ;).

Hence, prevent rumpclient from using the special fd's 0-2 for its
purposes.

Should fix mutt problem reported by Alexander Nasonov.
2011-02-09 14:29:58 +00:00
pooka 79b560da8c Don't do highestFD check with USE_POLL. It provides no benefit
but causes a dependency between RLIMIT_NOFILE and rumphijack FDOFF.

christos ok
2011-02-09 09:46:59 +00:00
pooka 8ffa45b220 Fix pasto, use GETSYSCALLS() where possible 2011-02-08 19:12:54 +00:00
pooka 8331b66064 Make sure we can do host kevent since the -current (and recent nb5)
libc resolver uses it.  Error out in case of rump fd kevent (TODO).
Fixes one more problem pointed out by Alexander Nasonov.

Also, implement dup().
(TODO: implement it along the fcntl path too)
2011-02-08 14:45:35 +00:00
pooka 0d0ce98254 add std dprint to fdcall 2011-02-08 12:20:11 +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
wiz 49efa429e3 Improve a bit. 2011-02-08 09:49:07 +00:00
haad 83425a0f36 Initial import of libdm and dmctl to tree. libdm library can be used
to access, manage and manipulate device-mapper driver. Which opens us bunch
of new possibilities like

	dm-multipath device target
	dm-crypt     device target
	dm-ccd 	     compatibility layer

With this import I'm bringing in dmctl tool for working with dm driver ,too.
I plan to replace gpl2 licensed dmsetup command with our dmctl tool in near
feature. It can also by placed to /rescue where we was not able to put
dmsetup because of licensing problems.

With libdm in tree we can now write RUMP atf test suite for dm driver to
ensure LVM subsystem stability as time goes.

Reviewed by: blymn@ and rmind@
Oked: by no objections on tech-userlevel@
2011-02-08 03:20:13 +00:00
matt af25d173e6 Distinguish between a corrupt obj pointer and a null obj pointer. 2011-02-08 02:03:13 +00:00
matt 8f55cdd3bd First pass at new crtstuff for powerpc. Doesn't quite work yet
(obj parameter to ___start seems to get corrupted sometimes)
2011-02-08 02:02:25 +00:00
pooka 4adc7d0ea6 add some notes on access control 2011-02-07 22:04:36 +00:00
joerg 2c39cf5f91 Don't define weak aliases in the SMALL case. They conflict with the real
function name since SMALL doesn't use the normal rename logic.
2011-02-07 21:39:47 +00:00
pooka 6aea514dcb Force gcc to generate a stack frame for the call to dlsym(RTLD_NEXT).
Without this hack at least amd64 -O2 just used jmp and The Wrong
Thing happened.
2011-02-07 19:34:39 +00:00
pooka 8235557106 malloc/free aren't async-signal-safe, so avoid calling them when
signals aren't blocked.

this bug made tests/rump/rumpkern/t_sp:sigsafe rarely deadlock
2011-02-07 15:25:41 +00:00
pooka 58bfec3ee0 make sure we don't use "fullset" before we init it 2011-02-07 14:49:53 +00:00
pooka be04c94c6d types.h for time_t 2011-02-07 14:49:32 +00:00
pooka ac3cf3ec89 duh, _sys_read, not read. STAY FIXED, DAMNIT! 2011-02-07 12:23:05 +00:00
pooka 46b90f129d Unbreak the ssp lossage from the default -current build by removing
it.  I still don't have any idea what the ssp stuff is supposed to
do and how it's supposed to even begin to work.  If someone wants
to change this now, run tests/lib/librumphijack before commit so
that I can avoid another multihour debugging session!
2011-02-07 11:51:02 +00:00
pooka 847a170bc4 call the non-compat pollts() from inside the library 2011-02-07 10:28:18 +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
pooka b5dd289bbd make it possible to specify client connection retry model in
RUMPHIJACK_RETRY
2011-02-06 15:48:20 +00:00
pooka 065ac12ba8 Add another connection retry model which simply does exit(1) if
the connection is severed.
(mostly for tests so that everything can be hooked to rump_server's exit)
2011-02-06 15:43:20 +00:00
pooka 9f3861f636 Make sure to close parent's server communication socket after fork. 2011-02-06 15:41:37 +00:00
pooka c4359a17f8 be kinder about kqueue()
(but paradoxically omit the surprise)
2011-02-06 13:05:19 +00:00
christos 6f4121938f Add the actual function files. From FreeBSD via Stathis Kamperis 2011-02-06 01:53:38 +00:00
christos e60f59b973 remquo{,f} from FreeBSD via Stathis Kamperis 2011-02-06 00:44:08 +00:00
pooka 54828d050f uncommit part of previous which wasn't supposed to change 2011-02-05 16:59:24 +00:00
pooka 23134bfed1 Wrap daemon() since it forks. Otherwise we lose the rumpclient kq
descriptor and have multiple processes using the commfd.
2011-02-05 16:57:39 +00:00
yamt 7597b0c1e6 fix indent. no functional changes. 2011-02-05 13:51:56 +00:00
pooka fe247b6f0a Fix some snafus to allow rumphijack to work on -current.
reported by Alexander Nasonov
2011-02-05 12:38:19 +00:00
wiz 6ef76bc469 Remove trailing whitespace. 2011-02-05 00:24:08 +00:00
christos 6f31775ce6 bump for arc4random_{buf,uniform} 2011-02-04 22:07:41 +00:00
christos a52c04784a add arc4random_{buf,uniform}, from OpenBSD. 2011-02-04 22:07:07 +00:00
christos 41ed061fdf PR/44514: Andrey Simonenko: Buffer underflow in RPC library for non-blocking
TCP sockets
2011-02-04 17:38:15 +00:00
christos 4a4722163b knf - no functional changes 2011-02-04 17:36:54 +00:00
matt 90a7a07b86 Use RT_ROUNDUP instead of a private copy since that's what the kernel uses.
(t_getaddrinfo passes for both i386 (compat_netbsd32) and amd64 with this
change).
2011-02-04 02:01:12 +00:00
pooka c6e13b7874 fix prototype, document RUMP_ETFS_SIZE_ENDOFF 2011-02-03 10:21:58 +00:00
christos d7b3467511 PR/44505: Mark Davies: pam_exec fails to realloc enough space, while
there add a volatile variable (From FreeBSD)
2011-02-03 02:05:59 +00:00
rmind 4a8954eca9 npf_nat_create: fix attributes. 2011-02-02 15:17:37 +00:00
wiz d97c90f051 New sentence, new line. Mark up NULL. 2011-02-02 09:05:01 +00:00
rmind 07ac07d35f NPF checkpoint:
- Add libnpf(3) - a library to control NPF (configuration, ruleset, etc).
- Add NPF support for ftp-proxy(8).
- Add rc.d script for NPF.
- Convert npfctl(8) to use libnpf(3) and thus make it less depressive.
  Note: next clean-up step should be a parser, once dholland@ will finish it.
- Add more documentation.
- Various fixes.
2011-02-02 02:20:24 +00:00
christos bcb5ce2065 Fix emulation issue of SETVAL, and make the code look the same between the
two different versions.
2011-01-31 22:51:39 +00:00
christos 2d5180b4b9 add braces, per joerg. 2011-01-31 19:10:18 +00:00
drochner 953846fa39 use of .PARSEDIR just doesn't work with .OBJDIR, replace with .CURDIR 2011-01-31 17:54:20 +00:00
christos 984dfe5f9f bump down the recursion limit to 64. 2011-01-31 15:07:29 +00:00
christos ae8a4fc798 not everyone has fenv.c, pointed by Havard Eidnes 2011-01-31 15:06:01 +00:00
christos 0f6e9a96aa Limit recursions to avoid DoS attacks from Maksymilian Arciemowicz 2011-01-31 04:20:50 +00:00
christos 17b8402a39 fenv support for sparc64 from Stathis Kamperis 2011-01-31 00:19:33 +00:00
matt 0536d96d78 Fix type sigtramp_t -> sigtramp_2 2011-01-29 22:58:47 +00:00
matt 2599cc89ba Don't use r0 to restore LR, use r7 instead. 2011-01-29 02:21:20 +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
christos 28ef40ccbd fix pasto 2011-01-28 03:41:52 +00:00
christos b2ce31d086 don't turn on editing if stdout is not a tty. 2011-01-27 23:11:40 +00:00
pooka fd79a76046 Use NEEDED for librumpclient instead of loading it manually. 2011-01-27 18:12:19 +00:00
pooka e96a54f450 Set server reconnection timeout to infinite. There probably need
to be some toggle eventually, but for now I'm optimizing the default
for my firefox use ;)
2011-01-27 18:05:16 +00:00
pooka 41434db318 Allow to set a timeout for how long the client will attempt to
reconnect in case the connection to the server is lost.  Default
to exactly one reattempt.  This makes sense and additionally fixes
the dev/raidframe/smalldisk test which currently causes a server
panic when a certain raidctl command is run (without this fix the
test would timeout since the client kept attempting to reconnect).
2011-01-27 18:04:05 +00:00
njoly 5488d3a23f Add section 3 for getpwuid_r xref. 2011-01-26 22:00:45 +00:00
christos 4ffe9a1805 make the code more re-usable 2011-01-26 18:48:57 +00:00
christos 9a37731036 make SSP friendly 2011-01-26 18:48:32 +00:00
christos 74a83d351e Moving the ssp check inside the source code does not work properly because
the compiler loses information about the size of the object. So instead of
the hacky #define mess we did before, add a way to inject our function between
the user call and the system call.
2011-01-26 18:11:35 +00:00
pooka e6450adeb5 plug fd leak in reconnect code 2011-01-26 14:42:41 +00:00
pooka 5f7e80a834 Add support for the Extensible MIPS ("eMIPS") platform. The
NetBSD/emips port runs on Xilinx and Beecube FPGA systems and the
Giano system simulator.

eMIPS is a platform developed at Microsoft Research for researching
reconfigurable computing.  eMIPS allows dynamic loading and scheduling
of application-specific circuits for the purpose of accelerating
computations based on the current workload.

NetBSD eMIPS support for NetBSD 4.x was written at Microsoft Research
by Alessandro Forin and Neil Pittman.  Microsoft Corporation has
donated full copyright to The NetBSD Foundation.

Platform support for eMIPS is the first part of Microsoft's
contribution.  The second part includes the hardware accelerator
framework and will be proposed on tech-kern soon.
2011-01-26 01:18:43 +00:00
christos 13fe5bd280 Fix SSP build.
XXX: This is gross.
2011-01-25 19:13:26 +00:00
christos c5d359be42 make pthread__sp unsigned long. 2011-01-25 19:12:04 +00:00
pooka 8c818e7121 fix compilation on -current 2011-01-25 17:37:00 +00:00
pooka 8d51265b11 Use rump_sp consistently in chapter 7
nothing gets past the wizd, nothing.
2011-01-25 14:05:42 +00:00
pooka 46e9c4686a enable WARNS=4 2011-01-25 12:56:57 +00:00
pooka 493a9cc0b3 manual page for rumphijack 2011-01-25 12:56:25 +00:00
pooka f4ef6bac83 the usual fun for WARNS=4
signed,
  unsigned
2011-01-25 12:53:45 +00:00
pooka 14186479f2 dramatic whitespace fix 2011-01-25 12:21:36 +00:00
pooka 9d0409a087 Rewrite to declare most dual-kernel calls with macros. This helps
with adding new calls and makes all existing fd-accepting hijacked
calls dual-kernel.  It would be better to autogenerate the code
from syscalls.master, but this is easier for now.
2011-01-25 12:18:33 +00:00
matt 787e823fd1 Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
2011-01-25 02:38:15 +00:00
njoly 7ef8fa728e Redo Vt macro fixes (from r1.35) which were lost. 2011-01-24 19:37:35 +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
joerg 86b3b196ed Correctly define inta using a helper macro for the # 2011-01-23 14:08:53 +00:00
matt 6ab334853b Teach libkvm how kernel virtual memory is laided on 64-bit MIPS kernels. 2011-01-23 06:28:52 +00:00
matt 5ae5f9ae2e Instead of testing for all mips variants, just use MACHINE_CPU. 2011-01-23 06:27:32 +00:00
matt b09982f7da Use uintptr_t instead of u_long.
When fetching argc use off the stack, use *(long *) instead of *(int *)
because on mips64 BE system, that int deference will only fetch 0.
2011-01-23 06:25:57 +00:00