Commit Graph

14768 Commits

Author SHA1 Message Date
christos
5dc359e2dd Prepare for strnvis functionality by providing a length to the encoding
functions.
2011-03-12 03:24:08 +00:00
christos
29ba757a34 revert OOPS change now that most of the reasons for tgoto to return NULL
have been eliminated.
2011-03-11 13:28:52 +00:00
pooka
563593515e Use rumphijack_dlsym() to figure out where __sysctl() is during
init.  Otherwise powerpc dlsym() DTWT and returns NULL.
(now i have no idea why dlsym() it works from rcinit(), but i'll
opt to not care)

Hah, only took 15min to debug that crap this time around.  I'm
quickly approaching zero-time with it.
2011-03-10 23:02:56 +00:00
roy
df504c6413 Do our best to process invalid terminfo strings instead of just
returning NULL.
2011-03-10 13:39:26 +00:00
roy
9d7b5f143f Fix two other off-by-one errors when processing %P and %g commands. 2011-03-10 10:46:33 +00:00
roy
40109496d4 Add support for translating the following termcap commands into terminfo:
%B %D %r %2 %3 %d %+ %> %.
Fixes PR bin/44692.
2011-03-10 10:17:19 +00:00
pooka
3406bd8660 Revert 1.81 and do it in a saner way with an ifdef. Later, when
the naming crisis is resolved, we can probably support rump kernel
quotas from nb5 also.
2011-03-10 09:47:32 +00:00
roy
74cdc55234 Fix an off-by-one error when processing embedded values. 2011-03-10 09:45:32 +00:00
wiz
97b3b86219 Add serial commas. 2011-03-10 08:53:04 +00:00
joerg
3b9c90a96e Define namespace remap macros before including sys/tls.h. 2011-03-09 23:50:40 +00:00
pooka
bbc64bd6b0 document vfs and sysctl knobs to RUMPHIJACK 2011-03-09 23:40:44 +00:00
pooka
61f25f646e Make getfh() a pathcall instead of a fhcall. while it does pertain
to file handles, it still gets passed a path and we can DTRT based
on that.
2011-03-09 23:26:19 +00:00
joerg
aad599979d Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
2011-03-09 23:10:05 +00:00
pooka
9d51298cb8 Make this compile/work on NetBSD 5 once again. 2011-03-09 20:48:57 +00:00
bouyer
48c24921f2 Add quotactl(2) 2011-03-09 18:45:30 +00:00
bouyer
90848eb9f1 Fix last entries, make it work again. 2011-03-09 18:06:22 +00:00
tsutsui
7e1a38b9b3 Reorder insns to fix more load delay hazard botches on R3000.
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.
2011-03-09 16:10:29 +00:00
pooka
a7f297977b * use _exit() instead of exit() in retryconn=die: atexit() handlers
may hang if the server is dead
* consistent use of data
2011-03-09 15:09:21 +00:00
pooka
1af2e3a0a3 Add a bunch of process-wide hijack calls. Among other things, it's
now possible to use unmodified userspace binaries (rpcbind, mountd,
nfsd) to start a rump nfs service and mount file systems from it.

pain-rustique:42:~> mount
rumpfs on / type rumpfs (local)
10.1.1.1:/export on /mnt type nfs
2011-03-09 15:03:18 +00:00
pooka
a30ace437f g/c unused global 2011-03-09 09:17:12 +00:00
wiz
3bc5f349f0 Remove trailing whitespace. 2011-03-08 23:51:23 +00:00
pooka
7a2f6e5362 Enforce that the path=/rump specifier specifies and actual path
prefix and doesn't accept e.g. /rumpdev (only /rump/dev).
2011-03-08 21:36:01 +00:00
pooka
94372010ba clarify blanket operation a bit more 2011-03-08 21:09:18 +00:00
pooka
964221c99c maybe typo 2011-03-08 21:02:22 +00:00
pooka
f5d8571208 Add ``blanket''. It acts like path, except that the prefix does
_not_ get removed if the call goes to the rump namespace.

So, now it's possible to use e.g. tcpdump (and most other utilities
which hardcore a /dev pathname) on a rump kernel:

golem> setenv RUMPHIJACK blanket=/dev/bpf
golem> tcpdump -n -i virt0
tcpdump: WARNING: SIOCGIFADDR: virt0: Device not configured
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virt0, link-type EN10MB (Ethernet), capture size 96 bytes
21:55:38.925596 IP 192.168.2.101 > 204.152.190.12: ICMP echo request, id 47811, seq 0, length 64
21:55:39.095596 IP 204.152.190.12 > 192.168.2.101: ICMP echo reply, id 47811, seq 0, length 64

(if you additionally set socket=all in RUMPHIJACK, tcpdump doesn't
whine about the "not configured" interface)
2011-03-08 20:59:01 +00:00
pooka
57a486416f need -I${.OBJDIR} now 2011-03-08 19:11:27 +00:00
pooka
c057875f13 create srcsys symlink 2011-03-08 18:30:24 +00:00
pooka
d06a7e799a and for my next trick, i'm going to spell ARGSUSED correctly 2011-03-08 18:28:01 +00:00
pooka
e48cccc4df lint love 2011-03-08 18:25:16 +00:00
pooka
7905447e1d Since we ~never have a frame waiting on the initial call to waitresp,
call kevent before readframe.  Doesn't really affect performance,
but makes ktraces shorter ;)
2011-03-08 15:55:12 +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
mlelstv
c619be51ca Don't try to clean/build or install a library here, there are only
subdirectories.

Also, bsd.lib.mk requires a defined LIB, otherwise it will generate
unwanted commands during clean. It even failed on netbsd-4 where
'rm -f' needs at least one parameter which is missing due to recent
corrections in make/vars.c.
2011-03-08 09:49:42 +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
joerg
5c3ccd6eba Pass down ELF Auxillary Vectors for static NetBSD binaries too.
Rename __libc_init to _libc_init and call it explicitly from CSU code.
This enforces the constructor run order for newly linked programs.
Keep it as constructor with run-once semantic for binary compatibility.
Implement dl_iterate_phdr for statically linked programs.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-07 05:09:09 +00:00
christos
959ab2631c Restore historical behavior of tgoto() to return "OOPS" on failure. This is
best for now because there are too many programs that don't check the return
value of it. Of course cursor motion commands from $TERMCAP have 0 chance
of working now, since their % escapes are not translated to terminfo. In
the window case %+ expects one param from the stack in the termcap case
and two in the terminfo so we barf. We need proper captoinfo handling for
the % escapes, like the one in ncurses. Hi Roy :-)
2011-03-07 00:27:51 +00:00
wiz
9ef313636b Various fixes:
Remove trailing whitespace.
Sort sections.
Sort errors.
Fix typos.
Use more markup.
Probably something else I forgot.
2011-03-06 17:19:25 +00:00
bouyer
063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
christos
ce009e37f0 Check bits on each loop to prevent integer oveflow.
Reported by Maksymilian Arciemowicz
2011-03-06 16:00:20 +00:00
martin
49f1dcc8e5 While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
2011-03-06 10:32:47 +00:00
martin
598174eb2b Apply local namespace protection equivalent to the weak alias done
in softfloat-for-gcc.h, which we can't include here, to move
"float_exception_mask" into implementation namespace.
2011-03-06 10:27:37 +00:00
martin
a5ad420211 Use sigqueueinfo() instead of raise() to generate exceptions. Provide
minimalistic siginfo data.
2011-03-04 11:48:58 +00:00
yamt
5c50d59d8b puffs__cc_destroy: clear PCC_HASCALLER. the caller info is not
necessarily relevant to the next life of the cc.  this also fixes
the failure of the assertion in the next line.
2011-03-04 09:47:47 +00:00
christos
cf7b1c6bb2 PR/44663: Corinna Vinschen: Fix misplaced parenthesis that produces the wrong
result.
2011-03-02 13:24:43 +00:00
soda
fd45f5444a fuse_opt_parse() was using uninitialized struct fuse_opt_option::data,
this bug made fuse_opt_proc_t not work, if it used first ``data'' argument,
and might cause memory corruption even.
2011-03-01 11:23:42 +00:00
pooka
c6cd7e8f80 another comment 2011-03-01 10:54:06 +00:00
pooka
691e852f03 comment 2011-03-01 10:47:29 +00:00
wiz
055ec59523 Whitespace nit. 2011-03-01 08:48:41 +00:00
haad
6024239e67 Fix problems in libdm manual page pointed by njoly@ thanks for help. 2011-02-28 23:23:08 +00:00
pooka
060e3527df make compiler sign-happy 2011-02-28 20:39:07 +00:00
pooka
9ec87a7764 A simple dup2-enforced affine transformation isn't enough when
dealing with dup2() from a rump kernel fd to a host kernel fd.
Consider:

s1 = socket();
s2 = socket();
dup2(s2, 0);

Instead, maintain a real mapping table (and get on my knees and
pray i don't have to touch this hair-splitting code ever again).

Apparently bourne shell scripts from a rump kernel fs work now
(sh script.sh; ./script.sh doesn't work for obvious "IT'S THE WRONG
FS NAMESPACE" reasons).  No test regressions either, so I'm a
happy camper.
2011-02-28 19:57:36 +00:00
njoly
252a7f0f2e Small macro fix (SS -> Ss). 2011-02-28 09:10:28 +00:00
wiz
9e76b48586 Merge EINVAL descriptions; sort errors alphabetically; bump date. 2011-02-28 07:17:02 +00:00
dholland
4669b00fb3 Improve discussion of alignment and rounding per PR 33527. 2011-02-28 04:03:00 +00:00
pooka
ee6e286c6f Take reasonable precautions against init in a parent process
which did a rump-transparent host-only fork().
2011-02-27 12:58:29 +00:00
pooka
ee9b785d83 make error messages sensible. from uwe 2011-02-27 11:32:12 +00:00
christos
ebc56329ec Add <stdint.h> for uint8_t from Jess Thrysoee 2011-02-27 01:53:22 +00:00
christos
c0ee155271 Fix argument for EL_EDITOR from Jess Thrysoee 2011-02-27 01:51:37 +00:00
njoly
51cca89d16 Switch from floating point to fixed point integer for run sizes maths.
From FreeBSD (part of revision 1.154).
2011-02-26 23:27:49 +00:00
matt
2bf60042d7 When loading r13 and r2 with _SDA_BASE_ and _SDA2_BASE, do so in a PIC
manner.  With this change, simple programs can now run with MKPIE=yes
2011-02-26 17:11:23 +00:00
wiz
35124272d3 Remove duplicate "the". From Henning Petersen in PR 44640. 2011-02-26 12:56:35 +00:00
pooka
f70541ba1f whoops, didn't mean to delete futimes in previous. also from riz 2011-02-25 18:36:36 +00:00
pooka
b183f0392f support mknod. from riz 2011-02-25 18:29:00 +00:00
pooka
da73d5bcb9 Ok, for reasons I can't begin to understand, the binaries I tested
yesterday on powerpc broke overnight.  Apparently adding one more
function before the call to dlsym() fixes things again.  I hope
I don't have to add another one tomorrow ....
2011-02-25 16:01:41 +00:00
pooka
9e33d7d6e2 fix __RCSID 2011-02-25 15:12:06 +00:00
joerg
b7b592d544 Back out using the thread register (if present) for now.
libgcc_s's __register_frame_info gets called from libc's CSU code before
the libc constructors are run. __register_frame_info in turn calls
pthread_mutex_lock. libpthread is not initialised at this point and
therefore pthread__self() traps when deferencing the thread register.
This worked before because the garbage from pthread__self() is
effectively ignored.
2011-02-25 14:32:38 +00:00
pooka
74ed8d21f3 fix my whitespace copypaste 2011-02-25 11:55:28 +00:00
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