summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MFC r283415:dchagin2016-01-095-14/+36
| | | | Disable i386 call for x86-64 Linux.
* MFC r283414:dchagin2016-01-091-2/+9
| | | | Print out proper procmap entry for 64 bit binaries.
* MFC r283413:dchagin2016-01-092-122/+146
| | | | | 64-bit paltforms, like x86_64, do not use multiplexing on socketcall system calls.
* MFC r283412:dchagin2016-01-091-10/+9
| | | | | | 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.
* MFC r283411:dchagin2016-01-092-2/+0
| | | | | Remove stale comment about a signal trampoline which is moved to the shared page at r219609.
* MFC r283410:dchagin2016-01-096-22/+22
| | | | | Put linux_platform into the vdso to avoid copying it onto the stack at every exec.
* MFC r283408:dchagin2016-01-092-3/+0
| | | | Eliminate a now unused global declaration of elf_linux_sysvec.
* MFC r283407:dchagin2016-01-0916-79/+874
| | | | | | | | 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.
* Regen for r293511.dchagin2016-01-0910-16/+90
|
* MFC r283403:dchagin2016-01-095-4/+90
| | | | Implement pselect6() system call.
* Regen for r293510.dchagin2016-01-0910-14/+68
|
* MFC r283401:dchagin2016-01-096-6/+82
| | | | Implement prlimit64() system call.
* Regen for r293508.dchagin2016-01-0910-14/+58
|
* MFC r283399:dchagin2016-01-095-4/+23
| | | | Implement dup3() system call.
* MFC r283398:dchagin2016-01-091-0/+7
| | | | | Sched_rr_get_interval returns EINVAL in case when the invalid pid specified. This silence the ltp tests.
* Regen for r293505.dchagin2016-01-0910-14/+58
|
* MFC r283396:dchagin2016-01-096-4/+60
| | | | Implement rt_sigqueueinfo() system call.
* Regen for r293503.dchagin2016-01-0910-16/+80
|
* MFC r283394:dchagin2016-01-096-4/+74
| | | | Implement waitid() system call.
* Regen for r293501.dchagin2016-01-095-7/+7
|
* MFC r283392:dchagin2016-01-091-1/+1
| | | | struct l_rusage does not defined for i386 Linuxulator due to it's nature.
* MFC r283391:dchagin2016-01-096-70/+47
| | | | | | 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().
* MFC r283390:dchagin2016-01-092-1/+31
| | | | Add a function for converting wait options.
* MFC r283389:dchagin2016-01-092-26/+114
| | | | Add a siginfo_t conversion function.
* MFC r283388:dchagin2016-01-091-4/+0
| | | | Remove a now unused define.
* MFC r283386:dchagin2016-01-092-4/+15
| | | | | | 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.
* MFC r283385:dchagin2016-01-092-12/+12
| | | | Some style(9) && whitespaces fixes. No functional changes.
* MFC r283384:dchagin2016-01-091-1/+1
| | | | | | 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.
* MFC r283383:dchagin2016-01-0915-670/+551
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* To facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery).dchagin2016-01-091-5/+27
|
* MFC r283382:dchagin2016-01-0915-0/+24
| | | | | In preparation for switching linuxulator to the use the native 1:1 threads add a hook for cleaning thread resources before the thread die.
* MFC r283381:dchagin2016-01-091-0/+1
| | | | | In preparation for switching linuxulator to the use the native 1:1 threads add per thread emulator state data.
* Regen fro r293487.dchagin2016-01-0910-52/+76
|
* MFC r283379:dchagin2016-01-093-8/+80
| | | | | Implement a Linux version of sched_getparam() && sched_setparam(). Temporarily use the first thread in proc.
* MFC r283378:dchagin2016-01-091-1/+0
| | | | Remove a now unused include.
* MFC r283377:dchagin2016-01-092-24/+87
| | | | | | | | 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.
* Regen for r293483.dchagin2016-01-095-11/+17
|
* MFC r283375:dchagin2016-01-091-2/+2
| | | | | In preparation for switching linuxulator to the use the native 1:1 threads use MI linux_sched_rr_get_interval() in i386.
* MFC r283374:dchagin2016-01-094-19/+48
| | | | | | | | | | | 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.
* MFC r283373:dchagin2016-01-092-10/+20
| | | | | | 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().
* MFC r283372:dchagin2016-01-092-4/+11
| | | | | | | 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.
* Regen for r293478.dchagin2016-01-0910-22/+32
|
* MFC r283370:dchagin2016-01-093-4/+16
| | | | | | | | 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).
* MFC r283369:dchagin2016-01-092-4/+8
| | | | | 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.
* Bump __FreeBSD_version after utimensat merge made in r293473.dchagin2016-01-091-1/+1
|
* Regen for r293474.dchagin2016-01-0911-12/+174
|
* MFC r277610 (by jillies):dchagin2016-01-0916-7/+712
| | | | Add futimens and utimensat system calls.
* To facillitate an upcoming Linuxulator merging partiallydchagin2016-01-0913-61/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFC r292123: Document mps.enable_ssurpokala2016-01-091-2/+37
| | | | | | | | 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.
* MFC r291114: popen() requires check for fdopen() failurerpokala2016-01-091-10/+24
| | | | | | | | 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.
OpenPOWER on IntegriCloud