diff options
author | netchild <netchild@FreeBSD.org> | 2010-11-22 12:42:32 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2010-11-22 12:42:32 +0000 |
commit | 81eaf1c5874fd3b8b14321ec439cbaf24c2c4474 (patch) | |
tree | 460bd52c1fb7c3e4c753f95d66a5928d1b6efa74 /sys/compat/linux/linux_emul.c | |
parent | 316b5514e8e91207203d63d5842d786527a5b8b8 (diff) | |
download | FreeBSD-src-81eaf1c5874fd3b8b14321ec439cbaf24c2c4474.zip FreeBSD-src-81eaf1c5874fd3b8b14321ec439cbaf24c2c4474.tar.gz |
Do not take the process lock. The assignment to u_short inside the
properly aligned structure is atomic on all supported architectures, and
the thread that should see side-effect of assignment is the same thread
that does assignment.
Use a more appropriate conditional to detect the linux ABI.
Suggested by: kib
X-MFC: together with r215664
Diffstat (limited to 'sys/compat/linux/linux_emul.c')
-rw-r--r-- | sys/compat/linux/linux_emul.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index eb10ca6..b25d5ba 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -198,11 +198,8 @@ linux_proc_exit(void *arg __unused, struct proc *p) } else EMUL_SHARED_WUNLOCK(&emul_shared_lock); - if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0) { - PROC_LOCK(p); + if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0) p->p_xstat = shared_xstat; - PROC_UNLOCK(p); - } if (child_clear_tid != NULL) { struct linux_sys_futex_args cup; @@ -265,7 +262,8 @@ linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) if (__predict_false(imgp->sysent == &elf_linux_sysvec && p->p_sysent != &elf_linux_sysvec)) linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0); - if (__predict_false(p->p_sysent == &elf_linux_sysvec)) + if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) == + SV_ABI_LINUX)) /* Kill threads regardless of imgp->sysent value */ linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL); if (__predict_false(imgp->sysent != &elf_linux_sysvec |