| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Disable i386 call for x86-64 Linux.
|
|
|
|
| |
Print out proper procmap entry for 64 bit binaries.
|
|
|
|
|
| |
64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.
|
|
|
|
|
|
| |
Get ready to commit x86_64 Linux emulation.
All fields of type l_int in struct statfs are defined
as l_long on i386 and amd64.
|
|
|
|
|
| |
Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.
|
|
|
|
|
| |
Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.
|
|
|
|
| |
Eliminate a now unused global declaration of elf_linux_sysvec.
|
|
|
|
|
|
|
|
| |
Implement vdso - virtual dynamic shared object. Through vdso Linux
exposes functions from kernel with proper DWARF CFI information so that
it becomes easier to unwind through them.
Using vdso is a mandatory for a thread cancelation && cleanup
on a modern glibc.
|
| |
|
|
|
|
| |
Implement pselect6() system call.
|
| |
|
|
|
|
| |
Implement prlimit64() system call.
|
| |
|
|
|
|
| |
Implement dup3() system call.
|
|
|
|
|
| |
Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.
|
| |
|
|
|
|
| |
Implement rt_sigqueueinfo() system call.
|
| |
|
|
|
|
| |
Implement waitid() system call.
|
| |
|
|
|
|
| |
struct l_rusage does not defined for i386 Linuxulator due to it's nature.
|
|
|
|
|
|
| |
To reduce code duplication introduce linux_copyout_rusage() method.
Use it in linux_wait4() system call and move linux_wait4() to the MI path.
While here add a prototype for the static bsd_to_linux_rusage().
|
|
|
|
| |
Add a function for converting wait options.
|
|
|
|
| |
Add a siginfo_t conversion function.
|
|
|
|
| |
Remove a now unused define.
|
|
|
|
|
|
| |
Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead
of harcoded pr_osrelease, pr_osrel values. This will be used later in
the VDSO.
|
|
|
|
| |
Some style(9) && whitespaces fixes. No functional changes.
|
|
|
|
|
|
| |
pthread_join() caller do futex_wait on child_clear_tid. As a results
of multiple simultaneous calls to pthread_join() specifying the same
target thread are undefined wake up the one thread.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch linuxulator to use the native 1:1 threads.
The reasons:
1. Get rid of the stubs/quirks with process dethreading,
process reparent when the process group leader exits and close
to this problems on wait(), waitpid(), etc.
2. Reuse our kernel code instead of writing excessive thread
managment routines in Linuxulator.
Implementation details:
1. The thread is created via kern_thr_new() in the clone() call with
the CLONE_THREAD parameter. Thus, everything else is a process.
2. The test that the process has a threads is done via P_HADTHREADS
bit p_flag of struct proc.
3. Per thread emulator state data structure is now located in the
struct thread and freed in the thread_dtor() hook.
Mandatory holdig of the p_mtx required when referencing emuldata
from the other threads.
4. PID mangling has changed. Now Linux pid is the native tid
and Linux tgid is the native pid, with the exception of the first
thread in the process where tid and pid are one and the same.
Ugliness:
In case when the Linux thread is the initial thread in the thread
group thread id is equal to the process id. Glibc depends on this
magic (assert in pthread_getattr_np.c). So for system calls that
take thread id as a parameter we should use the special method
to reference struct thread.
|
| |
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads add a hook for cleaning thread resources before the thread die.
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads add per thread emulator state data.
|
| |
|
|
|
|
|
| |
Implement a Linux version of sched_getparam() && sched_setparam().
Temporarily use the first thread in proc.
|
|
|
|
| |
Remove a now unused include.
|
|
|
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads split sys_sched_getparam(), sys_sched_setparam(),
sys_sched_getscheduler(), sys_sched_setscheduler() to their kern_*
counterparts and add targettd parameter to allow specify the target
thread directly by callee.
|
| |
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads use MI linux_sched_rr_get_interval() in i386.
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval().
Add a kern_sched_rr_get_interval() counterpart which takes a targettd
parameter to allow specify target thread directly by callee (new Linuxulator).
Linuxulator temporarily uses first thread in proc.
Move linux_sched_rr_get_interval() to the MI part.
|
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads introduce kern_thr_alloc() which will be used later in the
linux_clone().
|
|
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit().
Move
Where the second will be used in linux_exit() system call later.
|
| |
|
|
|
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads introduce linux_exit() stub instead of sys_exit() call
(which terminates process).
In the new linuxulator exit() system call terminates the calling
thread (not a whole process).
|
|
|
|
|
| |
In preparation for switching linuxulator to the use the native 1:1
threads print the thread id in addition to the pid in debug messages.
|
| |
|
| |
|
|
|
|
| |
Add futimens and utimensat system calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MFC r275121 (by kib). Only merge the syntax changes from r275121,
PROC_*LOCK() macros still lock the same proc spinlock.
The process spin lock currently has the following distinct uses:
- Threads lifetime cycle, in particular, counting of the threads in
the process, and interlocking with process mutex and thread lock.
The main reason of this is that turnstile locks are after thread
locks, so you e.g. cannot unlock blockable mutex (think process
mutex) while owning thread lock.
- Virtual and profiling itimers, since the timers activation is done
from the clock interrupt context. Replace the p_slock by p_itimmtx
and PROC_ITIMLOCK().
- Profiling code (profil(2)), for similar reason. Replace the p_slock
by p_profmtx and PROC_PROFLOCK().
- Resource usage accounting. Need for the spinlock there is subtle,
my understanding is that spinlock blocks context switching for the
current thread, which prevents td_runtime and similar fields from
changing (updates are done at the mi_switch()). Replace the p_slock
by p_statmtx and PROC_STATLOCK().
Discussed with: kib
|
|
|
|
|
|
|
|
| |
mps(4) sends StartStopUnit to SATA direct-access devices during shutdown.
Document the tunables which control that behavior.
Approved by: jhb
Sponsored by: Panasas, Inc.
|
|
|
|
|
|
|
|
| |
Move fdopen() up near other resource allocation like malloc(); do proper
deallocation on failure later on in the function.
Approved by: jhb
Sponsored by: Panasas, Inc.
|