Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2010 20:02:06 +0100
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        Alexander Leidinger <netchild@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r215675 - head/sys/compat/linux
Message-ID:  <32292B2D-6D71-4AA5-A0AE-41E2D713293A@cederstrand.dk>
In-Reply-To: <201011221242.oAMCgW9O092144@svn.freebsd.org>
References:  <201011221242.oAMCgW9O092144@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


Den 22/11/2010 kl. 13.42 skrev Alexander Leidinger:

> Author: netchild
> Date: Mon Nov 22 12:42:32 2010
> New Revision: 215675
> URL: http://svn.freebsd.org/changeset/base/215675
> 
> Log:
>  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
> 
> Modified:
>  head/sys/compat/linux/linux_emul.c
> 
> Modified: head/sys/compat/linux/linux_emul.c
> ==============================================================================
> --- head/sys/compat/linux/linux_emul.c	Mon Nov 22 12:33:48 2010	(r215674)
> +++ head/sys/compat/linux/linux_emul.c	Mon Nov 22 12:42:32 2010	(r215675)
> @@ -198,11 +198,8 @@ linux_proc_exit(void *arg __unused, stru
> 	} 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, stru
> 	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

This breaks make buildkernel for me (8.1 RELEASE host):

/usr/home/erik/freebsd/head/src/sys/modules/linux/../../compat/linux/linux_emul.c: In function 'linux_proc_exec':
/usr/home/erik/freebsd/head/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: dereferencing pointer to incomplete type
/usr/home/erik/freebsd/head/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: 'SV_ABI_MASK' undeclared (first use in this function)

Erik

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32292B2D-6D71-4AA5-A0AE-41E2D713293A>