Commit Graph

796 Commits

Author SHA1 Message Date
mrg
fcc023545e - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
2009-03-29 01:02:48 +00:00
ad
d16d704d62 PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
   is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.
2009-03-21 14:41:29 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
9fca5da616 ansify function definitions 2009-03-15 15:55:51 +00:00
rmind
f54234d142 Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.

Fixes PR/40490.  Reviewed by <ad>.
2009-02-23 20:28:58 +00:00
njoly
77237e1c08 Regen for wait4 update. 2009-01-17 22:34:02 +00:00
njoly
25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
njoly
b615dfc4d8 Rengen for compat50 update. 2009-01-15 23:50:35 +00:00
njoly
7345858afe Update some syscalls/arguments to use the new compat50 equivalents. 2009-01-15 23:48:50 +00:00
pooka
5d19acad62 Regen to prove I didn't screw up the conversion: purely RCSID changes. 2009-01-13 22:33:08 +00:00
pooka
a9a2ce837b Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat).  Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
2009-01-13 22:27:43 +00:00
pooka
e0330adb61 regen 2009-01-13 21:20:29 +00:00
pooka
33883e2a6d Somehow i doubt linux_sys_recvmsg() returns size_t. Make it ssize_t.
(XXX: the actual implementation returns int)
2009-01-13 21:19:51 +00:00
pooka
bb5f9edebf regen for #include "opt_compat_netbsd.h" 2009-01-13 19:45:38 +00:00
rtr
21e966491f actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
2009-01-13 04:31:12 +00:00
rtr
b198a0fd79 regen for christos_time_t merge 2009-01-12 11:53:23 +00:00
tsutsui
8a2b8ba767 Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
2009-01-11 13:00:25 +00:00
tsutsui
4f0ae35127 Update for compat_50 stuff. (compile test only) 2009-01-11 12:59:34 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
njoly
6709281d18 Move si_code definitions from MD to MI linux_siginfo.h, all archs
(except mips for 3 values) are identical.
While here, remove unused/unneeded LINUX__SI_CODE macro. Only the
lower 16-bits are used for userland si_code.
2008-11-23 23:48:48 +00:00
ad
1ab7ca8fdc PR port-amd64/39964 modules/compat_linux: missing symbols on amd64 2008-11-20 09:26:06 +00:00
ad
e157b99c7c Regen. 2008-11-19 18:39:43 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
njoly
2b470c165e Regen for futex timeout argument cleanup/fix. 2008-11-19 13:11:15 +00:00
njoly
377975c175 futex(2) timeout argument cleanup/fix.
- Use `struct linux_timespec', converted to native structure.
- Ensure that provided values are correct.
- Replace timeval+tvtohz by tstohz.
2008-11-19 13:09:19 +00:00
ad
7369e64e54 LINUX_GCC_SIGNATURE also matches NetBSD/i386 ELF binaries, so disable it. 2008-11-17 13:03:42 +00:00
ad
7dbfda5cca Unneeded ifdef 2008-11-14 15:56:17 +00:00
njoly
7712a0fc6c Regen for nanosleep(2) fix. 2008-11-12 18:09:22 +00:00
njoly
cf19223289 Fix nanosleep(2) on 64-bit archs. Do not call native nanosleep
syscall, but rather a modified version the will take care of `struct
timespec' conversions.
2008-11-12 18:07:40 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
christos
e4b18f1168 populate init_thread_area. 2008-10-28 18:37:41 +00:00
jmcneill
1b69e667f6 Need opt_multiprocessor.h for MULTIPROCESSOR definition. 2008-10-26 22:33:03 +00:00
christos
fbc6c6a8e6 changes from pengo that make initializing skype more reliable. 2008-10-26 20:46:05 +00:00
christos
3ce1cee82d regen. 2008-10-26 20:26:53 +00:00
christos
b5a45a5fad catch up with i386 changes. 2008-10-26 20:25:49 +00:00
christos
1b9e833438 multiprocessor fixes, from rmind 2008-10-26 20:22:01 +00:00
christos
1b618d0f6e use a symbolic constant instead of 6. 2008-10-26 17:57:49 +00:00
christos
60485d403e use GUGS_SEL instead of 3. 2008-10-26 17:42:37 +00:00
christos
68a065aac1 regen 2008-10-26 16:38:41 +00:00
christos
5dfa1e6b4a futex support fixes from FreeBSD via cube+pengo. 2008-10-26 16:38:22 +00:00
ad
49169f6211 Assert that the segment descriptors we generate for TLS will not allow
privilege elevation.
2008-10-26 11:02:14 +00:00
christos
a893abf3f5 regen 2008-10-26 03:44:04 +00:00
christos
86f314b4bf don't forget the percpu stuff and load gs immediately. 2008-10-26 03:43:42 +00:00
christos
47ab401cc8 fix include order; machdep needs to be first for LINUX_NPTL to be defined. 2008-10-26 02:00:57 +00:00
christos
f6382710ee Add preliminary tls support for i386. Does not work yet. From FreeBSD. 2008-10-25 23:38:28 +00:00
njoly
d05df800a8 Do not use native_to_linux_si_code() outside LINUX_NPTL; until i
figure a better way to handle it.
2008-10-21 21:52:29 +00:00
njoly
beff3f7516 Remove LINUX_SI_xxx from MI siginfo.h, that should not have been
committed. Rather add them to amd64 MD header.
Fix compilation failures on non x86 archs.
2008-10-21 20:24:15 +00:00
njoly
d7732b5cc7 Add native to linux siginfo si_code translation, mostly for negative
values. Adjust amd64 and i386 accordingly, not sure about aother archs
i can't test.
2008-10-19 09:44:31 +00:00