From owner-freebsd-emulation@FreeBSD.ORG Sun Feb 13 06:00:25 2011 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD3D110656B1 for ; Sun, 13 Feb 2011 06:00:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 907508FC12 for ; Sun, 13 Feb 2011 06:00:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1D60OE9016417 for ; Sun, 13 Feb 2011 06:00:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1D60O58016382; Sun, 13 Feb 2011 06:00:24 GMT (envelope-from gnats) Date: Sun, 13 Feb 2011 06:00:24 GMT Message-Id: <201102130600.p1D60O58016382@freefall.freebsd.org> To: freebsd-emulation@FreeBSD.org From: John Wehle Cc: Subject: Re: kern/149168: [linux] [patch] Linux sendmsg / recvmsg / etc fixes for pulseaudio X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Wehle List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 06:00:25 -0000 The following reply was made to PR kern/149168; it has been noted by GNATS. From: John Wehle To: avg@FreeBSD.org Cc: rdivacky@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: kern/149168: [linux] [patch] Linux sendmsg / recvmsg / etc fixes for pulseaudio Date: Sun, 13 Feb 2011 01:59:43 -0500 (EST) Enclosed is a slightly tweaked and lightly tested version. Changes from previous: 1) Modify linux/syscalls.master in i386 & amd64 instead of mucking a generated file. 2) For symmetry also ignore msg_controllen in linux_to_bsd_msghdr. -- John -----------------------8<----------------------------8<------------------ --- ./compat/linux/linux_misc.h.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/linux/linux_misc.h 2011-02-12 22:36:57.000000000 -0500 @@ -37,6 +37,8 @@ * Second arg is a ptr to return the * signal. */ +#define LINUX_PR_GET_KEEPCAPS 7 /* Get drop capabilities on setuid */ +#define LINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */ #define LINUX_PR_SET_NAME 15 /* Set process name. */ #define LINUX_PR_GET_NAME 16 /* Get process name. */ --- ./compat/linux/linux_misc.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/linux/linux_misc.c 2011-02-12 22:36:57.000000000 -0500 @@ -1733,6 +1733,87 @@ linux_exit_group(struct thread *td, stru return (0); } +#define _LINUX_CAPABILITY_VERSION 0x19980330 + +struct l_user_cap_header { + l_int version; + l_int pid; +}; + +struct l_user_cap_data { + l_int effective; + l_int permitted; + l_int inheritable; +}; + +int +linux_capget(struct thread *td, struct linux_capget_args *args) +{ + struct l_user_cap_header luch; + struct l_user_cap_data lucd; + int error; + + if (! args->hdrp) + return (EFAULT); + + error = copyin(args->hdrp, &luch, sizeof(luch)); + if (error != 0) + return (error); + + if (luch.version != _LINUX_CAPABILITY_VERSION) { + luch.version = _LINUX_CAPABILITY_VERSION; + error = copyout(&luch, args->hdrp, sizeof(luch)); + if (error) + return (error); + return (EINVAL); + } + + if (luch.pid) + return (EPERM); + + if (args->datap) { + bzero (&lucd, sizeof(lucd)); + error = copyout(&lucd, args->datap, sizeof(lucd)); + } + + return (error); +} + +int +linux_capset(struct thread *td, struct linux_capset_args *args) +{ + struct l_user_cap_header luch; + struct l_user_cap_data lucd; + int error; + + if (! args->hdrp || ! args->datap) + return (EFAULT); + + error = copyin(args->hdrp, &luch, sizeof(luch)); + if (error != 0) + return (error); + + if (luch.version != _LINUX_CAPABILITY_VERSION) { + luch.version = _LINUX_CAPABILITY_VERSION; + error = copyout(&luch, args->hdrp, sizeof(luch)); + if (error) + return (error); + return (EINVAL); + } + + if (luch.pid) + return (EPERM); + + error = copyin(args->datap, &lucd, sizeof(lucd)); + if (error != 0) + return (error); + + if (lucd.effective || lucd.permitted || lucd.inheritable) + return (EPERM); + + return (0); +} + int linux_prctl(struct thread *td, struct linux_prctl_args *args) { @@ -1766,6 +1847,11 @@ linux_prctl(struct thread *td, struct li (void *)(register_t)args->arg2, sizeof(pdeath_signal)); break; + case LINUX_PR_GET_KEEPCAPS: + td->td_retval[0] = 0; + break; + case LINUX_PR_SET_KEEPCAPS: + break; case LINUX_PR_SET_NAME: /* * To be on the safe side we need to make sure to not --- ./compat/linux/linux_socket.h.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/linux/linux_socket.h 2011-02-12 22:36:57.000000000 -0500 @@ -53,6 +53,7 @@ /* Socket-level control message types */ #define LINUX_SCM_RIGHTS 0x01 +#define LINUX_SCM_CREDENTIALS 0x02 /* Ancilliary data object information macros */ --- ./compat/linux/linux_socket.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/linux/linux_socket.c 2011-02-13 00:22:58.000000000 -0500 @@ -433,6 +433,8 @@ linux_to_bsd_cmsg_type(int cmsg_type) switch (cmsg_type) { case LINUX_SCM_RIGHTS: return (SCM_RIGHTS); + case LINUX_SCM_CREDENTIALS: + return (SCM_CREDS); } return (-1); } @@ -444,6 +446,8 @@ bsd_to_linux_cmsg_type(int cmsg_type) switch (cmsg_type) { case SCM_RIGHTS: return (LINUX_SCM_RIGHTS); + case SCM_CREDS: + return (LINUX_SCM_CREDENTIALS); } return (-1); } @@ -459,7 +463,7 @@ linux_to_bsd_msghdr(struct msghdr *bhdr, bhdr->msg_iov = PTRIN(lhdr->msg_iov); bhdr->msg_iovlen = lhdr->msg_iovlen; bhdr->msg_control = PTRIN(lhdr->msg_control); - bhdr->msg_controllen = lhdr->msg_controllen; + /* msg_controllen skipped */ bhdr->msg_flags = linux_to_bsd_msg_flags(lhdr->msg_flags); return (0); } @@ -472,7 +476,7 @@ bsd_to_linux_msghdr(const struct msghdr lhdr->msg_iov = PTROUT(bhdr->msg_iov); lhdr->msg_iovlen = bhdr->msg_iovlen; lhdr->msg_control = PTROUT(bhdr->msg_control); - lhdr->msg_controllen = bhdr->msg_controllen; + /* msg_controllen skipped */ /* msg_flags skipped */ return (0); } @@ -1092,6 +1096,7 @@ static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { struct cmsghdr *cmsg; + struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1099,15 +1104,14 @@ linux_sendmsg(struct thread *td, struct struct l_msghdr linux_msg; struct iovec *iov; socklen_t datalen; + struct sockaddr *sa; + sa_family_t sa_family; void *data; int error; error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); if (error) return (error); - error = linux_to_bsd_msghdr(&msg, &linux_msg); - if (error) - return (error); /* * Some Linux applications (ping) define a non-NULL control data @@ -1116,8 +1120,12 @@ linux_sendmsg(struct thread *td, struct * order to handle this case. This should be checked, but allows the * Linux ping to work. */ - if (msg.msg_control != NULL && msg.msg_controllen == 0) - msg.msg_control = NULL; + if (PTRIN(linux_msg.msg_control) != NULL && linux_msg.msg_controllen == 0) + linux_msg.msg_control = PTROUT(NULL); + + error = linux_to_bsd_msghdr(&msg, &linux_msg); + if (error) + return (error); #ifdef COMPAT_LINUX32 error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, @@ -1128,13 +1136,21 @@ linux_sendmsg(struct thread *td, struct if (error) return (error); - if (msg.msg_control != NULL) { + control = NULL; + cmsg = NULL; + + if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + error = kern_getsockname(td, args->s, &sa, &datalen); + if (error) + goto bad; + sa_family = sa->sa_family; + free(sa, M_SONAME); + error = ENOBUFS; cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); control = m_get(M_WAIT, MT_CONTROL); if (control == NULL) goto bad; - ptr_cmsg = LINUX_CMSG_FIRSTHDR(&msg); do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1147,18 +1163,46 @@ linux_sendmsg(struct thread *td, struct goto bad; /* - * Now we support only SCM_RIGHTS, so return EINVAL - * in any other cmsg_type + * Now we support only SCM_RIGHTS and SCM_CRED, + * so return EINVAL in any other cmsg_type */ - if ((cmsg->cmsg_type = - linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type)) == -1) - goto bad; + cmsg->cmsg_type = + linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); + if (cmsg->cmsg_type == -1 + || cmsg->cmsg_level != SOL_SOCKET) + goto bad; + + /* + * Some applications (e.g. pulseaudio) attempt to + * send ancillary data even if the underlying protocol + * doesn't support it which is not allowed in the + * FreeBSD system call interface. + */ + if (sa_family != AF_UNIX) + continue; + data = LINUX_CMSG_DATA(ptr_cmsg); datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + + switch (cmsg->cmsg_type) + { + case SCM_RIGHTS: + break; + + case SCM_CREDS: + data = &cmcred; + datalen = sizeof(cmcred); + + /* + * The lower levels will fill in the structure + */ + bzero(data, datalen); + break; + } + cmsg->cmsg_len = CMSG_LEN(datalen); - data = LINUX_CMSG_DATA(ptr_cmsg); error = ENOBUFS; if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg)) @@ -1166,9 +1210,11 @@ linux_sendmsg(struct thread *td, struct if (!m_append(control, datalen, (c_caddr_t) data)) goto bad; } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&msg, ptr_cmsg))); - } else { - control = NULL; - cmsg = NULL; + + if (m_length(control, NULL) == 0) { + m_freem(control); + control = NULL; + } } msg.msg_iov = iov; @@ -1193,9 +1239,11 @@ static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { struct cmsghdr *cm; + struct cmsgcred *cmcred; struct msghdr msg; struct l_cmsghdr *linux_cmsg = NULL; - socklen_t datalen, outlen, clen; + struct l_ucred linux_ucred; + socklen_t datalen, outlen; struct l_msghdr linux_msg; struct iovec *iov, *uiov; struct mbuf *control = NULL; @@ -1252,39 +1300,35 @@ linux_recvmsg(struct thread *td, struct goto bad; } - if (control) { + outbuf = PTRIN(linux_msg.msg_control); + outlen = 0; + if (control) { linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); - outbuf = PTRIN(linux_msg.msg_control); - cm = mtod(control, struct cmsghdr *); - outlen = 0; - clen = control->m_len; - while (cm != NULL) { + msg.msg_control = mtod(control, struct cmsghdr *); + msg.msg_controllen = control->m_len; + + cm = CMSG_FIRSTHDR(&msg); - if ((linux_cmsg->cmsg_type = - bsd_to_linux_cmsg_type(cm->cmsg_type)) == -1) + while (cm != NULL) { + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + if (linux_cmsg->cmsg_type == -1 + || cm->cmsg_level != SOL_SOCKET) { error = EINVAL; goto bad; } + data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; - switch (linux_cmsg->cmsg_type) + switch (cm->cmsg_type) { - case LINUX_SCM_RIGHTS: - if (outlen + LINUX_CMSG_LEN(datalen) > - linux_msg.msg_controllen) { - if (outlen == 0) { - error = EMSGSIZE; - goto bad; - } else { - linux_msg.msg_flags |= - LINUX_MSG_CTRUNC; - goto out; - } - } + case SCM_RIGHTS: if (args->flags & LINUX_MSG_CMSG_CLOEXEC) { fds = datalen / sizeof(int); fdp = data; @@ -1295,11 +1339,40 @@ linux_recvmsg(struct thread *td, struct } } break; + + case SCM_CREDS: + /* + * Currently LOCAL_CREDS is never in + * effect for Linux so no need to worry + * about sockcred + */ + if (datalen != sizeof (*cmcred)) { + error = EMSGSIZE; + goto bad; + } + cmcred = (struct cmsgcred *)data; + bzero(&linux_ucred, sizeof(linux_ucred)); + linux_ucred.pid = cmcred->cmcred_pid; + linux_ucred.uid = cmcred->cmcred_uid; + linux_ucred.gid = cmcred->cmcred_gid; + data = &linux_ucred; + datalen = sizeof(linux_ucred); + break; + } + + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + if (outlen == 0) { + error = EMSGSIZE; + goto bad; + } else { + linux_msg.msg_flags |= + LINUX_MSG_CTRUNC; + goto out; + } } linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); - linux_cmsg->cmsg_level = - bsd_to_linux_sockopt_level(cm->cmsg_level); error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); if (error) @@ -1312,18 +1385,13 @@ linux_recvmsg(struct thread *td, struct outbuf += LINUX_CMSG_ALIGN(datalen); outlen += LINUX_CMSG_LEN(datalen); - linux_msg.msg_controllen = outlen; - if (CMSG_SPACE(datalen) < clen) { - clen -= CMSG_SPACE(datalen); - cm = (struct cmsghdr *) - ((caddr_t)cm + CMSG_SPACE(datalen)); - } else - cm = NULL; + cm = CMSG_NXTHDR(&msg, cm); } } out: + linux_msg.msg_controllen = outlen; error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); bad: --- ./i386/linux/linux_dummy.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./i386/linux/linux_dummy.c 2011-02-12 22:36:57.000000000 -0500 @@ -57,8 +57,6 @@ DUMMY(vm86); DUMMY(query_module); DUMMY(nfsservctl); DUMMY(rt_sigqueueinfo); -DUMMY(capget); -DUMMY(capset); DUMMY(sendfile); /* different semantics */ DUMMY(setfsuid); DUMMY(setfsgid); --- ./i386/linux/syscalls.master.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./i386/linux/syscalls.master 2011-02-12 22:50:39.000000000 -0500 @@ -329,8 +329,8 @@ l_uid16_t uid, l_gid16_t gid); } 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ l_ulong bufsize); } -184 AUE_CAPGET STD { int linux_capget(void); } -185 AUE_CAPSET STD { int linux_capset(void); } +184 AUE_CAPGET STD { int linux_capget(void *hdrp, void *datap); } +185 AUE_CAPSET STD { int linux_capset(void *hdrp, const void *datap); } 186 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ l_stack_t *uoss); } 187 AUE_SENDFILE STD { int linux_sendfile(void); } --- ./amd64/linux32/syscalls.master.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./amd64/linux32/syscalls.master 2011-02-12 22:50:35.000000000 -0500 @@ -327,8 +327,8 @@ l_uid16_t uid, l_gid16_t gid); } 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ l_ulong bufsize); } -184 AUE_CAPGET STD { int linux_capget(void); } -185 AUE_CAPSET STD { int linux_capset(void); } +184 AUE_CAPGET STD { int linux_capget(void *hdrp, void *datap); } +185 AUE_CAPSET STD { int linux_capset(void *hdrp, const void *datap); } 186 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ l_stack_t *uoss); } 187 AUE_SENDFILE STD { int linux_sendfile(void); } ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | ------------------------------------------------------------------------- From owner-freebsd-emulation@FreeBSD.ORG Sun Feb 13 08:41:38 2011 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C0DB1065673; Sun, 13 Feb 2011 08:41:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 633158FC14; Sun, 13 Feb 2011 08:41:38 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1D8fcg8028733; Sun, 13 Feb 2011 08:41:38 GMT (envelope-from dchagin@freefall.freebsd.org) Received: (from dchagin@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1D8fcOx028729; Sun, 13 Feb 2011 08:41:38 GMT (envelope-from dchagin) Date: Sun, 13 Feb 2011 08:41:38 GMT Message-Id: <201102130841.p1D8fcOx028729@freefall.freebsd.org> To: dchagin@FreeBSD.org, freebsd-emulation@FreeBSD.org, dchagin@FreeBSD.org From: dchagin@FreeBSD.org Cc: Subject: Re: kern/145024: [linux] [patch] kernel crash by linux.ko module with nooptions COMPAT_FREEBSD32 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 08:41:38 -0000 Synopsis: [linux] [patch] kernel crash by linux.ko module with nooptions COMPAT_FREEBSD32 Responsible-Changed-From-To: freebsd-emulation->dchagin Responsible-Changed-By: dchagin Responsible-Changed-When: Sun Feb 13 08:40:51 UTC 2011 Responsible-Changed-Why: Take it. http://www.freebsd.org/cgi/query-pr.cgi?pr=145024 From owner-freebsd-emulation@FreeBSD.ORG Mon Feb 14 11:07:02 2011 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C997810656F5 for ; Mon, 14 Feb 2011 11:07:02 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9B01A8FC0C for ; Mon, 14 Feb 2011 11:07:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1EB72ZK077153 for ; Mon, 14 Feb 2011 11:07:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1EB72Cw077151 for freebsd-emulation@FreeBSD.org; Mon, 14 Feb 2011 11:07:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 14 Feb 2011 11:07:02 GMT Message-Id: <201102141107.p1EB72Cw077151@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-emulation@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-emulation@FreeBSD.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 11:07:02 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/153990 emulation [hyper-v]: Will not install into Hyper-V on Server 200 o kern/153887 emulation [linux] Linux emulator not understand STB_GNU_UNIQUE b o kern/153243 emulation [ibcs2] Seg fault whne running COFF binary using iBCS2 o ports/151714 emulation print/acroread9 not usable due to lack of support in t a kern/150186 emulation [parallels] [panic] Parallels Desktop: CDROM disconnec o kern/149168 emulation [linux] [patch] Linux sendmsg / recvmsg / etc fixes fo o ports/148097 emulation [patch] suggested addition to linux_base-* packages to o ports/148096 emulation emulators/linux_base-* can not be built from ports on o kern/147793 emulation [vmware] [panic] cdrom handling, panic, possible race o kern/146237 emulation [linux] Linux binaries not reading directories mounted f kern/144763 emulation [linux] [panic] Kernel panic when start linux binaries o ports/142837 emulation [patch] emulators/linux_base-* packages fails to insta o kern/140156 emulation [linux] cdparanoia fails to read drive data f kern/138944 emulation [parallels] [regression] Parallels no longer works in o kern/138880 emulation [linux] munmap segfaults after linux_mmap2 stresstest f ports/137332 emulation add caution messages to some adobe products s ports/136321 emulation x11-toolkits/linux-pango: please update linux based po o ports/135337 emulation [PATCH] emulators/linux_base-f10: incorrect bash usage s kern/133144 emulation [linux] linuxulator 2.6 crashes with nvidias libGL.so. o kern/129169 emulation [linux] [patch] Linux Emulation ENOTCONN error using n o kern/126232 emulation [linux] Linux ioctl TCGETS (0x5401) always fails o kern/86619 emulation [linux] linux emulator interacts oddly with cp a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s o kern/41543 emulation [patch] [request] easier wine/w23 support o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/36952 emulation [patch] [linux] ldd(1) command of linux does not work o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 28 problems total. From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 15 00:11:37 2011 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74A36106564A; Tue, 15 Feb 2011 00:11:37 +0000 (UTC) (envelope-from arundel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 490D48FC14; Tue, 15 Feb 2011 00:11:37 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1F0Bb8p022526; Tue, 15 Feb 2011 00:11:37 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1F0Bbn8022522; Tue, 15 Feb 2011 00:11:37 GMT (envelope-from arundel) Date: Tue, 15 Feb 2011 00:11:37 GMT Message-Id: <201102150011.p1F0Bbn8022522@freefall.freebsd.org> To: arundel@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-emulation@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: bin/150262: [patch] truss(1) -f doesn't follow descendants of the linux process X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 00:11:37 -0000 Synopsis: [patch] truss(1) -f doesn't follow descendants of the linux process Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation Responsible-Changed-By: arundel Responsible-Changed-When: Tue Feb 15 00:10:50 UTC 2011 Responsible-Changed-Why: Assign to people who might have an opinion about this PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=150262 From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 15 00:34:08 2011 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 244DA1065670; Tue, 15 Feb 2011 00:34:08 +0000 (UTC) (envelope-from arundel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ED29B8FC14; Tue, 15 Feb 2011 00:34:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1F0Y7gs044902; Tue, 15 Feb 2011 00:34:07 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1F0Y7PR044898; Tue, 15 Feb 2011 00:34:07 GMT (envelope-from arundel) Date: Tue, 15 Feb 2011 00:34:07 GMT Message-Id: <201102150034.p1F0Y7PR044898@freefall.freebsd.org> To: arundel@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-emulation@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: kern/144584: [linprocfs][patch] bogus values in linprocfs X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 00:34:08 -0000 Synopsis: [linprocfs][patch] bogus values in linprocfs Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation Responsible-Changed-By: arundel Responsible-Changed-When: Tue Feb 15 00:33:50 UTC 2011 Responsible-Changed-Why: Better assign this one to the emulation folks. http://www.freebsd.org/cgi/query-pr.cgi?pr=144584 From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 15 02:12:47 2011 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7FE1065673; Tue, 15 Feb 2011 02:12:47 +0000 (UTC) (envelope-from arundel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 613FF8FC13; Tue, 15 Feb 2011 02:12:47 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1F2ClqW051226; Tue, 15 Feb 2011 02:12:47 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1F2ClRP051222; Tue, 15 Feb 2011 02:12:47 GMT (envelope-from arundel) Date: Tue, 15 Feb 2011 02:12:47 GMT Message-Id: <201102150212.p1F2ClRP051222@freefall.freebsd.org> To: arundel@FreeBSD.org, freebsd-emulation@FreeBSD.org, freebsd-ports@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: ports/137332: add caution messages to some adobe products X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 02:12:47 -0000 Synopsis: add caution messages to some adobe products Responsible-Changed-From-To: freebsd-emulation->freebsd-ports Responsible-Changed-By: arundel Responsible-Changed-When: Tue Feb 15 02:10:08 UTC 2011 Responsible-Changed-Why: The ports folks are probably better suited for this PR. Please note that as per 02/15/2011, vuln.xml entries exist for the www/linux-flashplugin7 as well as the linux-flashplugin9 port. http://www.freebsd.org/cgi/query-pr.cgi?pr=137332 From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 15 08:32:29 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB271065670 for ; Tue, 15 Feb 2011 08:32:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 33FF28FC13 for ; Tue, 15 Feb 2011 08:32:28 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p1F8WPmF065990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Feb 2011 10:32:25 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p1F8WPff075459; Tue, 15 Feb 2011 10:32:25 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p1F8WPc4075458; Tue, 15 Feb 2011 10:32:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Feb 2011 10:32:25 +0200 From: Kostik Belousov To: freebsd-bugs@freebsd.org, freebsd-emulation@freebsd.org Message-ID: <20110215083225.GX78089@deviant.kiev.zoral.com.ua> References: <201102150011.p1F0Bbn8022522@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jaAa33DYgKWagIMk" Content-Disposition: inline In-Reply-To: <201102150011.p1F0Bbn8022522@freefall.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: bin/150262: [patch] truss(1) -f doesn't follow descendants of the linux process X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 08:32:29 -0000 --jaAa33DYgKWagIMk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 15, 2011 at 12:11:37AM +0000, arundel@freebsd.org wrote: > Synopsis: [patch] truss(1) -f doesn't follow descendants of the linux pro= cess >=20 > Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation > Responsible-Changed-By: arundel > Responsible-Changed-When: Tue Feb 15 00:10:50 UTC 2011 > Responsible-Changed-Why:=20 > Assign to people who might have an opinion about this PR. >=20 > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D150262 The patch would improve the current operations of truss(1), but the handling of new process creation in truss is very racy. We should teach it to use PT_FOLLOW_FORK and ptrace_lwpinfo.pl_child_pid. --jaAa33DYgKWagIMk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1aOhgACgkQC3+MBN1Mb4iu/wCeNFMbBFjay3kdC4ngcrGI6nFC cB4AoPSFljtz+Dn+5bcWFYMCdjuWQwpH =QtGT -----END PGP SIGNATURE----- --jaAa33DYgKWagIMk-- From owner-freebsd-emulation@FreeBSD.ORG Fri Feb 18 14:32:51 2011 Return-Path: Delivered-To: emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5EC106566B for ; Fri, 18 Feb 2011 14:32:51 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from groupware.itac.at (groupware.itac.at [91.205.172.99]) by mx1.freebsd.org (Postfix) with ESMTP id 165048FC17 for ; Fri, 18 Feb 2011 14:32:50 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 212023; Fri, 18 Feb 2011 15:17:53 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Fri, 18 Feb 2011 15:17:44 +0100 From: Bernhard Froehlich To: Message-ID: X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5.1 X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B020B.4D5E7F87.0293,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: Subject: Call for Testers: VirtualBox 4.0.4 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 14:32:51 -0000 Hi Testers. A few of you have probably wondered what happened to our VirtualBox efforts for FreeBSD. Well it took a bit longer then expected and a few problems were found that needed to be resolved first but most of the things are looking fine now and almost all patches have been pushed upstream with 4.0.4 so here we are now. We will continue to work on VirtualBox for FreeBSD and upstream is also very helpful to us but we could need a few more hands to better keep up with the work and especially improve and fix the Guest Additions. So if you want to help please contact us or have a look at our Todo list. This result wouldn't have been possible without the continuous help of the VirtualBox Developers and a lot of people from the FreeBSD community! (names in alphabetical order and probably missed a few, sorry for that!) - Alexander Eichner - Anonymous - Beat Gätzi - Bernhard Fröhlich - crsd - DomiX - Doug Barton - Grzegorz Blach - Hans Petter Selasky - Julian Stacey - Jung-uk Kim - Jürgen Lock - Klaus Espenlaub - Martin Wilke - Mattia Rossi - Michael Butler - Sean C. Farley - Steve Wills - tombsd - Vivek Khera - well-wisher - Wietse Venema - Yuri - many more from emulation@ Please when testing this ports backup all your virtual machines first. Also please build the port with DEBUG option enabled and send us the logfile when any VM crashes. Without them it's very hard to figure out what went wrong. Highlights with 4.0: - USB support (by Hans Petter Selasky) - Asynchronous I/O - Guest additions got startscripts and a integration into the desktop environments - www/phpvirtualbox updated to 4.0-3 Changelog for 4.0: - http://www.virtualbox.org/wiki/Changelog Short configuration help: - http://wiki.freebsd.org/VirtualBox Todo List: - http://wiki.freebsd.org/VirtualBox/ToDo http://home.bluelife.at/ports/virtualbox-cft-20110218.tar.gz Thanks and good luck, Bernhard, on behalf of the FreeBSD Vbox Team -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Fri Feb 18 20:58:14 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FC0106564A; Fri, 18 Feb 2011 20:58:14 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 54D668FC0C; Fri, 18 Feb 2011 20:58:13 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 070A21E00244; Fri, 18 Feb 2011 21:58:11 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id p1IKthH9045600; Fri, 18 Feb 2011 21:55:43 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id p1IKtgYx045599; Fri, 18 Feb 2011 21:55:42 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Fri, 18 Feb 2011 21:55:42 +0100 To: Juergen Lock Message-ID: <20110218205542.GA45210@triton8.kn-bremen.de> References: <20110129201000.GA10774@triton8.kn-bremen.de> <20110129205105.GI2518@deviant.kiev.zoral.com.ua> <20110129235448.GA15788@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110129235448.GA15788@triton8.kn-bremen.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Andrew Gallatin , freebsd-emulation@freebsd.org, Alexander Leidinger Subject: Re: Can vm_mmap()/vm_map_remove() be called with giant held? (linuxolator dvb patches) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 20:58:14 -0000 I have finally got back to this and did the style and vm_map_remove() return value handling fixes, updated the patches in-place: http://people.freebsd.org/~nox/dvb/linux-dvb.patch (for head) http://people.freebsd.org/~nox/dvb/linux-dvb-8.patch (for 8.) On Sun, Jan 30, 2011 at 12:54:48AM +0100, Juergen Lock wrote: > On Sat, Jan 29, 2011 at 10:51:05PM +0200, Kostik Belousov wrote: > > On Sat, Jan 29, 2011 at 09:10:00PM +0100, Juergen Lock wrote: > > > Hi! > > > > > > I was kinda hoping to be able to post a correct patch in public but > > > getting an answer to ${Subject} seems to be more difficult than I > > > thought... :) So, does anyone here know? copyout_map() and > > You do not need Giant locked for vm_map* functions. > > > The question was more do I need to drop it first before calling them... > > > > copyout_unmap() are copied from ksyms_map() from sys/dev/ksyms/ksyms.c > > > - should there maybe be global versions instead of two static copies > > > each, and what would be good names? And giant is taken by linux_ioctl() > > Would you make a patch for this ? > > > Heh if you want me to... Where should they go and are my name choices ok? > I haven't done this yet so people can keep patching linux.ko in-place without having to build a new kernel too... > > > in the same source file before calling the parts I added. So here > > > comes the patch, it is to add support for dvb ioctls to the linuxolator > > > as discussed on -emulation earlier in this thread: > > > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-January/011575.html > > > > > > (patch also at: > > > > > > http://people.freebsd.org/~nox/dvb/linux-dvb.patch > > > > > > and a version for 8, which is what I tested with w_scan on dvb-s2 > > > and dvb-t, and Andrew Gallatin also tested it with SageTV: > > > > > > http://people.freebsd.org/~nox/dvb/linux-dvb-8.patch > > > > > > ) > > > > > > + /* > > > + * Map somewhere after heap in process memory. > > > + */ > > > + PROC_LOCK(td->td_proc); > > > + *addr = round_page((vm_offset_t)vms->vm_daddr + > > > + lim_max(td->td_proc, RLIMIT_DATA)); > > > + PROC_UNLOCK(td->td_proc); > > Are you sure that this is needed ? Why not leave the address selection > > to the VM ? > > > I don't know, maybe sys/dev/ksyms/ksyms.c has a reason? How would I leave the address selection to the VM? Just trying to initialize *addr to (vm_offset_t)NULL there caused the patch to stop working. Thanx, :) Juergen Here is the new version for head: Index: src/sys/compat/linux/linux_ioctl.c =================================================================== RCS file: /home/scvs/src/sys/compat/linux/linux_ioctl.c,v retrieving revision 1.167 diff -u -p -r1.167 linux_ioctl.c --- src/sys/compat/linux/linux_ioctl.c 30 Dec 2010 02:18:04 -0000 1.167 +++ src/sys/compat/linux/linux_ioctl.c 18 Feb 2011 20:10:32 -0000 @@ -59,6 +59,14 @@ __FBSDID("$FreeBSD: src/sys/compat/linux #include #include #include +#include +#include +#include + +#include +#include +#include +#include #include #include @@ -83,6 +91,9 @@ __FBSDID("$FreeBSD: src/sys/compat/linux #include #include +#include +#include + CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); static linux_ioctl_function_t linux_ioctl_cdrom; @@ -97,6 +108,7 @@ static linux_ioctl_function_t linux_ioct static linux_ioctl_function_t linux_ioctl_drm; static linux_ioctl_function_t linux_ioctl_sg; static linux_ioctl_function_t linux_ioctl_v4l; +static linux_ioctl_function_t linux_ioctl_dvb; static linux_ioctl_function_t linux_ioctl_special; static linux_ioctl_function_t linux_ioctl_fbsd_usb; @@ -124,6 +136,8 @@ static struct linux_ioctl_handler sg_han { linux_ioctl_sg, LINUX_IOCTL_SG_MIN, LINUX_IOCTL_SG_MAX }; static struct linux_ioctl_handler video_handler = { linux_ioctl_v4l, LINUX_IOCTL_VIDEO_MIN, LINUX_IOCTL_VIDEO_MAX }; +static struct linux_ioctl_handler dvb_handler = +{ linux_ioctl_dvb, LINUX_IOCTL_DVB_MIN, LINUX_IOCTL_DVB_MAX }; static struct linux_ioctl_handler fbsd_usb = { linux_ioctl_fbsd_usb, FBSD_LUSB_MIN, FBSD_LUSB_MAX }; @@ -139,6 +153,7 @@ DATA_SET(linux_ioctl_handler_set, privat DATA_SET(linux_ioctl_handler_set, drm_handler); DATA_SET(linux_ioctl_handler_set, sg_handler); DATA_SET(linux_ioctl_handler_set, video_handler); +DATA_SET(linux_ioctl_handler_set, dvb_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); struct handler_element @@ -2989,6 +3004,255 @@ linux_ioctl_special(struct thread *td, s } /* + * Map some anonymous memory in user space of size sz, rounded up to the page + * boundary. + */ +static int +copyout_map(struct thread *td, vm_offset_t *addr, size_t sz) +{ + struct vmspace *vms; + int error; + vm_size_t size; + + vms = td->td_proc->p_vmspace; + + /* + * Map somewhere after heap in process memory. + */ + PROC_LOCK(td->td_proc); + *addr = round_page((vm_offset_t)vms->vm_daddr + + lim_max(td->td_proc, RLIMIT_DATA)); + PROC_UNLOCK(td->td_proc); + + /* Round size up to page boundary. */ + size = (vm_size_t)round_page(sz); + + error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, + VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); + + return (error); +} + +/* + * Unmap memory in user space. + */ +static int +copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz) +{ + int error; + vm_map_t map; + vm_size_t size; + + map = &td->td_proc->p_vmspace->vm_map; + size = (vm_size_t) round_page(sz); + + error = vm_map_remove(map, addr, addr + size); + + return (error); +} + +static int +linux_to_bsd_dtv_properties(struct l_dtv_properties *lvps, struct dtv_properties *vps) +{ + + vps->num = lvps->num; + vps->props = PTRIN(lvps->props); /* possible pointer size conversion */ + return (0); +} + +static int +linux_to_bsd_dtv_property(struct l_dtv_property *lvp, struct dtv_property *vp) +{ + + /* + * Everything until u.buffer.reserved2 is fixed size so + * just memcpy it. + */ + memcpy(vp, lvp, offsetof(struct l_dtv_property, u.buffer.reserved2)); + /* + * The pointer may be garbage since it's part of a union, + * currently no Linux code uses it so just set it to NULL. + */ + vp->u.buffer.reserved2 = NULL; + vp->result = lvp->result; + return (0); +} + +static int +bsd_to_linux_dtv_property(struct dtv_property *vp, struct l_dtv_property *lvp) +{ + + /* + * Everything until u.buffer.reserved2 is fixed size so + * just memcpy it. + */ + memcpy(lvp, vp, offsetof(struct l_dtv_property, u.buffer.reserved2)); + /* + * The pointer may be garbage since it's part of a union, + * currently no Linux code uses it so just set it to NULL. + */ + lvp->u.buffer.reserved2 = PTROUT(NULL); + lvp->result = vp->result; + return (0); +} + +static int +linux_ioctl_dvb(struct thread *td, struct linux_ioctl_args *args) +{ + struct file *fp; + int error, i; + struct l_dtv_properties l_vps; + struct dtv_properties vps; + struct l_dtv_property *l_vp, *l_p; + struct dtv_property *vp, *p; + size_t l_propsiz, propsiz; + vm_offset_t uvp; + + l_vp = NULL; + vp = NULL; + + switch (args->cmd & 0xffff) { + case LINUX_AUDIO_STOP: + case LINUX_AUDIO_PLAY: + case LINUX_AUDIO_PAUSE: + case LINUX_AUDIO_CONTINUE: + case LINUX_AUDIO_SELECT_SOURCE: + case LINUX_AUDIO_SET_MUTE: + case LINUX_AUDIO_SET_AV_SYNC: + case LINUX_AUDIO_SET_BYPASS_MODE: + case LINUX_AUDIO_CHANNEL_SELECT: + case LINUX_AUDIO_CLEAR_BUFFER: + case LINUX_AUDIO_SET_ID: + case LINUX_AUDIO_SET_STREAMTYPE: + case LINUX_AUDIO_SET_EXT_ID: + case LINUX_AUDIO_BILINGUAL_CHANNEL_SELECT: + case LINUX_DMX_START: + case LINUX_DMX_STOP: + case LINUX_DMX_SET_BUFFER_SIZE: + case LINUX_NET_REMOVE_IF: + case LINUX_FE_DISEQC_RESET_OVERLOAD: + case LINUX_FE_DISEQC_SEND_BURST: + case LINUX_FE_SET_TONE: + case LINUX_FE_SET_VOLTAGE: + case LINUX_FE_ENABLE_HIGH_LNB_VOLTAGE: + case LINUX_FE_DISHNETWORK_SEND_LEGACY_CMD: + case LINUX_FE_SET_FRONTEND_TUNE_MODE: + case LINUX_CA_RESET: + if ((args->cmd & IOC_DIRMASK) != LINUX_IOC_VOID) + return ENOIOCTL; + args->cmd = (args->cmd & 0xffff) | IOC_VOID; + break; + + case LINUX_DMX_REMOVE_PID: + /* overlaps with LINUX_NET_ADD_IF */ + if ((args->cmd & IOC_DIRMASK) == LINUX_IOC_INOUT) + goto net_add_if; + /* FALLTHRU */ + case LINUX_AUDIO_SET_MIXER: + case LINUX_AUDIO_SET_ATTRIBUTES: + case LINUX_AUDIO_SET_KARAOKE: + case LINUX_DMX_SET_FILTER: + case LINUX_DMX_SET_PES_FILTER: + case LINUX_DMX_SET_SOURCE: + case LINUX_DMX_ADD_PID: + case LINUX_FE_DISEQC_SEND_MASTER_CMD: + case LINUX_FE_SET_FRONTEND: + case LINUX_CA_SEND_MSG: + case LINUX_CA_SET_DESCR: + case LINUX_CA_SET_PID: + args->cmd = (args->cmd & ~IOC_DIRMASK) | IOC_IN; + break; + + case LINUX_AUDIO_GET_STATUS: + case LINUX_AUDIO_GET_CAPABILITIES: + case LINUX_AUDIO_GET_PTS: + case LINUX_DMX_GET_PES_PIDS: + case LINUX_DMX_GET_CAPS: + case LINUX_FE_GET_INFO: + case LINUX_FE_DISEQC_RECV_SLAVE_REPLY: + case LINUX_FE_READ_STATUS: + case LINUX_FE_READ_BER: + case LINUX_FE_READ_SIGNAL_STRENGTH: + case LINUX_FE_READ_SNR: + case LINUX_FE_READ_UNCORRECTED_BLOCKS: + case LINUX_FE_GET_FRONTEND: + case LINUX_FE_GET_EVENT: + case LINUX_CA_GET_CAP: + case LINUX_CA_GET_SLOT_INFO: + case LINUX_CA_GET_DESCR_INFO: + case LINUX_CA_GET_MSG: + args->cmd = (args->cmd & ~IOC_DIRMASK) | IOC_OUT; + break; + + case LINUX_DMX_GET_STC: + case LINUX_NET_GET_IF: + net_add_if: + args->cmd = (args->cmd & ~IOC_DIRMASK) | IOC_INOUT; + break; + + case LINUX_FE_SET_PROPERTY: + case LINUX_FE_GET_PROPERTY: + error = copyin((void *)args->arg, &l_vps, sizeof(l_vps)); + if (error) + return (error); + linux_to_bsd_dtv_properties(&l_vps, &vps); + if ((vps.num == 0) || vps.num > DTV_IOCTL_MAX_MSGS) + return EINVAL; + + l_propsiz = vps.num * sizeof(*l_vp); + propsiz = vps.num * sizeof(*vp); + l_vp = malloc(l_propsiz, M_LINUX, M_WAITOK); + vp = malloc(propsiz, M_LINUX, M_WAITOK); + error = copyin((void *)vps.props, l_vp, l_propsiz); + if (error) + goto out2; + for (i = vps.num, l_p = l_vp, p = vp; i--; ++l_p, ++p) + linux_to_bsd_dtv_property(l_p, p); + + error = copyout_map(td, &uvp, propsiz); + if (error) + goto out2; + copyout(vp, (void *)uvp, propsiz); + + if ((error = fget(td, args->fd, &fp)) != 0) { + (void)copyout_unmap(td, uvp, propsiz); + goto out2; + } + vps.props = (void *)uvp; + if ((args->cmd & 0xffff) == LINUX_FE_SET_PROPERTY) + error = fo_ioctl(fp, FE_SET_PROPERTY, &vps, td->td_ucred, td); + else + error = fo_ioctl(fp, FE_GET_PROPERTY, &vps, td->td_ucred, td); + if (error) { + (void)copyout_unmap(td, uvp, propsiz); + goto out; + } + error = copyin((void *)uvp, vp, propsiz); + (void)copyout_unmap(td, uvp, propsiz); + if (error) + goto out; + for (i = vps.num, l_p = l_vp, p = vp; i--; ++l_p, ++p) + bsd_to_linux_dtv_property(p, l_p); + linux_to_bsd_dtv_properties(&l_vps, &vps); + copyout(l_vp, (void *)vps.props, l_propsiz); + + out: + fdrop(fp, td); + out2: + if (l_vp) + free(l_vp, M_LINUX); + if (vp) + free(vp, M_LINUX); + return (error); + + default: return (ENOIOCTL); + } + + error = ioctl(td, (struct ioctl_args *)args); + return (error); +} + +/* * Support for emulators/linux-libusb. This port uses FBSD_LUSB* macros * instead of USB* ones. This lets us to provide correct values for cmd. * 0xffffffe0 -- 0xffffffff range seemed to be the least collision-prone. Index: src/sys/compat/linux/linux_ioctl.h =================================================================== RCS file: /home/scvs/src/sys/compat/linux/linux_ioctl.h,v retrieving revision 1.32 diff -u -p -r1.32 linux_ioctl.h --- src/sys/compat/linux/linux_ioctl.h 30 Dec 2010 02:18:04 -0000 1.32 +++ src/sys/compat/linux/linux_ioctl.h 18 Jan 2011 17:48:27 -0000 @@ -32,6 +32,17 @@ #define _LINUX_IOCTL_H_ /* + * ioctl + * + * XXX comments in Linux' indicate these + * could be arch-dependant... + */ +#define LINUX_IOC_VOID 0 +#define LINUX_IOC_IN 0x40000000 +#define LINUX_IOC_OUT 0x80000000 +#define LINUX_IOC_INOUT (LINUX_IOC_IN|LINUX_IOC_OUT) + +/* * disk */ #define LINUX_BLKROSET 0x125d @@ -613,6 +624,83 @@ int linux_ifname(struct ifnet *, char #define LINUX_IOCTL_VIDEO_MAX LINUX_VIDIOCSVBIFMT /* + * DVB (osd.h and video.h not handled) + */ +#define LINUX_AUDIO_STOP 0x6f01 /* 0x00006f01 */ +#define LINUX_AUDIO_PLAY 0x6f02 /* 0x00006f02 */ +#define LINUX_AUDIO_PAUSE 0x6f03 /* 0x00006f03 */ +#define LINUX_AUDIO_CONTINUE 0x6f04 /* 0x00006f04 */ +#define LINUX_AUDIO_SELECT_SOURCE 0x6f05 /* 0x00006f05 */ +#define LINUX_AUDIO_SET_MUTE 0x6f06 /* 0x00006f06 */ +#define LINUX_AUDIO_SET_AV_SYNC 0x6f07 /* 0x00006f07 */ +#define LINUX_AUDIO_SET_BYPASS_MODE 0x6f08 /* 0x00006f08 */ +#define LINUX_AUDIO_CHANNEL_SELECT 0x6f09 /* 0x00006f09 */ +#define LINUX_AUDIO_GET_STATUS 0x6f0a /* 0x80206f0a */ +#define LINUX_AUDIO_GET_CAPABILITIES 0x6f0b /* 0x80046f0b */ +#define LINUX_AUDIO_CLEAR_BUFFER 0x6f0c /* 0x00006f0c */ +#define LINUX_AUDIO_SET_ID 0x6f0d /* 0x00006f0d */ +#define LINUX_AUDIO_SET_MIXER 0x6f0e /* 0x40086f0e */ +#define LINUX_AUDIO_SET_STREAMTYPE 0x6f0f /* 0x00006f0f */ +#define LINUX_AUDIO_SET_EXT_ID 0x6f10 /* 0x00006f10 */ +#define LINUX_AUDIO_SET_ATTRIBUTES 0x6f11 /* 0x40026f11 */ +#define LINUX_AUDIO_SET_KARAOKE 0x6f12 /* 0x400c6f12 */ +#define LINUX_AUDIO_GET_PTS 0x6f13 /* 0x80086f13 */ +#define LINUX_AUDIO_BILINGUAL_CHANNEL_SELECT 0x6f14 /* 0x00006f14 */ +#define LINUX_DMX_START 0x6f29 /* 0x00006f29 */ +#define LINUX_DMX_STOP 0x6f2a /* 0x00006f2a */ +#define LINUX_DMX_SET_FILTER 0x6f2b /* 0x403c6f2b */ +#define LINUX_DMX_SET_PES_FILTER 0x6f2c /* 0x40146f2c */ +#define LINUX_DMX_SET_BUFFER_SIZE 0x6f2d /* 0x00006f2d */ +#define LINUX_DMX_GET_PES_PIDS 0x6f2f /* 0x800a6f2f */ +#define LINUX_DMX_GET_CAPS 0x6f30 /* 0x80086f30 */ +#define LINUX_DMX_SET_SOURCE 0x6f31 /* 0x40046f31 */ +#define LINUX_DMX_GET_STC 0x6f32 /* 0xc0106f32 */ +#define LINUX_DMX_ADD_PID 0x6f33 /* 0x40026f33 */ +#define LINUX_DMX_REMOVE_PID 0x6f34 /* 0x40026f34 */ +#define LINUX_FE_GET_INFO 0x6f3d /* 0x80a86f3d */ +#define LINUX_FE_DISEQC_RESET_OVERLOAD 0x6f3e /* 0x00006f3e */ +#define LINUX_FE_DISEQC_SEND_MASTER_CMD 0x6f3f /* 0x40076f3f */ +#define LINUX_FE_DISEQC_RECV_SLAVE_REPLY 0x6f40 /* 0x800c6f40 */ +#define LINUX_FE_DISEQC_SEND_BURST 0x6f41 /* 0x00006f41 */ +#define LINUX_FE_SET_TONE 0x6f42 /* 0x00006f42 */ +#define LINUX_FE_SET_VOLTAGE 0x6f43 /* 0x00006f43 */ +#define LINUX_FE_ENABLE_HIGH_LNB_VOLTAGE 0x6f44 /* 0x00006f44 */ +#define LINUX_FE_READ_STATUS 0x6f45 /* 0x80046f45 */ +#define LINUX_FE_READ_BER 0x6f46 /* 0x80046f46 */ +#define LINUX_FE_READ_SIGNAL_STRENGTH 0x6f47 /* 0x80026f47 */ +#define LINUX_FE_READ_SNR 0x6f48 /* 0x80026f48 */ +#define LINUX_FE_READ_UNCORRECTED_BLOCKS 0x6f49 /* 0x80046f49 */ +#define LINUX_FE_SET_FRONTEND 0x6f4c /* 0x40246f4c */ +#define LINUX_FE_GET_FRONTEND 0x6f4d /* 0x80246f4d */ +#define LINUX_FE_GET_EVENT 0x6f4e /* 0x80286f4e */ +#define LINUX_FE_DISHNETWORK_SEND_LEGACY_CMD 0x6f50 /* 0x00006f50 */ +#define LINUX_FE_SET_FRONTEND_TUNE_MODE 0x6f51 /* 0x00006f51 */ +#define LINUX_FE_SET_PROPERTY 0x6f52 /* 0x40086f52 */ +#define LINUX_FE_GET_PROPERTY 0x6f53 /* 0x80086f53 */ +#define LINUX_CA_RESET 0x6f80 /* 0x00006f80 */ +#define LINUX_CA_GET_CAP 0x6f81 /* 0x80106f81 */ +#define LINUX_CA_GET_SLOT_INFO 0x6f82 /* 0x800c6f82 */ +#define LINUX_CA_GET_DESCR_INFO 0x6f83 /* 0x80086f83 */ +#define LINUX_CA_GET_MSG 0x6f84 /* 0x810c6f84 */ +#define LINUX_CA_SEND_MSG 0x6f85 /* 0x410c6f85 */ +#define LINUX_CA_SET_DESCR 0x6f86 /* 0x40106f86 */ +#define LINUX_CA_SET_PID 0x6f87 /* 0x40086f87 */ + +/* + * DVB net.h + * (LINUX_NET_ADD_IF and LINUX___NET_ADD_IF_OLD overlap with + * LINUX_DMX_REMOVE_PID) + */ +#define LINUX_NET_ADD_IF 0x6f34 /* 0xc0066f34 */ +#define LINUX_NET_REMOVE_IF 0x6f35 /* 0x00006f35 */ +#define LINUX_NET_GET_IF 0x6f36 /* 0xc0066f36 */ +#define LINUX___NET_ADD_IF_OLD 0x6f34 /* 0xc0046f34 */ +#define LINUX___NET_GET_IF_OLD 0x6f36 /* 0xc0046f36 */ + +#define LINUX_IOCTL_DVB_MIN LINUX_AUDIO_STOP +#define LINUX_IOCTL_DVB_MAX LINUX_CA_SET_PID + +/* * Our libusb(8) calls emulated within linux(4). */ #define FBSD_LUSB_DEVICEENUMERATE 0xffff Index: src/sys/compat/linux/linux_dvb.h @@ -0,0 +1,63 @@ +/* + * Extracted from , which is: + * + * Copyright (C) 2000 Marcus Metzler + * Ralph Metzler + * Holger Waechtler + * Andre Draszik + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __LINUX_DVB_H +#define __LINUX_DVB_H + +#include + +struct dtv_property { + uint32_t cmd; + uint32_t reserved[3]; + union { + uint32_t data; + struct { + uint8_t data[32]; + uint32_t len; + uint32_t reserved1[3]; + void *reserved2; + } buffer; + } u; + int result; +} __attribute__ ((packed)); + +/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */ +#define DTV_IOCTL_MAX_MSGS 64 + +struct dtv_properties { + uint32_t num; + struct dtv_property *props; +}; + +#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) +/* + * This is broken on linux as well but they workaround it in the driver. + * Since this is impossible to do on FreeBSD fix the header instead. + * Detailed and discussion : + * http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-April/010958.html + */ +#define FE_GET_PROPERTY _IOW('o', 83, struct dtv_properties) + +#endif /*__LINUX_DVB_H*/ Index: src/sys/compat/linux/linux_dvb_compat.h @@ -0,0 +1,26 @@ +#ifndef __LINUX_DVB_COMPAT_H +#define __LINUX_DVB_COMPAT_H + +#include + +struct l_dtv_property { + uint32_t cmd; + uint32_t reserved[3]; + union { + uint32_t data; + struct { + uint8_t data[32]; + uint32_t len; + uint32_t reserved1[3]; + l_uintptr_t reserved2; + } buffer; + } u; + l_int result; +} __attribute__ ((packed)); + +struct l_dtv_properties { + uint32_t num; + l_uintptr_t props; +}; + +#endif /*__LINUX_DVB_H*/ From owner-freebsd-emulation@FreeBSD.ORG Sat Feb 19 17:57:49 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B99E106566B; Sat, 19 Feb 2011 17:57:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D6BA58FC0A; Sat, 19 Feb 2011 17:57:48 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p1JHviLp062100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Feb 2011 19:57:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p1JHviAT028572; Sat, 19 Feb 2011 19:57:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p1JHvi10028571; Sat, 19 Feb 2011 19:57:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Feb 2011 19:57:44 +0200 From: Kostik Belousov To: Juergen Lock Message-ID: <20110219175744.GH78089@deviant.kiev.zoral.com.ua> References: <20110129201000.GA10774@triton8.kn-bremen.de> <20110129205105.GI2518@deviant.kiev.zoral.com.ua> <20110129235448.GA15788@triton8.kn-bremen.de> <20110218205542.GA45210@triton8.kn-bremen.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EUpy5YnDgVCdz9yy" Content-Disposition: inline In-Reply-To: <20110218205542.GA45210@triton8.kn-bremen.de> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, freebsd-emulation@freebsd.org Subject: Re: Can vm_mmap()/vm_map_remove() be called with giant held? (linuxolator dvb patches) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 17:57:49 -0000 --EUpy5YnDgVCdz9yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 18, 2011 at 09:55:42PM +0100, Juergen Lock wrote: > I have finally got back to this and did the style and vm_map_remove() > return value handling fixes, updated the patches in-place: >=20 > http://people.freebsd.org/~nox/dvb/linux-dvb.patch >=20 > (for head) >=20 > http://people.freebsd.org/~nox/dvb/linux-dvb-8.patch >=20 > (for 8.) >=20 > On Sun, Jan 30, 2011 at 12:54:48AM +0100, Juergen Lock wrote: > > On Sat, Jan 29, 2011 at 10:51:05PM +0200, Kostik Belousov wrote: > > > On Sat, Jan 29, 2011 at 09:10:00PM +0100, Juergen Lock wrote: > > > > Hi! > > > >=20 > > > > I was kinda hoping to be able to post a correct patch in public but > > > > getting an answer to ${Subject} seems to be more difficult than I > > > > thought... :) So, does anyone here know? copyout_map() and > > > You do not need Giant locked for vm_map* functions. > > >=20 > > The question was more do I need to drop it first before calling them... > >=20 > > > > copyout_unmap() are copied from ksyms_map() from sys/dev/ksyms/ksym= s.c > > > > - should there maybe be global versions instead of two static copies > > > > each, and what would be good names? And giant is taken by linux_io= ctl() > > > Would you make a patch for this ? > > >=20 > > Heh if you want me to... Where should they go and are my name choices= ok? > >=20 > I haven't done this yet so people can keep patching linux.ko in-place > without having to build a new kernel too... Separate build of linux.ko is not quite supported action. I would greatly prefer to have the move of these two functions before the rest of the patch comes in. Together with conversion of other users. I propose to put it into vm/vm_glue.c. >=20 > > > > in the same source file before calling the parts I added. So here > > > > comes the patch, it is to add support for dvb ioctls to the linuxol= ator > > > > as discussed on -emulation earlier in this thread: > > > >=20 > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-January= /011575.html > > > >=20 > > > > (patch also at: > > > >=20 > > > > http://people.freebsd.org/~nox/dvb/linux-dvb.patch > > > >=20 > > > > and a version for 8, which is what I tested with w_scan on dvb-s2 > > > > and dvb-t, and Andrew Gallatin also tested it with SageTV: > > > >=20 > > > > http://people.freebsd.org/~nox/dvb/linux-dvb-8.patch > > > >=20 > > > > ) > > > >=20 >=20 > > > > + /* > > > > + * Map somewhere after heap in process memory. > > > > + */ > > > > + PROC_LOCK(td->td_proc); > > > > + *addr =3D round_page((vm_offset_t)vms->vm_daddr + > > > > + lim_max(td->td_proc, RLIMIT_DATA)); > > > > + PROC_UNLOCK(td->td_proc); > > > Are you sure that this is needed ? Why not leave the address selection > > > to the VM ? > > >=20 > > I don't know, maybe sys/dev/ksyms/ksyms.c has a reason? >=20 > How would I leave the address selection to the VM? Just trying > to initialize *addr to (vm_offset_t)NULL there caused the patch to > stop working. I believe you should do *addr =3D 0; vm_mmap(map, addr); --EUpy5YnDgVCdz9yy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1gBJgACgkQC3+MBN1Mb4g3WgCg5pyzNe1TeXXxZeYx4p5+xgDH UQgAoIYBzrFWs/OufIfUq1jD2SWILgD6 =U3c4 -----END PGP SIGNATURE----- --EUpy5YnDgVCdz9yy-- From owner-freebsd-emulation@FreeBSD.ORG Sat Feb 19 19:06:52 2011 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42050106566C; Sat, 19 Feb 2011 19:06:52 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 139FA8FC19; Sat, 19 Feb 2011 19:06:51 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id p1JJ40js012466; Sat, 19 Feb 2011 11:04:00 -0800 (PST) (envelope-from yuri@rawbw.com) Message-ID: <4D6014CB.30003@rawbw.com> Date: Sat, 19 Feb 2011 11:06:51 -0800 From: Yuri User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101211 Thunderbird/3.0.11 MIME-Version: 1.0 To: Bernhard Froehlich References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: emulation@freebsd.org Subject: Re: Call for Testers: VirtualBox 4.0.4 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 19:06:52 -0000 Solaris-10 guest has the issue with mounting the new guest additions. The 4.0.2 additions were installed. When I clicked on "Install Guest Additions" old one disappeared from the screen, new one didn't show up. The 4.0.2 is still under /cdrom. When I click "Install Guest Additions" again error message shows up: Unable to mount the CD?DVD image /.../.../VBoxGuestAdditions_4.0.4.iso on gthe machine SOlaris10_9-10_1. Would you like to force mounting of this medium? Could not unmount the currently mounted media/drive (VERR_PDM_MEDIA_LOCKED) On MacOS host same Solaris10 installs new additions fine. Yuri From owner-freebsd-emulation@FreeBSD.ORG Sat Feb 19 19:25:14 2011 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B031065670; Sat, 19 Feb 2011 19:25:14 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 3CAD08FC12; Sat, 19 Feb 2011 19:25:13 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id p1JJMMij017037; Sat, 19 Feb 2011 11:22:22 -0800 (PST) (envelope-from yuri@rawbw.com) Message-ID: <4D601919.4020707@rawbw.com> Date: Sat, 19 Feb 2011 11:25:13 -0800 From: Yuri User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101211 Thunderbird/3.0.11 MIME-Version: 1.0 To: Bernhard Froehlich References: <4D6014CB.30003@rawbw.com> In-Reply-To: <4D6014CB.30003@rawbw.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: emulation@freebsd.org Subject: Re: Call for Testers: VirtualBox 4.0.4 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 19:25:14 -0000 On 02/19/2011 11:06, Yuri wrote: > Solaris-10 guest has the issue with mounting the new guest additions. > The 4.0.2 additions were installed. When I clicked on "Install Guest > Additions" old one disappeared from the screen, new one didn't show > up. The 4.0.2 is still under /cdrom. When I click "Install Guest > Additions" again error message shows up: > > Unable to mount the CD?DVD image /.../.../VBoxGuestAdditions_4.0.4.iso > on gthe machine SOlaris10_9-10_1. Would you like to force mounting of > this medium? > > Could not unmount the currently mounted media/drive > (VERR_PDM_MEDIA_LOCKED) > > On MacOS host same Solaris10 installs new additions fine. > I want to add that this happens when old additions that were installed were mounted. This repeats itself when I press "Force Unmount" button. When I first ejected the 4.0.2 additions through right-click menu, "Install Guest Additions" worked. But when I tried to start firefox on this VM I am getting "Bad exchange descriptor" error reading one of the shared libs. And VM crashes soon after I try to upgrade additions. This was my second Solaris10 VM saved from 4.0.2. Will try to install it from scratch now. Doesn't look like Solaris10 is a usable guest in vbox-4.0.4 on FreeBSD-8.1. Yuri