#
302964 |
|
17-Jul-2016 |
dchagin |
MFC r302517:
Fix a copy/paste bug introduced during X86_64 Linuxulator work. FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation use READ_IMPLIES_EXEC flag, introduced in r302515.
While here move common part of mmap() and mprotect() code to the files in compat/linux to reduce code dupcliation between Linuxulator's.
MFC r302518, r302626:
Add linux_mmap.c to the appropriate conf/files.
|
#
293600 |
|
09-Jan-2016 |
dchagin |
MFC r283544:
When I merged the lemul branch I missied kib@'s r282708 commit. This is not the final fix as I need properly cleanup thread resources before other threads suicide.
|
#
293575 |
|
09-Jan-2016 |
dchagin |
MFC r283474:
Rework signal code to allow using it by other modules, like linprocfs:
1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path.
2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals.
3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors.
4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers.
PR: 197216
|
#
293572 |
|
09-Jan-2016 |
dchagin |
MFC r283471:
According to Linux man sigaltstack(3) shall return EINVAL if the ss argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE. However, in fact, Linux also allows SS_ONSTACK flag which is simply ignored.
For buggy apps (at least mono) ignore other than SS_DISABLE flags as a Linux do.
While here move MI part of sigaltstack code to the appropriate place.
|
#
293551 |
|
09-Jan-2016 |
dchagin |
MFC r283446:
Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can access to the semop structs and functions.
|
#
293500 |
|
09-Jan-2016 |
dchagin |
MFC r283391:
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().
|
#
293493 |
|
09-Jan-2016 |
dchagin |
MFC r283383:
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.
|
#
293486 |
|
09-Jan-2016 |
dchagin |
MFC r283378:
Remove a now unused include.
|
#
293482 |
|
09-Jan-2016 |
dchagin |
MFC r283374:
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.
|
#
286308 |
|
05-Aug-2015 |
kib |
MFC r284921: pcb_gs32sd is unused for long time, remove it. Keep the padding in pcb.
|
#
283359 |
|
24-May-2015 |
kib |
MFC r282708: On exec, single-threading must be enforced before arguments space is allocated from exec_map.
|
#
280258 |
|
19-Mar-2015 |
rwatson |
Merge r263233 from HEAD to stable/10:
Update kernel inclusions of capability.h to use capsicum.h instead; some further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h.
Sponsored by: Google, Inc.
|
#
286308 |
|
05-Aug-2015 |
kib |
MFC r284921: pcb_gs32sd is unused for long time, remove it. Keep the padding in pcb.
|
#
283359 |
|
24-May-2015 |
kib |
MFC r282708: On exec, single-threading must be enforced before arguments space is allocated from exec_map.
|
#
280258 |
|
19-Mar-2015 |
rwatson |
Merge r263233 from HEAD to stable/10:
Update kernel inclusions of capability.h to use capsicum.h instead; some further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h.
Sponsored by: Google, Inc.
|