From owner-freebsd-emulation@FreeBSD.ORG Sun Jan 23 15:03:50 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 26A4E10656CE for ; Sun, 23 Jan 2011 15:03:50 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A498C8FC25 for ; Sun, 23 Jan 2011 15:03:49 +0000 (UTC) Received: by fxm16 with SMTP id 16so3493940fxm.13 for ; Sun, 23 Jan 2011 07:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=nn/vtFP6yKz4TPT9uENg9bV2rfBnrtXCLOTlXQqpz+w=; b=LJ6720EwKNU5kYpEnHPBl7yyv+LVZ9TO5CXk5EFgcVYf2eME+IVncFbrW04OyPYlIo PhIF22uqA23sd9fFC4Bkg2+KFIzBOJ5Wm4sED5fdLmgGvwAsF44zkn59i6zmqXLrYmt4 ZdSNqcsLhM7ww5mzFOSboaAyepAnSiHwfE7vQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=rm+PHWzv10SRk2KZCEZlLa7keJw2IZoV43NjdSvkgw+YiPs6gCsa5zgzgmW23N9wog YU5UrYYN9jlStPeuiC2o48LShVl6DTUgCOm/h5gKG3/aLaRWtBSovg8K4ZQH8TzZnzpS ugSk+tl10msNgfQF13TazwFOuQQPXiyDQc5nY= Received: by 10.223.86.196 with SMTP id t4mr3049464fal.34.1295793191579; Sun, 23 Jan 2011 06:33:11 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id r24sm4223665fax.27.2011.01.23.06.33.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Jan 2011 06:33:10 -0800 (PST) From: Mikolaj Golub To: freebsd-virtualization@FreeBSD.org, freebsd-emulation@freebsd.org Date: Sun, 23 Jan 2011 16:33:07 +0200 Message-ID: <86oc77heqk.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: VirtualBox + VIMAGE 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, 23 Jan 2011 15:03:50 -0000 --=-=-= Hi, Sorry for cross posting, but this question concerns both VirtualBox and VIMAGE :-). I would like to be able to run VirtualBox on my desktop, with kernel compilled with VIMAGE, so I would use light vnet jails for FreeBSD VMs and VirtualBox for other OSes. Currently the system will crash if you try to use VirtualBox bridged networking under VIMAGE kernel. The crash may look like below: db> bt Tracing pid 2349 tid 100239 td 0xc984b2d0 ifunit(c7e3b9ac,6f,c129e970,f8089984,c08d6dc0,...) at ifunit+0x33 vboxNetFltOsInitInstance(c7e3b810,0,8,7,c9aa6ae0,...) at vboxNetFltOsInitInstance+0x31 vboxNetFltFactoryCreateAndConnect(c9aa8cc8,c96636d4,c9664010,0,c966403c,...) at vboxNetFltFactory CreateAndConnect+0x1f7 _end(c7b11810,c962c238,3,c962c2b8,0,...) at 0xc9c0114f _end(c7b11810,c962c22c,f20,c0d31268,f8089a90,...) at 0xc9c01265 _end(c962c22c,0,0,c7b11810,c0cfe2fe,...) at 0xc9bbc775 _end(f808a000,fffffffd,28,c962c22c,0,...) at 0xc9bbd086 supdrvIOCtl(c10c5607,c12a0a40,c7b11810,c962c200,c0e81df8,...) at supdrvIOCtl+0x1af1 VBoxDrvFreeBSDIOCtl(c94efb00,c10c5607,c962c200,3,c984b2d0,...) at VBoxDrvFreeBSDIOCtl+0x1ea devfs_ioctl_f(c8e70118,c10c5607,c962c200,c9a82900,c984b2d0,...) at devfs_ioctl_f+0x10b kern_ioctl(c984b2d0,e,c10c5607,c962c200,1089cec,...) at kern_ioctl+0x1fd ioctl(c984b2d0,f8089cec,2b077000,1,c94ed2a8,...) at ioctl+0x134 syscallenter(c984b2d0,f8089ce4,c0c20e2d,c0e83290,0,...) at syscallenter+0x2a6 syscall(f8089d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x282ae093, esp = 0xbf8b980c, ebp = 0xbf8b9828 --- So it crashes when a function (ifunit in this case) tries to access virtualized variable (V_ifnet in this case). The macro uses td->td_vnet for this, which should be set to current vnet, but for VBox driver threads it is NULL. As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the attached patch). This has fixed the issue for me and now I am happily running both VNET jails and VirtualBox machines on my desktop. But the way I fixed the issue looks hackish for me. Could someone suggest a better solution? In case someone is interested in trying this patch, below are the instructions how to build "VIMAGE safe" vbox driver from ports: cd /usr/ports/emulators/virtualbox-ose-kmod make patch cd work patch -p0 < /path/to/VirtualBox-3.2.12.VIMAGE.patch cd .. VIMAGE=1 make -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=VirtualBox-3.2.12.VIMAGE.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-23 12:44:24.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-23 12:14:19.000000000 +0200 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -322,6 +323,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + CURVNET_SET_QUIET(vnet0); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +348,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +366,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +381,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } @@ -409,6 +414,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(vnet0); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +444,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -452,6 +459,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(vnet0); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +489,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -497,6 +506,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS bool fActive; int error; + CURVNET_SET_QUIET(vnet0); ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); if (fDst & INTNETTRUNKDIR_WIRE) @@ -539,6 +549,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +567,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + CURVNET_SET_QUIET(vnet0); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +614,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -610,6 +623,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX { struct ifnet *ifp, *ifp0; + CURVNET_SET_QUIET(vnet0); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); /* * Attempt to check if the interface is still there and re-initialize if @@ -628,6 +642,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + CURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -667,6 +682,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF char path[NG_PATHSIZ]; Log(("%s: fActive:%d\n", __func__, fActive)); + CURVNET_SET_QUIET(vnet0); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); @@ -742,6 +758,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + CURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-emulation@FreeBSD.ORG Sun Jan 23 20:40:56 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 42F131065670 for ; Sun, 23 Jan 2011 20:40:56 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id B7C268FC12 for ; Sun, 23 Jan 2011 20:40:55 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p0NKecGC053548; Sun, 23 Jan 2011 21:40:53 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p0NKecDg053547; Sun, 23 Jan 2011 21:40:38 +0100 (CET) (envelope-from olli) Date: Sun, 23 Jan 2011 21:40:38 +0100 (CET) Message-Id: <201101232040.p0NKecDg053547@lurza.secnetix.de> From: Oliver Fromme To: freebsd-emulation@FreeBSD.ORG X-Newsgroups: list.freebsd-emulation User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Sun, 23 Jan 2011 21:40:53 +0100 (CET) Cc: Subject: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 23 Jan 2011 20:40:56 -0000 Hi, I'm trying to get Skype working with video support on my 8-stable machine at home. I've got a shiny new Logitech C210 webcam. This webcam works perfectly fine on my wife's Windows machine, FWIW. On my FreeBSD box I've installed webcamd and all of its dependencies, as per HPS' documentation. Basically the webcam seems to work: I get a clear picture in pwcview(1). However, Skype doesn't seem to recognize the video device (I have installed skype-2.0.0.72,1 from ports). The Logitech C210 is a UVC webcam (USB video class), and webcamd includes a uvc driver, but it says that it is V4L2 only. On the other hand, the Linuxulator's video device translation layer does not support V4L2, as far as I know. Is that the reason why Skype cannot see my webcam? If so, what's the recommended way to solve the problem? All of the webcams currently available for purchase seem to be UVC ones, so I'm probably stuck with Windows. :-( There's a second issue, but I think it's not related to emulation: The microphone doesn't seem to be supported. I haven't found anything related to audio in the webcamd documentation, so I guess it doesn't support microphones at all. I don't get any separate audio decvice listed in the output of usbconfig(8). Do I have to purchase a separate microphone, even though the C210 webcam already has a built-in one? Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "anyone new to programming should be kept as far from C++ as possible; actually showing the stuff should be considered a criminal offence" -- Jacek Generowicz From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 08:12:01 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 0A344106564A; Mon, 24 Jan 2011 08:12:01 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id BA6768FC27; Mon, 24 Jan 2011 08:12:00 +0000 (UTC) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0O7a9hm059479 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 24 Jan 2011 07:36:22 GMT (envelope-from julian@freebsd.org) Message-ID: <4D3D2DE9.2060004@freebsd.org> Date: Sun, 23 Jan 2011 23:44:41 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> In-Reply-To: <86oc77heqk.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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, 24 Jan 2011 08:12:01 -0000 On 1/23/11 6:33 AM, Mikolaj Golub wrote: > Hi, > > Sorry for cross posting, but this question concerns both VirtualBox and VIMAGE :-). > > I would like to be able to run VirtualBox on my desktop, with kernel compilled > with VIMAGE, so I would use light vnet jails for FreeBSD VMs and VirtualBox > for other OSes. > > Currently the system will crash if you try to use VirtualBox bridged > networking under VIMAGE kernel. > > The crash may look like below: > > db> bt > > Tracing pid 2349 tid 100239 td 0xc984b2d0 > ifunit(c7e3b9ac,6f,c129e970,f8089984,c08d6dc0,...) at ifunit+0x33 > vboxNetFltOsInitInstance(c7e3b810,0,8,7,c9aa6ae0,...) at vboxNetFltOsInitInstance+0x31 > vboxNetFltFactoryCreateAndConnect(c9aa8cc8,c96636d4,c9664010,0,c966403c,...) at vboxNetFltFactory > CreateAndConnect+0x1f7 > _end(c7b11810,c962c238,3,c962c2b8,0,...) at 0xc9c0114f > _end(c7b11810,c962c22c,f20,c0d31268,f8089a90,...) at 0xc9c01265 > _end(c962c22c,0,0,c7b11810,c0cfe2fe,...) at 0xc9bbc775 > _end(f808a000,fffffffd,28,c962c22c,0,...) at 0xc9bbd086 > supdrvIOCtl(c10c5607,c12a0a40,c7b11810,c962c200,c0e81df8,...) at supdrvIOCtl+0x1af1 > VBoxDrvFreeBSDIOCtl(c94efb00,c10c5607,c962c200,3,c984b2d0,...) at VBoxDrvFreeBSDIOCtl+0x1ea > devfs_ioctl_f(c8e70118,c10c5607,c962c200,c9a82900,c984b2d0,...) at devfs_ioctl_f+0x10b > kern_ioctl(c984b2d0,e,c10c5607,c962c200,1089cec,...) at kern_ioctl+0x1fd > ioctl(c984b2d0,f8089cec,2b077000,1,c94ed2a8,...) at ioctl+0x134 > syscallenter(c984b2d0,f8089ce4,c0c20e2d,c0e83290,0,...) at syscallenter+0x2a6 > syscall(f8089d28) at syscall+0x4f > Xint0x80_syscall() at Xint0x80_syscall+0x21 > --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x282ae093, esp = 0xbf8b980c, ebp = 0xbf8b9828 --- > > So it crashes when a function (ifunit in this case) tries to access > virtualized variable (V_ifnet in this case). The macro uses td->td_vnet for > this, which should be set to current vnet, but for VBox driver threads it is > NULL. > > As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > attached patch). This has fixed the issue for me and now I am happily running > both VNET jails and VirtualBox machines on my desktop. > > But the way I fixed the issue looks hackish for me. Could someone suggest a > better solution? this is probably at east partially the correct solution. Usually you should also set the value back to its previous value when you leave that code as well. > In case someone is interested in trying this patch, below are the instructions > how to build "VIMAGE safe" vbox driver from ports: > > cd /usr/ports/emulators/virtualbox-ose-kmod > make patch > cd work > patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > cd .. > VIMAGE=1 make > > > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 09:00:19 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 9FEC2106564A for ; Mon, 24 Jan 2011 09:00:19 +0000 (UTC) (envelope-from luchesar.iliev@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 39D2A8FC17 for ; Mon, 24 Jan 2011 09:00:16 +0000 (UTC) Received: by bwz12 with SMTP id 12so3489649bwz.13 for ; Mon, 24 Jan 2011 01:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:disposition-notification-to:date :from:organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; bh=vzS+WlMB6MAF8wwPUnEEe+Gr7ESCbOcvepeG5v4fVpM=; b=tX4Ao8T4+lhnkpsdjcxKQ9RbK5QSQh8X2hwK7KZZz/q9vc5vXJEPWFoslHF5FPRtRt S3VLo/tjwzig0q2i9gjjU6pl3+J3UL3U4MqQ+PH3TPqFd3iTwfx5Z5rsjXPrXZxffO5y RBulYua2SJ+cndcQcXdZkI2lE8FPBPUof9E+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:disposition-notification-to:date:from:organization :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=uTjF45ER0ibo7s+YlQdQ7D3TgQbCK48xC7DU7spc8ii9tQ/FHSgna9pSeRSV1f+Uor hPo46S28JG+AGe3ireu0kz0Nt+qN4y4MpozFoR26t+04UGHrp7FoGAntNP5sLnWcnbLN nCoIsAEI3aJ4X8aBQfsw4HgiVi4FR+QmNZCPA= Received: by 10.204.63.211 with SMTP id c19mr3353218bki.21.1295859615990; Mon, 24 Jan 2011 01:00:15 -0800 (PST) Received: from [79.124.93.41] ([79.124.93.41]) by mx.google.com with ESMTPS id b6sm5937635bkb.10.2011.01.24.01.00.13 (version=SSLv3 cipher=RC4-MD5); Mon, 24 Jan 2011 01:00:14 -0800 (PST) Message-ID: <4D3D3F9C.9010608@gmail.com> Date: Mon, 24 Jan 2011 11:00:12 +0200 From: "Luchesar V. ILIEV" Organization: Ideaconsult Ltd. User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101229 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Oliver Fromme References: <201101232040.p0NKecDg053547@lurza.secnetix.de> In-Reply-To: <201101232040.p0NKecDg053547@lurza.secnetix.de> X-Enigmail-Version: 1.1.2 OpenPGP: id=9A1FEEFF; url=https://cert.acad.bg/pgp-keys/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 09:00:19 -0000 On 01/23/2011 22:40, Oliver Fromme wrote: > Hi, > > I'm trying to get Skype working with video support on my > 8-stable machine at home. I've got a shiny new Logitech > C210 webcam. This webcam works perfectly fine on my wife's > Windows machine, FWIW. > > On my FreeBSD box I've installed webcamd and all of its > dependencies, as per HPS' documentation. Basically the > webcam seems to work: I get a clear picture in pwcview(1). > However, Skype doesn't seem to recognize the video device > (I have installed skype-2.0.0.72,1 from ports). > > The Logitech C210 is a UVC webcam (USB video class), and > webcamd includes a uvc driver, but it says that it is V4L2 > only. On the other hand, the Linuxulator's video device > translation layer does not support V4L2, as far as I know. > Is that the reason why Skype cannot see my webcam? If so, > what's the recommended way to solve the problem? All of > the webcams currently available for purchase seem to be > UVC ones, so I'm probably stuck with Windows. :-( > > There's a second issue, but I think it's not related to > emulation: The microphone doesn't seem to be supported. > I haven't found anything related to audio in the webcamd > documentation, so I guess it doesn't support microphones > at all. I don't get any separate audio decvice listed > in the output of usbconfig(8). Do I have to purchase a > separate microphone, even though the C210 webcam already > has a built-in one? > > Best regards > Oliver > Hi Oliver, Probably that's totally irrelevant to your problem, but you might try running Skype like the following and see if it makes any difference: $ LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so /path/to/skype HTH, Luchesar From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 10:13:39 2011 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 145A5106566B; Mon, 24 Jan 2011 10:13:39 +0000 (UTC) Date: Mon, 24 Jan 2011 10:13:39 +0000 From: Alexander Best To: "Luchesar V. ILIEV" Message-ID: <20110124101338.GA68332@freebsd.org> References: <201101232040.p0NKecDg053547@lurza.secnetix.de> <4D3D3F9C.9010608@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D3D3F9C.9010608@gmail.com> Cc: freebsd-emulation@FreeBSD.ORG, Oliver Fromme Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 10:13:39 -0000 On Mon Jan 24 11, Luchesar V. ILIEV wrote: > On 01/23/2011 22:40, Oliver Fromme wrote: > > Hi, > > > > I'm trying to get Skype working with video support on my > > 8-stable machine at home. I've got a shiny new Logitech > > C210 webcam. This webcam works perfectly fine on my wife's > > Windows machine, FWIW. > > > > On my FreeBSD box I've installed webcamd and all of its > > dependencies, as per HPS' documentation. Basically the > > webcam seems to work: I get a clear picture in pwcview(1). > > However, Skype doesn't seem to recognize the video device > > (I have installed skype-2.0.0.72,1 from ports). > > > > The Logitech C210 is a UVC webcam (USB video class), and > > webcamd includes a uvc driver, but it says that it is V4L2 > > only. On the other hand, the Linuxulator's video device > > translation layer does not support V4L2, as far as I know. > > Is that the reason why Skype cannot see my webcam? If so, > > what's the recommended way to solve the problem? All of > > the webcams currently available for purchase seem to be > > UVC ones, so I'm probably stuck with Windows. :-( same problem here with a logitech webcam. everything works fine under pwcview(1), but in skype all i get is a distorted green image. > > > > There's a second issue, but I think it's not related to > > emulation: The microphone doesn't seem to be supported. > > I haven't found anything related to audio in the webcamd > > documentation, so I guess it doesn't support microphones > > at all. I don't get any separate audio decvice listed > > in the output of usbconfig(8). Do I have to purchase a > > separate microphone, even though the C210 webcam already > > has a built-in one? i think sound doesn't work with recent versions of skype, because they abandoned OSS support. you might want to try skype 2.0.*, instead of version 2.1.*. cheers. alex > > > > Best regards > > Oliver > > > > Hi Oliver, > > Probably that's totally irrelevant to your problem, but you might try > running Skype like the following and see if it makes any difference: > > $ LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so /path/to/skype > > HTH, > Luchesar -- a13x From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 10:14:21 2011 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id AFF3B106566B; Mon, 24 Jan 2011 10:14:21 +0000 (UTC) Date: Mon, 24 Jan 2011 10:14:21 +0000 From: Alexander Best To: "Luchesar V. ILIEV" Message-ID: <20110124101421.GA68956@freebsd.org> References: <201101232040.p0NKecDg053547@lurza.secnetix.de> <4D3D3F9C.9010608@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D3D3F9C.9010608@gmail.com> Cc: freebsd-emulation@FreeBSD.ORG, Oliver Fromme Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 10:14:21 -0000 On Mon Jan 24 11, Luchesar V. ILIEV wrote: > On 01/23/2011 22:40, Oliver Fromme wrote: > > Hi, > > > > I'm trying to get Skype working with video support on my > > 8-stable machine at home. I've got a shiny new Logitech > > C210 webcam. This webcam works perfectly fine on my wife's > > Windows machine, FWIW. > > > > On my FreeBSD box I've installed webcamd and all of its > > dependencies, as per HPS' documentation. Basically the > > webcam seems to work: I get a clear picture in pwcview(1). > > However, Skype doesn't seem to recognize the video device > > (I have installed skype-2.0.0.72,1 from ports). > > > > The Logitech C210 is a UVC webcam (USB video class), and > > webcamd includes a uvc driver, but it says that it is V4L2 > > only. On the other hand, the Linuxulator's video device > > translation layer does not support V4L2, as far as I know. > > Is that the reason why Skype cannot see my webcam? If so, > > what's the recommended way to solve the problem? All of > > the webcams currently available for purchase seem to be > > UVC ones, so I'm probably stuck with Windows. :-( > > > > There's a second issue, but I think it's not related to > > emulation: The microphone doesn't seem to be supported. > > I haven't found anything related to audio in the webcamd > > documentation, so I guess it doesn't support microphones > > at all. I don't get any separate audio decvice listed > > in the output of usbconfig(8). Do I have to purchase a > > separate microphone, even though the C210 webcam already > > has a built-in one? > > > > Best regards > > Oliver > > > > Hi Oliver, > > Probably that's totally irrelevant to your problem, but you might try > running Skype like the following and see if it makes any difference: > > $ LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so /path/to/skype ERROR: ld.so: object '/usr/local/lib/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored. > > HTH, > Luchesar -- a13x From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 11:06:59 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 5C2731065706 for ; Mon, 24 Jan 2011 11:06:59 +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 2FAF68FC1F for ; Mon, 24 Jan 2011 11:06:59 +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 p0OB6xDu077779 for ; Mon, 24 Jan 2011 11:06:59 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0OB6wUN077777 for freebsd-emulation@FreeBSD.org; Mon, 24 Jan 2011 11:06:58 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 24 Jan 2011 11:06:58 GMT Message-Id: <201101241106.p0OB6wUN077777@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, 24 Jan 2011 11:06:59 -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/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 o kern/145024 emulation [linux] [panic] kernel crash by linux.ko module with n 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 f kern/99068 emulation [linux] [patch] Linux emulator crashed by java, when c 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 29 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 11:37: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 B7554106566B for ; Mon, 24 Jan 2011 11:37:49 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6ABE68FC0C for ; Mon, 24 Jan 2011 11:37:49 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A186.dip.t-dialin.net [87.179.161.134]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 893F084400D; Mon, 24 Jan 2011 12:37:41 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 0F6C725BA; Mon, 24 Jan 2011 12:37:38 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p0OBbRCM064796; Mon, 24 Jan 2011 12:37:27 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 24 Jan 2011 12:37:27 +0100 Message-ID: <20110124123727.15733vpspdc31xq8@webmail.leidinger.net> Date: Mon, 24 Jan 2011 12:37:27 +0100 From: Alexander Leidinger To: Oliver Fromme References: <201101232040.p0NKecDg053547@lurza.secnetix.de> In-Reply-To: <201101232040.p0NKecDg053547@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 893F084400D.A56EB X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_UV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1296473865.23733@/yi1q4Yi+adjVTEifEhN4w X-EBL-Spam-Status: No Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 11:37:49 -0000 Quoting Oliver Fromme (from Sun, 23 Jan 2011 21:40:38 +0100 (CET)): > The Logitech C210 is a UVC webcam (USB video class), and > webcamd includes a uvc driver, but it says that it is V4L2 > only. On the other hand, the Linuxulator's video device > translation layer does not support V4L2, as far as I know. Correct. > Is that the reason why Skype cannot see my webcam? If so, Probably yes. > what's the recommended way to solve the problem? All of Implement v4l2 support in the linuxulator. Have a look at the emulation archive, nox@ just implemented DVB support in the same way the v4l(1) support was done: looking at the IOCTLs to determine which depend upon IOW/IOR macros (the values are switched between FreeBSD and linux), and to translate pointers (important for the linux32 on amd64 part). Coding this is not hard, but the analysis is time consuming. I'm sure he is willing to explain some things in case you want to get started. We have the permission to import the v4l2 header (I got the permission from the authors). It's already in the vendor area, but as we do not have code which uses it, it is not imported into head. > the webcams currently available for purchase seem to be > UVC ones, so I'm probably stuck with Windows. :-( Bye, Alexander. -- Natives who beat drums to drive off evil spirits are objects of scorn to smart Americans who blow horns to break up traffic jams. -- Mary Ellen Kelly http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 15:21:17 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 2878D1065670 for ; Mon, 24 Jan 2011 15:21:17 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9E21C8FC1F for ; Mon, 24 Jan 2011 15:21:16 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p0OFL0gh099376; Mon, 24 Jan 2011 16:21:15 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p0OFKxR4099375; Mon, 24 Jan 2011 16:20:59 +0100 (CET) (envelope-from olli) Date: Mon, 24 Jan 2011 16:20:59 +0100 (CET) Message-Id: <201101241520.p0OFKxR4099375@lurza.secnetix.de> From: Oliver Fromme To: freebsd-emulation@FreeBSD.ORG, luchesar.iliev@gmail.com In-Reply-To: <4D3D3F9C.9010608@gmail.com> X-Newsgroups: list.freebsd-emulation User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Mon, 24 Jan 2011 16:21:15 +0100 (CET) Cc: Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 15:21:17 -0000 Luchesar V. ILIEV wrote: > Probably that's totally irrelevant to your problem, but you might try > running Skype like the following and see if it makes any difference: > > $ LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so /path/to/skype You cannot link a FreeBSD library to a Linux binary. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd $ dd if=/dev/urandom of=test.pl count=1 $ file test.pl test.pl: perl script text executable From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 15:45: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 89E4A1065675; Mon, 24 Jan 2011 15:45:02 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id E1CA08FC12; Mon, 24 Jan 2011 15:45:01 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p0OFijD9001128; Mon, 24 Jan 2011 16:45:00 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p0OFijxF001127; Mon, 24 Jan 2011 16:44:45 +0100 (CET) (envelope-from olli) Date: Mon, 24 Jan 2011 16:44:45 +0100 (CET) Message-Id: <201101241544.p0OFijxF001127@lurza.secnetix.de> From: Oliver Fromme To: freebsd-emulation@FreeBSD.ORG, arundel@FreeBSD.ORG In-Reply-To: <20110124101338.GA68332@freebsd.org> X-Newsgroups: list.freebsd-emulation User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Mon, 24 Jan 2011 16:45:00 +0100 (CET) Cc: Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 15:45:02 -0000 Alexander Best wrote: > Oliver Fromme wrote: > > On my FreeBSD box I've installed webcamd and all of its > > dependencies, as per HPS' documentation. Basically the > > webcam seems to work: I get a clear picture in pwcview(1). > > However, Skype doesn't seem to recognize the video device > > (I have installed skype-2.0.0.72,1 from ports). > > [...] > > > > There's a second issue, but I think it's not related to > > emulation: The microphone doesn't seem to be supported. > > I haven't found anything related to audio in the webcamd > > documentation, so I guess it doesn't support microphones > > at all. I don't get any separate audio decvice listed > > in the output of usbconfig(8). Do I have to purchase a > > separate microphone, even though the C210 webcam already > > has a built-in one? > > i think sound doesn't work with recent versions of skype, because they > abandoned OSS support. you might want to try skype 2.0.*, instead of > version 2.1.*. As I already wrote above: I have installed skype-2.0.0.72,1 from ports. It does support OSS. The missing microphone function is not a Skype problem, it's a driver problem. I do not even get a device node for the webcam's microphone, according to /dev/sndstat. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Life is short (You need Python)" -- Bruce Eckel, ANSI C++ Comitee member, author of "Thinking in C++" and "Thinking in Java" From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 24 16:44:13 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 2E4DE106564A for ; Mon, 24 Jan 2011 16:44:13 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8A6718FC16 for ; Mon, 24 Jan 2011 16:44:12 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p0OGhuZe003564; Mon, 24 Jan 2011 17:44:11 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p0OGhtU9003563; Mon, 24 Jan 2011 17:43:55 +0100 (CET) (envelope-from olli) Date: Mon, 24 Jan 2011 17:43:55 +0100 (CET) Message-Id: <201101241643.p0OGhtU9003563@lurza.secnetix.de> From: Oliver Fromme To: freebsd-emulation@FreeBSD.ORG, Alexander@leidinger.net In-Reply-To: <20110124123727.15733vpspdc31xq8@webmail.leidinger.net> X-Newsgroups: list.freebsd-emulation User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Mon, 24 Jan 2011 17:44:11 +0100 (CET) Cc: Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 24 Jan 2011 16:44:13 -0000 Alexander Leidinger wrote: > Oliver Fromme wrote: > > > The Logitech C210 is a UVC webcam (USB video class), and > > webcamd includes a uvc driver, but it says that it is V4L2 > > only. On the other hand, the Linuxulator's video device > > translation layer does not support V4L2, as far as I know. > > Correct. > > > Is that the reason why Skype cannot see my webcam? If so, > > Probably yes. Hmm. In the meantime I've looked at the source of pwcview, and it seems to be V4L, too (not V4L2). But pwcview _does_ work, unlike Skype. I'm confused now. Is there an easy way to check whether V4L or V4L2 is in use? I'm somewhat reluctant to spend hours or days on implementing an interface, just to find out that the problem is somehwere else. At the moment I have near zero knowledge about V4L/V4L2, as you can probably guess from my questions. ;-) > [...] > We have the permission to import the v4l2 header (I got the permission > from the authors). It's already in the vendor area, but as we do not > have code which uses it, it is not imported into head. Where is it, exactly? I can only see the V4L one in the vendor area. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing."         -- Mother Teresa From owner-freebsd-emulation@FreeBSD.ORG Tue Jan 25 10:50:06 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 F3FD21065673 for ; Tue, 25 Jan 2011 10:50:05 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id A314B8FC16 for ; Tue, 25 Jan 2011 10:50:05 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A6E3.dip.t-dialin.net [87.179.166.227]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1301B84400D; Tue, 25 Jan 2011 11:50:00 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id DFADC2686; Tue, 25 Jan 2011 11:49:56 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p0PAnp39085757; Tue, 25 Jan 2011 11:49:51 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 25 Jan 2011 11:49:51 +0100 Message-ID: <20110125114951.2138361gfuaplh44@webmail.leidinger.net> Date: Tue, 25 Jan 2011 11:49:51 +0100 From: Alexander Leidinger To: Oliver Fromme References: <201101241643.p0OGhtU9003563@lurza.secnetix.de> In-Reply-To: <201101241643.p0OGhtU9003563@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 1301B84400D.A60B1 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.428, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_UV 0.08, TW_WC 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1296557402.14216@/aH1DQ4hmjEHoQpeIGNE6w X-EBL-Spam-Status: No Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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, 25 Jan 2011 10:50:06 -0000 Quoting Oliver Fromme (from Mon, 24 Jan 2011 17:43:55 +0100 (CET)): > Alexander Leidinger wrote: > > Oliver Fromme wrote: > > > > > The Logitech C210 is a UVC webcam (USB video class), and > > > webcamd includes a uvc driver, but it says that it is V4L2 > > > only. On the other hand, the Linuxulator's video device > > > translation layer does not support V4L2, as far as I know. > > > > Correct. > > > > > Is that the reason why Skype cannot see my webcam? If so, > > > > Probably yes. > > Hmm. In the meantime I've looked at the source of pwcview, > and it seems to be V4L, too (not V4L2). But pwcview _does_ > work, unlike Skype. I'm confused now. > > Is there an easy way to check whether V4L or V4L2 is in use? Add some printf in linux_ioctl.h, this way you see directly what is used (as we only have v4l there, you do not see v4l2 ones, but you can see what it tries to do and which response is given). This way you can be sure what happens. > I'm somewhat reluctant to spend hours or days on implementing > an interface, just to find out that the problem is somehwere > else. Off course. > At the moment I have near zero knowledge about V4L/V4L2, as > you can probably guess from my questions. ;-) I do not know/enough much about v4l2 either... :) > > [...] > > We have the permission to import the v4l2 header (I got the permission > > from the authors). It's already in the vendor area, but as we do not > > have code which uses it, it is not imported into head. > > Where is it, exactly? I can only see the V4L one in the > vendor area. Ooops, sorry, it seems I didn't import it, but if you look at the README (http://svn.freebsd.org/viewvc/base/vendor/v4l/README?revision=200107&view=markup) you will see that we have the permission to use the v4l2 one. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-freebsd-emulation@FreeBSD.ORG Tue Jan 25 21:07:00 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 9180810657F0; Tue, 25 Jan 2011 21:07:00 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C03E38FC1F; Tue, 25 Jan 2011 21:06:59 +0000 (UTC) Received: by fxm16 with SMTP id 16so237834fxm.13 for ; Tue, 25 Jan 2011 13:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=/nocpxit+w7vDvB9ObYdfyfGHM+8HG/4MJxyrIgFcGU=; b=QEK0SPUYjHcbJn2VNhOoUQDD6F5WJw9SIHONXs/rH8wYk9v+KghfVyCymRdkiNSloP w2Wx6wx413ZVcDIjTV3TMtr9tduVnWwZUl+ikI6MmiQcAOpn6tICwqpilrXYb5dmbDBX zGakzSyklEiCZ4UoKAxumgcfIHbumLaTt7IHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=C03qhSeY67oO5YNMN6tZNLux9fg08FFFKCp948vKnTQGH0awSNwqVsTZv/NkcRn8yg ZWCCKZGkiwNIq9LtA1yi7UcBSRxc9PD+gxnbhaZO1LaHsGx+M0RYyf2xzkC08IDuCH7G Zz/MGb2CqP3k4z0I2c48Btv54KwSIvdpNzvoc= Received: by 10.223.86.80 with SMTP id r16mr836761fal.81.1295989618697; Tue, 25 Jan 2011 13:06:58 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id y1sm5252357fak.15.2011.01.25.13.06.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 13:06:54 -0800 (PST) From: Mikolaj Golub To: Julian Elischer References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> X-Comment-To: Julian Elischer Date: Tue, 25 Jan 2011 23:06:51 +0200 In-Reply-To: <4D3D2DE9.2060004@freebsd.org> (Julian Elischer's message of "Sun, 23 Jan 2011 23:44:41 -0800") Message-ID: <86tygwy9p0.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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, 25 Jan 2011 21:07:00 -0000 --=-=-= On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the >> attached patch). This has fixed the issue for me and now I am happily running >> both VNET jails and VirtualBox machines on my desktop. >> >> But the way I fixed the issue looks hackish for me. Could someone suggest a >> better solution? JE> this is probably at east partially the correct solution. JE> Usually you should also set the value back to its previous value when JE> you leave that code as well. Thank you for the comments. Actually the patch contained CURVNET_RESTORE() too. I just did not mentioned it :-). So if it looks like right solution here is an "improved" version of the patch: vnet to switch is taken from thread's ucred (on interface initialization) or from ifp->if_vnet. >> In case someone is interested in trying this patch, below are the instructions >> how to build "VIMAGE safe" vbox driver from ports: >> >> cd /usr/ports/emulators/virtualbox-ose-kmod >> make patch >> cd work >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch >> cd .. >> VIMAGE=1 make >> -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=VirtualBox-3.2.12.VIMAGE.1.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-25 22:48:26.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-25 22:48:26.000000000 +0200 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include #include @@ -322,6 +324,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + CURVNET_SET_QUIET(ifp->if_vnet); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +349,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +367,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +382,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } @@ -409,6 +415,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +445,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -452,6 +460,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +490,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -498,6 +508,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS int error; ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); if (fDst & INTNETTRUNKDIR_WIRE) { @@ -539,6 +550,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +568,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +615,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -611,6 +625,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX struct ifnet *ifp, *ifp0; ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); /* * Attempt to check if the interface is still there and re-initialize if * something has changed. @@ -628,6 +643,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + CURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -669,6 +685,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF Log(("%s: fActive:%d\n", __func__, fActive)); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); memset(&ifreq, 0, sizeof(struct ifreq)); @@ -742,6 +759,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + CURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 02:13:59 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 830C7106566B; Wed, 26 Jan 2011 02:13:59 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 550678FC15; Wed, 26 Jan 2011 02:13:59 +0000 (UTC) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0Q24t4M064150 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 26 Jan 2011 02:05:07 GMT (envelope-from julian@freebsd.org) Message-ID: <4D3F8357.2070005@freebsd.org> Date: Tue, 25 Jan 2011 18:13:43 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> In-Reply-To: <86tygwy9p0.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 02:13:59 -0000 On 1/25/11 1:06 PM, Mikolaj Golub wrote: > On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: > > JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: > > >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > >> attached patch). This has fixed the issue for me and now I am happily running > >> both VNET jails and VirtualBox machines on my desktop. > >> > >> But the way I fixed the issue looks hackish for me. Could someone suggest a > >> better solution? > JE> this is probably at east partially the correct solution. > JE> Usually you should also set the value back to its previous value when > JE> you leave that code as well. > > Thank you for the comments. Actually the patch contained CURVNET_RESTORE() > too. I just did not mentioned it :-). So if it looks like right solution here > is an "improved" version of the patch: vnet to switch is taken from thread's > ucred (on interface initialization) or from ifp->if_vnet. yes I like it.. Now you just need a port person to patch the port :-) > >> In case someone is interested in trying this patch, below are the instructions > >> how to build "VIMAGE safe" vbox driver from ports: > >> > >> cd /usr/ports/emulators/virtualbox-ose-kmod > >> make patch > >> cd work > >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > >> cd .. > >> VIMAGE=1 make > >> > From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 09:04: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 CBB2D1065674; Wed, 26 Jan 2011 09:04:02 +0000 (UTC) (envelope-from fli@shapeshifter.se) Received: from mx1.h3q.net (mx1.h3q.net [IPv6:2001:16d8:ffe5:1::f1]) by mx1.freebsd.org (Postfix) with ESMTP id 8C24C8FC0A; Wed, 26 Jan 2011 09:04:02 +0000 (UTC) Received: from smtp-auth.h3q.net (smtp-auth.h3q.net [127.0.0.1]) (Authenticated sender: hidden) by mx1.h3q.net (Postfix) with ESMTPSA id D36F533C57 ; Wed, 26 Jan 2011 10:04:00 +0100 (CET) Message-ID: <4D3FE380.2020304@shapeshifter.se> Date: Wed, 26 Jan 2011 10:04:00 +0100 From: Fredrik Lindberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> In-Reply-To: <4D3F8357.2070005@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@freebsd.org, Julian Elischer , freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 09:04:02 -0000 On 01/26/2011 03:13 AM, Julian Elischer wrote: > On 1/25/11 1:06 PM, Mikolaj Golub wrote: >> On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: >> >> JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> >> >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" >> functions >> >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default >> vnet (see the >> >> attached patch). This has fixed the issue for me and now I am >> happily running >> >> both VNET jails and VirtualBox machines on my desktop. >> >> >> >> But the way I fixed the issue looks hackish for me. Could someone >> suggest a >> >> better solution? >> JE> this is probably at east partially the correct solution. >> JE> Usually you should also set the value back to its previous value when >> JE> you leave that code as well. >> >> Thank you for the comments. Actually the patch contained >> CURVNET_RESTORE() >> too. I just did not mentioned it :-). So if it looks like right >> solution here >> is an "improved" version of the patch: vnet to switch is taken from >> thread's >> ucred (on interface initialization) or from ifp->if_vnet. > > yes I like it.. Now you just need a port person to patch the port :-) > You should make sure it gets merged with the upstream source too. Fredrik From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 09:20:09 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 0DF0B1065673; Wed, 26 Jan 2011 09:20:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 80A3D8FC13; Wed, 26 Jan 2011 09:20:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 5AA9741C72F; Wed, 26 Jan 2011 10:20:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id OFad-UFQoGtt; Wed, 26 Jan 2011 10:20:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 77FBE41C72C; Wed, 26 Jan 2011 10:20:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C2F314448F3; Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Date: Wed, 26 Jan 2011 09:15:46 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86tygwy9p0.fsf@kopusha.home.net> Message-ID: <20110126091038.C3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 09:20:09 -0000 On Tue, 25 Jan 2011, Mikolaj Golub wrote: > > On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: > > JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: > > >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > >> attached patch). This has fixed the issue for me and now I am happily running > >> both VNET jails and VirtualBox machines on my desktop. > >> > >> But the way I fixed the issue looks hackish for me. Could someone suggest a > >> better solution? > JE> this is probably at east partially the correct solution. > JE> Usually you should also set the value back to its previous value when > JE> you leave that code as well. > > Thank you for the comments. Actually the patch contained CURVNET_RESTORE() > too. I just did not mentioned it :-). So if it looks like right solution here > is an "improved" version of the patch: vnet to switch is taken from thread's > ucred (on interface initialization) or from ifp->if_vnet. > > >> In case someone is interested in trying this patch, below are the instructions > >> how to build "VIMAGE safe" vbox driver from ports: > >> > >> cd /usr/ports/emulators/virtualbox-ose-kmod > >> make patch > >> cd work > >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > >> cd .. > >> VIMAGE=1 make I think you should wrap the CURVNET changes in __FreeBSD_version checks so that the port, should it run elsewhere or on older FreeBSDs (if it runs there) not trouble people having to patch it away. #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 #endif might be a save bet. /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 09:37:48 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 86AB41065787; Wed, 26 Jan 2011 09:37:48 +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 E52FB8FC1F; Wed, 26 Jan 2011 09:37:46 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 2FD27A; Wed, 26 Jan 2011 10:24:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Wed, 26 Jan 2011 10:22:40 +0100 From: Bernhard Froehlich To: Julian Elischer In-Reply-To: <4D3F8357.2070005@freebsd.org> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> Message-ID: <62fcd16074e526547c3417a8f259174e@bluelife.at> X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5-rc X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0205.4D3FE7DF.02A9,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 09:37:48 -0000 On Tue, 25 Jan 2011 18:13:43 -0800, Julian Elischer wrote: > On 1/25/11 1:06 PM, Mikolaj Golub wrote: >> On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: >> >> JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> >> >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions >> >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the >> >> attached patch). This has fixed the issue for me and now I am happily running >> >> both VNET jails and VirtualBox machines on my desktop. >> >> >> >> But the way I fixed the issue looks hackish for me. Could someone suggest a >> >> better solution? >> JE> this is probably at east partially the correct solution. >> JE> Usually you should also set the value back to its previous value when >> JE> you leave that code as well. >> >> Thank you for the comments. Actually the patch contained CURVNET_RESTORE() >> too. I just did not mentioned it :-). So if it looks like right solution here >> is an "improved" version of the patch: vnet to switch is taken from thread's >> ucred (on interface initialization) or from ifp->if_vnet. > > yes I like it.. Now you just need a port person to patch the port :-) Sounds like it's my turn now. Which FreeBSD version is required to be able to use it? Is VIMAGE enabled per default and what happens if VIMAGE is disabled - does it at least build fine with that patch? For Mikolaj Golub to get this patch upstream we need that you either agree that his patch is under the MIT License or sign a Sun Contributors Agreement. Then we can submit that patch upstream or you can do it yourself if you prefer. Read here: http://www.virtualbox.org/wiki/Contributor_information -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:00:59 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 447C81065670 for ; Wed, 26 Jan 2011 14:00:59 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id CAB7A8FC0A for ; Wed, 26 Jan 2011 14:00:58 +0000 (UTC) Received: from [193.31.11.193] (helo=current.Sisis.de) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Pi5vd-00051R-Dr for freebsd-emulation@freebsd.org; Wed, 26 Jan 2011 15:00:57 +0100 Received: from current.Sisis.de (current [127.0.0.1]) by current.Sisis.de (8.14.3/8.14.3) with ESMTP id p0QE1537001941 for ; Wed, 26 Jan 2011 15:01:05 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by current.Sisis.de (8.14.3/8.14.3/Submit) id p0QE15ui001940 for freebsd-emulation@freebsd.org; Wed, 26 Jan 2011 15:01:05 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: current.Sisis.de: guru set sender to guru@unixarea.de using -f Date: Wed, 26 Jan 2011 15:01:04 +0100 From: Matthias Apitz To: freebsd-emulation@freebsd.org Message-ID: <20110126140104.GA1866@current.Sisis.de> References: <20110121121455.GA2413@current.Sisis.de> <201101211350.p0LDoii3017220@lurza.secnetix.de> <20110122084820.GA3845@tinyCurrent> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110122084820.GA3845@tinyCurrent> X-Operating-System: FreeBSD 8.0-CURRENT (i386) User-Agent: Mutt/1.5.19 (2009-01-05) X-Con-Id: 51246 X-Originating-IP: 193.31.11.193 Subject: Re: skype-2.0.0.72,1 && font size X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:00:59 -0000 El día Saturday, January 22, 2011 a las 09:48:20AM +0100, Matthias Apitz escribió: > El día Friday, January 21, 2011 a las 02:50:44PM +0100, Oliver Fromme escribió: > > > When the dpi value is incorrect, i.e. too high, then some > > applications will think that your screen is much smaller > > than it really is, so they adjust the sizes of fonts and > > icons to be bigger. This is exactly the symptom that you > > are seeing. > > > > For a quick check, restart your X server with the option > > -dpi 100 (or modify your xorg.conf appropriately) and > > verify the font sizes in your applications. If it's > > better, then just keep it that way. > > The -dpi flag did not work for me, but inserting the size into xorg.conf > as 330 185 (mm) works fine and the fonts are now nice in Skype as they > have been before lifting up this FreeBSD installation into a VM on the > same laptop where it run before as host system. This was said to early :-(( The dpi value is fine now: $ xdpyinfo | fgrep dots resolution: 146x146 dots per inch and mostly Skype comes up with 8p fonts, but sometimes it changes back to ugly 10p fonts; it seems that there is some relation with the following applications on the same desktop KDE 3.5: Evolution 2.24.5 Firefox 3.0.7 Pidgin 2.7.9 until now I don't see the exact rule, but one of them changes the font size in Skype (and in Pidgin, too); matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/ From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:04:24 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 C440F106564A; Wed, 26 Jan 2011 14:04:24 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 271BF8FC23; Wed, 26 Jan 2011 14:04:23 +0000 (UTC) Received: by fxm16 with SMTP id 16so1069236fxm.13 for ; Wed, 26 Jan 2011 06:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=1I5TNmDans07HCiUJ3lfP9vUV+xtcKpH7h86Z3g/Ag0=; b=Qar92HIpDKIBhHNx8a/Mn4ESgdmnHOCuYQWf/2iZjnbcA4E5qC80O8CPSlDdRJzPML wtOuMBUvvwrxlMNDEgWWNyLImw9vebXyen5kfa9sbQXQjLD/tlM4bA6r2oxDJD8KoEPl 3EcDvMsIR0oHo0PBddZr2/Hwj5vZVdFlVUlPE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=wQereZhKbc6mlGZ4Dy4lE25JzYhhVg8Dv7iFaM9XZSUz/miFD9/h21PfOIbbM9FqoT Kw2LlkZ9hbRBzFuy84Zqs49uO8aX1O6yvV58F2bNU7xvqbso0NPrm7hg814q05pc7Wah TpWY4/WWTg6vhSg2J2k3b++fqiqq6m5B0EHLo= Received: by 10.223.78.205 with SMTP id m13mr7293665fak.79.1296050662831; Wed, 26 Jan 2011 06:04:22 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id b7sm5514154faa.18.2011.01.26.06.04.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 06:04:18 -0800 (PST) From: Mikolaj Golub To: "Bjoern A. Zeeb" Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> Date: Wed, 26 Jan 2011 16:04:16 +0200 In-Reply-To: <20110126091038.C3489@maildrop.int.zabbadoz.net> (Bjoern A. Zeeb's message of "Wed, 26 Jan 2011 09:15:46 +0000 (UTC)") Message-ID: <86aainkbhb.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 14:04:25 -0000 --=-=-= On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs BAZ> (if it runs there) not trouble people having to patch it away. BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 BAZ> #endif BAZ> might be a save bet. Thanks. Something like in the patch below? Note, I have not run this version yet. Will test it tonight or tomorrow. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=VirtualBox-3.2.12.VIMAGE.2.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-26 15:47:27.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-26 15:56:41.000000000 +0200 @@ -97,6 +97,21 @@ static int ng_vboxnetflt_mod_even /** mbuf packet tag */ #define PACKET_TAG_VBOX 128 +#if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 +#include +#include + +#define VBOXCURVNET_SET(arg) CURVNET_SET_QUIET(arg) +#define VBOXCURVNET_SET_FROM_UCRED() VBOXCURVNET_SET(CRED_TO_VNET(curthread->td_ucred)) +#define VBOXCURVNET_RESTORE() CURVNET_RESTORE() + +#else + +#define VBOXCURVNET_SET(arg) +#define VBOXCURVNET_SET_FROM_UCRED() +#define VBOXCURVNET_RESTORE() +#endif + /* * Netgraph command list, we don't support any * additional commands. @@ -322,6 +337,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + VBOXCURVNET_SET(ifp->if_vnet); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +362,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +380,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +395,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return (0); } @@ -409,6 +428,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + VBOXCURVNET_SET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +458,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + VBOXCURVNET_RESTORE(); } /** @@ -452,6 +473,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + VBOXCURVNET_SET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +503,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + VBOXCURVNET_RESTORE(); } /** @@ -498,6 +521,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS int error; ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); if (fDst & INTNETTRUNKDIR_WIRE) { @@ -539,6 +563,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + VBOXCURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +581,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + VBOXCURVNET_SET_FROM_UCRED(); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +628,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + VBOXCURVNET_RESTORE(); return VINF_SUCCESS; } @@ -611,6 +638,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX struct ifnet *ifp, *ifp0; ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); /* * Attempt to check if the interface is still there and re-initialize if * something has changed. @@ -628,6 +656,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + VBOXCURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -669,6 +698,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF Log(("%s: fActive:%d\n", __func__, fActive)); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); memset(&ifreq, 0, sizeof(struct ifreq)); @@ -742,6 +772,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + VBOXCURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:20:06 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 BCA89106564A; Wed, 26 Jan 2011 14:20:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 7022D8FC1C; Wed, 26 Jan 2011 14:20:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CB66241C6F2; Wed, 26 Jan 2011 15:20:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id aae-Mn4ReFSq; Wed, 26 Jan 2011 15:20:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 72D2741C6A7; Wed, 26 Jan 2011 15:20:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 309484448F3; Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Date: Wed, 26 Jan 2011 14:18:03 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86aainkbhb.fsf@zhuzha.ua1> Message-ID: <20110126141636.D3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 14:20:06 -0000 On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: > > BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version > BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs > BAZ> (if it runs there) not trouble people having to patch it away. > > BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 > BAZ> #endif > > BAZ> might be a save bet. > > Thanks. Something like in the patch below? > > Note, I have not run this version yet. Will test it tonight or tomorrow. Well, you will need to include as well, and that only if you are on FreeBSD so you'll need an extra check for just that I guess. Not sure how vbox handles the all this in their guts. /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:25:59 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 9F1D2106566B; Wed, 26 Jan 2011 14:25:59 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D32888FC14; Wed, 26 Jan 2011 14:25:58 +0000 (UTC) Received: by fxm16 with SMTP id 16so1089305fxm.13 for ; Wed, 26 Jan 2011 06:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=AtZ/NahZMeHDXv6oYdbU7L+jDGIYW1y0I56fpzyVyAA=; b=JaZz5291VwR4VZ3KlLc3nmLZma0ZUut13LPfCVDlYNdl6jF6q7dtnZfVffkgQ58F7C FDYakOhQpAwXVHxnO6MaB0uF4SWrEvNVQdRX7HNNTl96Q3Xr5lE8tXEeBxJd3j1rMElC MysjUJA6xKiyOpw6/E4QP3GU+iCuDCIlt8+Ac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=KKobyX3uDfTHUwR7xMv5xGA4aHhxuQLoXinq4s7Mt3a6s85lJuQ9r2mRC+PbZd78s/ OZQtUkuMvoV23BkRiBsNNkBvFp3XEkl01gFVDh0mJpcif282tBu0cwBRb0XsB0KouVeI geTu3zi3Q7Rq27nj3lsNnI9Sev9ipWCI1APss= Received: by 10.223.83.11 with SMTP id d11mr7284374fal.37.1296051932203; Wed, 26 Jan 2011 06:25:32 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id f24sm5523671fak.24.2011.01.26.06.25.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 06:25:30 -0800 (PST) From: Mikolaj Golub To: Bernhard Froehlich Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> Date: Wed, 26 Jan 2011 16:25:28 +0200 In-Reply-To: <62fcd16074e526547c3417a8f259174e@bluelife.at> (Bernhard Froehlich's message of "Wed, 26 Jan 2011 10:22:40 +0100") Message-ID: <8662tbkahz.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, Julian Elischer , freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 14:25:59 -0000 On Wed, 26 Jan 2011 10:22:40 +0100 Bernhard Froehlich wrote: BF> Sounds like it's my turn now. Which FreeBSD version is required to be BF> able to use it? As Bjoern noted it is for __FreeBSD_version >= 800500. BF> Is VIMAGE enabled per default and what happens if VIMAGE is disabled - BF> does it at least build fine with that patch? We have VIMAGE disabled by default. I have added to src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile: .if defined(VIMAGE) CFLAGS += -DVIMAGE .endif So to build the driver for VIMAGE enabled kernel one should run VIMAGE=1 make If VIMAGE variable is not defined the module for VIMAGE disabled kernel will be built. I am not familiar with VBox build process so there might be a better solution. I suppose we should have an option in ports, something: .if ${OSVERSION} < 800500 OPTIONS+= VIMAGE "Build for VIMAGE kernel" off .endif and if it is on set VIMAGE make environment variable. Or may be you have a better solution. BF> For Mikolaj Golub to get this patch upstream we need that you either BF> agree that his patch is under the MIT License or sign a Sun Contributors BF> Agreement. Then we can submit that patch upstream or you can do it BF> yourself if you prefer. Read here: BF> http://www.virtualbox.org/wiki/Contributor_information MIT License is ok. It would be very nice of you if you submitted the patch upstream :-). If nobody do this then I will try to submit it myself. -- Mikolaj Golub From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:31:44 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 6B264106566B; Wed, 26 Jan 2011 14:31:44 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD4F58FC12; Wed, 26 Jan 2011 14:31:43 +0000 (UTC) Received: by wyf19 with SMTP id 19so975661wyf.13 for ; Wed, 26 Jan 2011 06:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=I9GsuLScg2d25gl5bBq9ykfKYKtebZ2m6htucFmjCfA=; b=BecvcSCUR9l7IEmpdgJb8z6GcXTQ1+H1TV3RcI0C6bSPNgWLKBIydLEMQOGWEtm79X sCFJo+7T4t5FNq05xEI2dabgxYKbbyf82/kh9p51S3/++pIAKohHRKLUUtDgkVq2NFNa PNMIEnnkRXHWonq382j2ZWHa1EB21AvhcxhI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=D667OfElYhZ6pcNOqxT4daq9xLN1/VfGcswRwq+Y+nCWt+H3MKp4ZKksnVWv7i4D6M 8cIrIwezz1/hhjRDt4BdmGalS5sKLqXDiV5qXXEM728ZfWv9ovhfyj5lz/p7tnTSrBW2 8T4OG/1lYCVy/5+ZXgYMOnekgkr5vZmul7kJ8= MIME-Version: 1.0 Received: by 10.216.73.203 with SMTP id v53mr526229wed.48.1296052302356; Wed, 26 Jan 2011 06:31:42 -0800 (PST) Received: by 10.216.36.71 with HTTP; Wed, 26 Jan 2011 06:31:42 -0800 (PST) In-Reply-To: <8662tbkahz.fsf@zhuzha.ua1> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Date: Wed, 26 Jan 2011 08:31:42 -0600 Message-ID: From: Brandon Gooch To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Julian Elischer , freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 14:31:44 -0000 On Wed, Jan 26, 2011 at 8:25 AM, Mikolaj Golub wr= ote: [SNIP] > I suppose we should have an option in ports, something: > > .if ${OSVERSION} < 800500 > OPTIONS+=3D =A0 =A0 =A0 =A0VIMAGE "Build for VIMAGE kernel" off > .endif > > and if it is on set VIMAGE make environment variable. Or may be you have > a better solution. As of r217203 on 9-CURRENT and r217403 on 8-STABLE, VIMAGE is announced as a feature via sysctl(8). Would it be possible to query this value to decide how to build the module? [SNIP] -Brandon From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 14:45:07 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 BD6081065675; Wed, 26 Jan 2011 14:45:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 70DB58FC19; Wed, 26 Jan 2011 14:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 71D3741C730; Wed, 26 Jan 2011 15:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id KR3cmD5L2fNl; Wed, 26 Jan 2011 15:45:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 9118841C705; Wed, 26 Jan 2011 15:45:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C8047444936; Wed, 26 Jan 2011 14:40:18 +0000 (UTC) Date: Wed, 26 Jan 2011 14:40:18 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Brandon Gooch In-Reply-To: Message-ID: <20110126143845.K3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1417997109-1296052818=:3489" Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 14:45:07 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1417997109-1296052818=:3489 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 26 Jan 2011, Brandon Gooch wrote: > On Wed, Jan 26, 2011 at 8:25 AM, Mikolaj Golub = wrote: > > [SNIP] > >> I suppose we should have an option in ports, something: >> >> .if ${OSVERSION} < 800500 >> OPTIONS+=3D =A0 =A0 =A0 =A0VIMAGE "Build for VIMAGE kernel" off >> .endif >> >> and if it is on set VIMAGE make environment variable. Or may be you have >> a better solution. > > As of r217203 on 9-CURRENT and r217403 on 8-STABLE, VIMAGE is > announced as a feature via sysctl(8). Would it be possible to query > this value to decide how to build the module? It would but still leave you with problems on earlier freebsd versions or if you are building for another machine. /bz --=20 Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html --0-1417997109-1296052818=:3489-- From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 15:58:18 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 C1EC61065674 for ; Wed, 26 Jan 2011 15:58:18 +0000 (UTC) (envelope-from jacob.frelinger@duke.edu) Received: from smtp.duke.edu (smtp-02.oit.duke.edu [152.3.174.84]) by mx1.freebsd.org (Postfix) with ESMTP id 96AA98FC19 for ; Wed, 26 Jan 2011 15:58:18 +0000 (UTC) Received: from smtp.duke.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 8535F5110F5 for ; Wed, 26 Jan 2011 10:44:11 -0500 (EST) Received: from [192.168.1.222] (cpe-069-134-083-232.nc.res.rr.com [69.134.83.232]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.duke.edu (Postfix) with ESMTP id 5CFA3510E69 for ; Wed, 26 Jan 2011 10:44:11 -0500 (EST) Message-ID: <4D404145.5020507@duke.edu> Date: Wed, 26 Jan 2011 10:44:05 -0500 From: Jacob Frelinger User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101216 Thunderbird/3.0.11 MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2011.1.26.153321 Subject: odd regression in the linux emulator. 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: Wed, 26 Jan 2011 15:58:18 -0000 sometime between September 15 and December 15 something in the linuxulator changed and cause make in my chrooted linux_dist environment to stop working. All attempts to run make now die with "make: *** wait: Bad address. Stop." and an exit status of 2. A newly built gnu make also does that same thing, so I don't think it's a make problem. Google doesn't seem to offer any useful advice. I'm kind of at a loss of how to go about debugging this, so any advice would be greatly appreciated. -- Jacob Frelinger jacob.frelinger@duke.edu CBB Graduate Student From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 17:55:29 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id CB3E410656CA; Wed, 26 Jan 2011 17:55:29 +0000 (UTC) Date: Wed, 26 Jan 2011 17:55:29 +0000 From: Alexander Best To: Jacob Frelinger Message-ID: <20110126175529.GA92874@freebsd.org> References: <4D404145.5020507@duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D404145.5020507@duke.edu> Cc: freebsd-emulation@freebsd.org Subject: Re: odd regression in the linux emulator. 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: Wed, 26 Jan 2011 17:55:29 -0000 On Wed Jan 26 11, Jacob Frelinger wrote: > sometime between September 15 and December 15 something in the > linuxulator changed and cause make in my chrooted linux_dist environment > to stop working. All attempts to run make now die with "make: *** wait: > Bad address. Stop." and an exit status of 2. A newly built gnu make > also does that same thing, so I don't think it's a make problem. Google > doesn't seem to offer any useful advice. I'm kind of at a loss of how > to go about debugging this, so any advice would be greatly appreciated. could you provide the output of 'pkg_info -E linux_dist\*' please? thanks. alex btw: i also experience the problem. newer versions of linux_dist come with linux binaries that make heavy use of futextes (even 'ls'). you should see a lot of futex warnings in 'dmesg -a'. i believe the issue is with FUTEX_WAIT_BITSET. since it isn't that different from FUTEX_WAIT (which is already implemented), i've started to implement it. however i don't have a lot of time atm unfortunately. > > -- > Jacob Frelinger > jacob.frelinger@duke.edu > CBB Graduate Student -- a13x From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 18:24:56 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 4C6091065672 for ; Wed, 26 Jan 2011 18:24:56 +0000 (UTC) (envelope-from jacob.frelinger@duke.edu) Received: from smtp.duke.edu (smtp-03.oit.duke.edu [152.3.174.16]) by mx1.freebsd.org (Postfix) with ESMTP id 142098FC0C for ; Wed, 26 Jan 2011 18:24:55 +0000 (UTC) Received: from smtp.duke.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 1F33F820F; Wed, 26 Jan 2011 13:24:55 -0500 (EST) Received: from [192.168.1.222] (cpe-069-134-083-232.nc.res.rr.com [69.134.83.232]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.duke.edu (Postfix) with ESMTP id EA5C88207; Wed, 26 Jan 2011 13:24:54 -0500 (EST) Message-ID: <4D4066F5.3070407@duke.edu> Date: Wed, 26 Jan 2011 13:24:53 -0500 From: Jacob Frelinger User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101216 Thunderbird/3.0.11 MIME-Version: 1.0 To: Alexander Best References: <4D404145.5020507@duke.edu> <20110126175529.GA92874@freebsd.org> In-Reply-To: <20110126175529.GA92874@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2011.1.26.181515 Cc: freebsd-emulation@freebsd.org Subject: Re: odd regression in the linux emulator. 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: Wed, 26 Jan 2011 18:24:56 -0000 On 01/26/11 12:55, Alexander Best wrote: > could you provide the output of 'pkg_info -E linux_dist\*' please? [jolly@moku ~]$ pkg_info -E linux_dist\* linux_dist-gentoo-stage3-20100622 > btw: i also experience the problem. newer versions of linux_dist come with > linux binaries that make heavy use of futextes (even 'ls'). you should see > a lot of futex warnings in 'dmesg -a'. linux: pid 8416 (gmake): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented linux: pid 8907 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented linux: pid 8908 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented yup. got those. I saw them before when everything was working though so I assumed they weren't the problem... ls generates them but seems to work just fine. I may try down porting linux_dist and seeing how that works... > i believe the issue is with FUTEX_WAIT_BITSET. since it isn't that different > from FUTEX_WAIT (which is already implemented), i've started to implement it. > however i don't have a lot of time atm unfortunately. Time seems to be a commodity in short supply for everyone. I'm no kernel hacker, but I'm happy to test patches, etc. -- Jacob Frelinger jacob.frelinger@duke.edu CBB Graduate Student From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 18:36:25 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 743591065670 for ; Wed, 26 Jan 2011 18:36:25 +0000 (UTC) (envelope-from luchesar.iliev@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id BA4B28FC20 for ; Wed, 26 Jan 2011 18:36:22 +0000 (UTC) Received: by bwz12 with SMTP id 12so1670441bwz.13 for ; Wed, 26 Jan 2011 10:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:disposition-notification-to:date :from:organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; bh=92Bawn7O8ARKlnW63iYdoSQBGmXbfCiD28yJIy+/xeY=; b=l3Z0rrcso1QHlg1ics4JCThSKPxigGUR3Cp5WizDP6Db3Cm9k4fs4YRxys6VRE6tWg CJmnE2zkbbaKjiGU+5KncmM81FruuARv3WMIjifciXi5ZDPQjCvnxsk6IFNuCxP3lESU jkAiK36pcwr3YhBNNMBzaBr0WKl9rNP93R/Sc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:disposition-notification-to:date:from:organization :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=hlfs2MnRv1PnBCv3xuFmKsLCY2OJeDFFYQkeHfdHkz0qdB2ju6k8nPlhdXXZfMot3U 56tFQh1KDXgxIelPrkRVxf4FWarisgv7HXp4iiBrbUQzSwxLRmA7gSPlXywhT12ljo4L d0Ues3mO/2VbLJ9CGxWj0B7Gs06JhKg3RRLEI= Received: by 10.204.76.131 with SMTP id c3mr712727bkk.110.1296066184991; Wed, 26 Jan 2011 10:23:04 -0800 (PST) Received: from [79.124.93.41] ([79.124.93.41]) by mx.google.com with ESMTPS id u23sm5091122bkw.21.2011.01.26.10.23.02 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 10:23:04 -0800 (PST) Message-ID: <4D406685.9040408@gmail.com> Date: Wed, 26 Jan 2011 20:23:01 +0200 From: "Luchesar V. ILIEV" Organization: Ideaconsult Ltd. User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101229 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Oliver Fromme References: <201101241520.p0OFKxR4099375@lurza.secnetix.de> In-Reply-To: <201101241520.p0OFKxR4099375@lurza.secnetix.de> X-Enigmail-Version: 1.1.2 OpenPGP: id=9A1FEEFF; url=https://cert.acad.bg/pgp-keys/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: v4l + webcamd + Logitech C210 + Skype (FreeBSD 8-stable) 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: Wed, 26 Jan 2011 18:36:25 -0000 On 01/24/2011 17:20, Oliver Fromme wrote: > Luchesar V. ILIEV wrote: > > Probably that's totally irrelevant to your problem, but you might try > > running Skype like the following and see if it makes any difference: > > > > $ LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so /path/to/skype > > You cannot link a FreeBSD library to a Linux binary. > > Best regards > Oliver > I was thinking of different example that worked, but it was not with Linux binaries, indeed; I should've given it more thought before pressing the reply button. Sorry about that. Cheers, Luchesar From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 21:08:43 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A278A106566C; Wed, 26 Jan 2011 21:08:43 +0000 (UTC) Date: Wed, 26 Jan 2011 21:08:43 +0000 From: Alexander Best To: Jacob Frelinger Message-ID: <20110126210843.GA21919@freebsd.org> References: <4D404145.5020507@duke.edu> <20110126175529.GA92874@freebsd.org> <4D4066F5.3070407@duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D4066F5.3070407@duke.edu> Cc: freebsd-emulation@freebsd.org Subject: Re: odd regression in the linux emulator. 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: Wed, 26 Jan 2011 21:08:43 -0000 On Wed Jan 26 11, Jacob Frelinger wrote: > On 01/26/11 12:55, Alexander Best wrote: > >could you provide the output of 'pkg_info -E linux_dist\*' please? > > [jolly@moku ~]$ pkg_info -E linux_dist\* > linux_dist-gentoo-stage3-20100622 > > >btw: i also experience the problem. newer versions of linux_dist come with > >linux binaries that make heavy use of futextes (even 'ls'). you should see > >a lot of futex warnings in 'dmesg -a'. > > linux: pid 8416 (gmake): linux_sys_futex: op FUTEX_WAIT_BITSET not > implemented > linux: pid 8907 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented > linux: pid 8908 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented > > yup. got those. I saw them before when everything was working though > so I assumed they weren't the problem... ls generates them but seems to > work just fine. i think you're right. the futex stuff doesn't seem to be causing problems. i performed a kdump -d/linux_ktrace sequence and this is the result: 8462 gmake RET write 67/0x43 8462 gmake CALL linux_pipe(0xffffbe08) 8462 gmake RET linux_pipe 0 8462 gmake CALL close(0x5) 8462 gmake RET close 0 8462 gmake CALL linux_fcntl64(0x3,0x2,0x1) 8462 gmake RET linux_fcntl64 0 8462 gmake CALL linux_rt_sigprocmask(0,0x806bfe0,0,0x8) 8462 gmake RET linux_rt_sigprocmask 0 8462 gmake CALL linux_vfork 8462 gmake RET linux_vfork 8463/0x210f 8462 gmake CALL linux_rt_sigprocmask(0x2,0xffffbdb0,0,0x8) 8462 gmake RET linux_rt_sigprocmask 0 8462 gmake CALL linux_wait4(0xffffffff,0xffffbe5c,0,0) 8462 gmake RET linux_wait4 RESTART 8462 gmake PSIG SIGCHLD caught handler=0x80541a0 mask=0x0 code=0x0 8462 gmake CALL linux_sigreturn(0xffffbb34) 8462 gmake RET linux_sigreturn JUSTRETURN 8462 gmake CALL linux_wait4(0xffffffffffffffff,0xffffffffffffbe5c,0,0) 8462 gmake RET linux_wait4 -1 errno 14 Bad address 8462 gmake CALL write(0x2,0xffff96b8,0xa) 8462 gmake GIO fd 2 wrote 10 bytes "make: *** " 8462 gmake RET write 10/0xa 8462 gmake CALL write(0x2,0xffff96b8,0x11) 8462 gmake GIO fd 2 wrote 17 bytes "wait: Bad address" 8462 gmake RET write 17/0x11 8462 gmake CALL write(0x2,0x8068727,0x9) 8462 gmake GIO fd 2 wrote 9 bytes ". Stop. " 8462 gmake RET write 9 8462 gmake CALL write(0x2,0xffff9618,0x6) 8462 gmake GIO fd 2 wrote 6 bytes "make: " 8462 gmake RET write 6 8462 gmake CALL write(0x2,0xffff9618,0x23) 8462 gmake GIO fd 2 wrote 35 bytes "*** Waiting for unfinished jobs...." ...so something's wrong with the linux_wait4() call. cheers. alex > > I may try down porting linux_dist and seeing how that works... > > >i believe the issue is with FUTEX_WAIT_BITSET. since it isn't that > >different > >from FUTEX_WAIT (which is already implemented), i've started to implement > >it. > >however i don't have a lot of time atm unfortunately. > > > Time seems to be a commodity in short supply for everyone. I'm no > kernel hacker, but I'm happy to test patches, etc. > > > -- > Jacob Frelinger > jacob.frelinger@duke.edu > CBB Graduate Student -- a13x From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 21:27:33 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 EEAC9106566B; Wed, 26 Jan 2011 21:27:33 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 550858FC17; Wed, 26 Jan 2011 21:27:32 +0000 (UTC) Received: by fxm16 with SMTP id 16so1499138fxm.13 for ; Wed, 26 Jan 2011 13:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=F+M6whwBSCbr/xIyy9MZrH1ZdqNg0U6NVxl+eWO67zA=; b=sc6i6CSCb2iuFRziZqJJqxaY2GU+weeS7r9hyytLmeCDGoeARo2cP7VVvFwqrgu4AA tsFH584pNmH2bpXzJJ+ocF7mn2+u0HP8rUha2OMqEZA0Vg7OOGrlwPx1LgjtRCuv43j/ imsRQKdbX4bPz0796Wl8Zh/sdax+rS/9ojjzA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=fSC8Y8ZwkGNswp1FYWZFuy27j/PQ3R3Mj6Xdf2DW1K/EN5icREVSpq4l75ExQnaBBv OwUkRRLlVMVaIrS7hlHRYb2ryJBvbul6s2BmJb43Km44IOGBJ6y2BRyvZ6ql3Qz/FefE IinoKU/p+k/8sJdlfW6T5YDjk+m8DvQ21Iccg= Received: by 10.223.86.16 with SMTP id q16mr14663fal.58.1296077251931; Wed, 26 Jan 2011 13:27:31 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id n26sm5726584fam.37.2011.01.26.13.27.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 13:27:29 -0800 (PST) From: Mikolaj Golub To: "Bjoern A. Zeeb" References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> X-Comment-To: Bjoern A. Zeeb Date: Wed, 26 Jan 2011 23:27:27 +0200 In-Reply-To: <20110126141636.D3489@maildrop.int.zabbadoz.net> (Bjoern A. Zeeb's message of "Wed, 26 Jan 2011 14:18:03 +0000 (UTC)") Message-ID: <86ei7z4aps.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 21:27:34 -0000 On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: >> >> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: >> >> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version >> BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs >> BAZ> (if it runs there) not trouble people having to patch it away. >> >> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 >> BAZ> #endif >> >> BAZ> might be a save bet. >> >> Thanks. Something like in the patch below? >> >> Note, I have not run this version yet. Will test it tonight or tomorrow. BAZ> Well, you will need to include as well, and that only if BAZ> you are on FreeBSD so you'll need an extra check for just that I BAZ> guess. Not sure how vbox handles the all this in their guts. The file has already had '#include ' among other includes. It just is not seen in the patch. The file is used only for FreeBSD driver so there is no need in extra check I think. I have tested this latest version of the patch. It works for me. -- Mikolaj Golub From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 21:55:07 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 BBA83106566B; Wed, 26 Jan 2011 21:55:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 40BB08FC0C; Wed, 26 Jan 2011 21:55:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4450341C798; Wed, 26 Jan 2011 22:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id EWL8XKftWEY7; Wed, 26 Jan 2011 22:55:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AE4EB41C7A9; Wed, 26 Jan 2011 22:55:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 4354B4448F3; Wed, 26 Jan 2011 21:51:18 +0000 (UTC) Date: Wed, 26 Jan 2011 21:51:18 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86ei7z4aps.fsf@kopusha.home.net> Message-ID: <20110126215009.T39951@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> <86ei7z4aps.fsf@kopusha.home.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 21:55:07 -0000 On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: > > BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > >> > >> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: > >> > >> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version > >> BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs > >> BAZ> (if it runs there) not trouble people having to patch it away. > >> > >> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 > >> BAZ> #endif > >> > >> BAZ> might be a save bet. > >> > >> Thanks. Something like in the patch below? > >> > >> Note, I have not run this version yet. Will test it tonight or tomorrow. > > BAZ> Well, you will need to include as well, and that only if > BAZ> you are on FreeBSD so you'll need an extra check for just that I > BAZ> guess. Not sure how vbox handles the all this in their guts. > > The file has already had '#include ' among other includes. It > just is not seen in the patch. The file is used only for FreeBSD driver so > there is no need in extra check I think. Ok, if it's freebsd only, then what you had was fine. > I have tested this latest version of the patch. It works for me. Cool. Thanks! -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 23:19:58 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 408C0106566B; Wed, 26 Jan 2011 23:19:58 +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 C5E6E8FC08; Wed, 26 Jan 2011 23:19:57 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 14BA37; Thu, 27 Jan 2011 00:22:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Thu, 27 Jan 2011 00:19:57 +0100 From: Bernhard Froehlich To: Mikolaj Golub In-Reply-To: <8662tbkahz.fsf@zhuzha.ua1> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Message-ID: X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5-rc X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0202.4D40AC1C.00A2,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: freebsd-emulation@freebsd.org, Julian Elischer , freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 23:19:58 -0000 On Wed, 26 Jan 2011 16:25:28 +0200, Mikolaj Golub wrote: > On Wed, 26 Jan 2011 10:22:40 +0100 Bernhard Froehlich wrote: > > BF> Sounds like it's my turn now. Which FreeBSD version is required to be > BF> able to use it? > > As Bjoern noted it is for __FreeBSD_version >= 800500. > > BF> Is VIMAGE enabled per default and what happens if VIMAGE is disabled - > BF> does it at least build fine with that patch? > > We have VIMAGE disabled by default. > > I have added to src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile: > > .if defined(VIMAGE) > CFLAGS += -DVIMAGE > .endif > > So to build the driver for VIMAGE enabled kernel one should run > > VIMAGE=1 make > > If VIMAGE variable is not defined the module for VIMAGE disabled kernel will > be built. http://home.bluelife.at/patches/virtualbox-ose-kmod-devel-VIMAGE.diff I've integrated it a bit better into the VirtualBox build system, added the ports stuff and updated the patch for VirtualBox 4.0.2. It is currently unclear to me why you add VIMAGE to CFLAGS but nowhere check for VIMAGE in VBoxNetFlt-freebsd.c. Shouldn't we add a check for VIMAGE in the #if defined line or is this already done somewhere deep in the included headers? -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Wed Jan 26 23:33:24 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 D1D3D106566C for ; Wed, 26 Jan 2011 23:33:24 +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 67ED88FC08 for ; Wed, 26 Jan 2011 23:33:24 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 0B5E1C; Thu, 27 Jan 2011 00:35:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Thu, 27 Jan 2011 00:33:24 +0100 From: Bernhard Froehlich To: Mikolaj Golub In-Reply-To: <86ei7z4aps.fsf@kopusha.home.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> "<20110126091038.C3489@maildrop.int.zabbadoz.net>" <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> <86ei7z4aps.fsf@kopusha.home.net> Message-ID: <44307214e4381602f6381d6a78ded1e2@bluelife.at> X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5-rc X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0208.4D40AF43.0033,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: "Bjoern A. Zeeb" , freebsd-emulation@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Wed, 26 Jan 2011 23:33:24 -0000 On Wed, 26 Jan 2011 23:27:27 +0200, Mikolaj Golub wrote: > On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: > > BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > >> > >> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: > >> > >> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version > >> BAZ> checks so that the port, should it run elsewhere or on older > FreeBSDs > >> BAZ> (if it runs there) not trouble people having to patch it away. > >> > >> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 > >> BAZ> #endif > >> > >> BAZ> might be a save bet. > >> > >> Thanks. Something like in the patch below? > >> > >> Note, I have not run this version yet. Will test it tonight or tomorrow. > > BAZ> Well, you will need to include as well, and that only if > BAZ> you are on FreeBSD so you'll need an extra check for just that I > BAZ> guess. Not sure how vbox handles the all this in their guts. > > The file has already had '#include ' among other includes. It > just is not seen in the patch. The file is used only for FreeBSD driver so > there is no need in extra check I think. > > I have tested this latest version of the patch. It works for me. Could someone with a vimage enabled kernel please test bridging with a stock emulators/virtualbox-ose-kmod port? There was a report that this causes a crash and it would be good to verify if that is still valid: http://lists.freebsd.org/pipermail/freebsd-emulation/2009-November/007055.html -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 00:23:56 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 4F629106564A; Thu, 27 Jan 2011 00:23:56 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E171D8FC31; Thu, 27 Jan 2011 00:23:55 +0000 (UTC) Received: by gwj21 with SMTP id 21so411219gwj.13 for ; Wed, 26 Jan 2011 16:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=DyX1qCknNBhxTNyDZz/6znEjvUh6ZmQqF5rXMelIn5I=; b=uIOB1FnsmQB+iyJF/75mDjvI95h5LcN2Aorpqhpq0c1tf70k9i+wBZ3p0pKONDYIr1 YTZHfojBIRuHscAuC4u+7/XKF4BDFtPWUndnXkcdQmOwREgLzGrRFi/sbSg2HnoENaI2 2wHN5wSV7qQK8OAQyxw1jgg2Y6HFJaW4eIjAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=Cqu4BKlpYqdQkJ24WmCN61SudrJt7LyUE2SKpB5Swny2cy+wWxEcotnRtl+yDkV1rI xQ++bAarJz94DMpfNVnphoC3yk92t8S7k7Nn3BBEcYI7n+UG95kwEnRi7sUuazB58BYr 38uSQ8Ct8/n0+44V87pxzDvqVMMa6wPN0QBdY= Received: by 10.236.103.133 with SMTP id f5mr428411yhg.14.1296087831231; Wed, 26 Jan 2011 16:23:51 -0800 (PST) Received: from [192.168.1.101] ([24.112.22.136]) by mx.google.com with ESMTPS id i10sm1498256yhd.39.2011.01.26.16.23.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 16:23:50 -0800 (PST) References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> <86ei7z4aps.fsf@kopusha.home.net> <44307214e4381602f6381d6a78ded1e2@bluelife.at> In-Reply-To: <44307214e4381602f6381d6a78ded1e2@bluelife.at> Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (8C148) From: Brandon Gooch Date: Wed, 26 Jan 2011 18:23:26 -0600 To: Bernhard Froehlich Cc: "Bjoern A. Zeeb" , "freebsd-emulation@freebsd.org" Subject: Re: VirtualBox + VIMAGE 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: Thu, 27 Jan 2011 00:23:56 -0000 On Jan 26, 2011, at 5:33 PM, Bernhard Froehlich wrote: > On Wed, 26 Jan 2011 23:27:27 +0200, Mikolaj Golub wrote: >> On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: >>=20 >> BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: >>=20 >>>>=20 >>>> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: >>>>=20 >>>> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version >>>> BAZ> checks so that the port, should it run elsewhere or on older >> FreeBSDs >>>> BAZ> (if it runs there) not trouble people having to patch it away. >>>>=20 >>>> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >=3D 800500 >>>> BAZ> #endif >>>>=20 >>>> BAZ> might be a save bet. >>>>=20 >>>> Thanks. Something like in the patch below? >>>>=20 >>>> Note, I have not run this version yet. Will test it tonight or tomorrow= . >>=20 >> BAZ> Well, you will need to include as well, and that only i= f >> BAZ> you are on FreeBSD so you'll need an extra check for just that I >> BAZ> guess. Not sure how vbox handles the all this in their guts. >>=20 >> The file has already had '#include ' among other includes. I= t >> just is not seen in the patch. The file is used only for FreeBSD driver s= o >> there is no need in extra check I think. >>=20 >> I have tested this latest version of the patch. It works for me. >=20 > Could someone with a vimage enabled kernel please test bridging with a > stock emulators/virtualbox-ose-kmod port? There was a report that this > causes a crash and it would be good to verify if that is still valid: >=20 > http://lists.freebsd.org/pipermail/freebsd-emulation/2009-November/007055.= html >=20 > --=20 > Bernhard Froehlich > http://www.bluelife.at/ > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.or= g" It still crashes. -Brandon= From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 11:57:25 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 EE17C106564A; Thu, 27 Jan 2011 11:57:25 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 051458FC16; Thu, 27 Jan 2011 11:57:24 +0000 (UTC) Received: by fxm16 with SMTP id 16so2171986fxm.13 for ; Thu, 27 Jan 2011 03:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=g4opZijcveMX3Ti4ApMoUszrloilRLnGXuXOvjYhIgM=; b=VknrAv4+uAxsRuE3y4MSLPgh7UnBngsJNdFuEkNN/g0EQMCwD7uL4bfDBIBED9jVaM Ke0+oua5VbEQaodYFzS3KnFTy1PnAZ3OHrpmG45mrsiJs2Qe9gtKxNPon56HcA/zscCI aKbBi5SXwcxsJQSZXiRj46IIdF0uRRG2Kcw3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=TJfJRHk7nE/kl1i7ArLtOOw/4feHO7Z5CHsSMa6iW0US1i16cY+n3v0dArGir6xV0s aVxwvLv5XaJ6gX0tQAPKDl3L2RGSzSqwbctFXWsIlwjE3wHGqy/0rUldePmwqjI+IHgV LisGoa7mzazvgijpqqzzH/cU3NeWKsE8MQZyU= Received: by 10.223.86.140 with SMTP id s12mr787631fal.145.1296129442698; Thu, 27 Jan 2011 03:57:22 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id 21sm5933406fav.17.2011.01.27.03.57.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 Jan 2011 03:57:20 -0800 (PST) From: Mikolaj Golub To: Bernhard Froehlich Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Date: Thu, 27 Jan 2011 13:57:16 +0200 In-Reply-To: (Bernhard Froehlich's message of "Thu, 27 Jan 2011 00:19:57 +0100") Message-ID: <861v3yk19f.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, Julian Elischer , freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE 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: Thu, 27 Jan 2011 11:57:26 -0000 On Thu, 27 Jan 2011 00:19:57 +0100 Bernhard Froehlich wrote: BF> http://home.bluelife.at/patches/virtualbox-ose-kmod-devel-VIMAGE.diff BF> I've integrated it a bit better into the VirtualBox build system, added BF> the ports stuff and updated the patch for VirtualBox 4.0.2. Thanks! BF> It is currently unclear to me why you add VIMAGE to CFLAGS but nowhere BF> check for VIMAGE in VBoxNetFlt-freebsd.c. Shouldn't we add a check for BF> VIMAGE in the #if defined line or is this already done somewhere deep in BF> the included headers? All magic is in net/vnet.h :-) -- Mikolaj Golub From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 13:50: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 CD6A81065672 for ; Thu, 27 Jan 2011 13:50:08 +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 BC0EC8FC0A for ; Thu, 27 Jan 2011 13:50:08 +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 p0RDo8KL078822 for ; Thu, 27 Jan 2011 13:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0RDo8uS078815; Thu, 27 Jan 2011 13:50:08 GMT (envelope-from gnats) Date: Thu, 27 Jan 2011 13:50:08 GMT Message-Id: <201101271350.p0RDo8uS078815@freefall.freebsd.org> To: freebsd-emulation@FreeBSD.org From: David Rawling Cc: Subject: Re: kern/153990: [hyper-v]: Will not install into Hyper-V on Server 2008 R2 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Rawling List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:50:08 -0000 The following reply was made to PR kern/153990; it has been noted by GNATS. From: David Rawling To: bug-followup@FreeBSD.org, twiser@orchidit.com Cc: Subject: Re: kern/153990: [hyper-v]: Will not install into Hyper-V on Server 2008 R2 Date: Fri, 28 Jan 2011 00:32:59 +1100 Is it possible that this bug and bug 153496 (http://www.freebsd.org/cgi/query-pr.cgi?pr=amd64/153496) are related in some way? FreeBSD on Hyper-V R2 worked fine with 8.0-RELEASE through 8.0-RELEASE-p5, so there appears to have been a breaking change between the 8.0 and 8.1 releases. As per 153496, I have an environment available for debugging or execution of test/debug cases if someone can tell me what needs to be done (e.g. point me at the documentation). -- David Rawling PD Consulting And Security From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 22:13:53 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 761D7106564A for ; Thu, 27 Jan 2011 22:13:53 +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 13D898FC14 for ; Thu, 27 Jan 2011 22:13:52 +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 p0RLnIuf000197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Jan 2011 23:49:18 +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 p0RLnIR0054466; Thu, 27 Jan 2011 23:49:18 +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 p0RLnIMH054465; Thu, 27 Jan 2011 23:49:18 +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: Thu, 27 Jan 2011 23:49:18 +0200 From: Kostik Belousov To: Alexander Best Message-ID: <20110127214918.GS2518@deviant.kiev.zoral.com.ua> References: <4D404145.5020507@duke.edu> <20110126175529.GA92874@freebsd.org> <4D4066F5.3070407@duke.edu> <20110126210843.GA21919@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/45fpkxfdnDqFSDa" Content-Disposition: inline In-Reply-To: <20110126210843.GA21919@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean 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-emulation@freebsd.org, Jacob Frelinger Subject: Re: odd regression in the linux emulator. 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: Thu, 27 Jan 2011 22:13:53 -0000 --/45fpkxfdnDqFSDa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 26, 2011 at 09:08:43PM +0000, Alexander Best wrote: > On Wed Jan 26 11, Jacob Frelinger wrote: > > On 01/26/11 12:55, Alexander Best wrote: > > >could you provide the output of 'pkg_info -E linux_dist\*' please? > >=20 > > [jolly@moku ~]$ pkg_info -E linux_dist\* > > linux_dist-gentoo-stage3-20100622 > >=20 > > >btw: i also experience the problem. newer versions of linux_dist come = with > > >linux binaries that make heavy use of futextes (even 'ls'). you should= see > > >a lot of futex warnings in 'dmesg -a'. > >=20 > > linux: pid 8416 (gmake): linux_sys_futex: op FUTEX_WAIT_BITSET not=20 > > implemented > > linux: pid 8907 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not impleme= nted > > linux: pid 8908 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not impleme= nted > >=20 > > yup. got those. I saw them before when everything was working though= =20 > > so I assumed they weren't the problem... ls generates them but seems t= o=20 > > work just fine. >=20 > i think you're right. the futex stuff doesn't seem to be causing problems= . i > performed a kdump -d/linux_ktrace sequence and this is the result: >=20 > 8462 gmake RET write 67/0x43 > 8462 gmake CALL linux_pipe(0xffffbe08) > 8462 gmake RET linux_pipe 0 > 8462 gmake CALL close(0x5) > 8462 gmake RET close 0 > 8462 gmake CALL linux_fcntl64(0x3,0x2,0x1) > 8462 gmake RET linux_fcntl64 0 > 8462 gmake CALL linux_rt_sigprocmask(0,0x806bfe0,0,0x8) > 8462 gmake RET linux_rt_sigprocmask 0 > 8462 gmake CALL linux_vfork > 8462 gmake RET linux_vfork 8463/0x210f > 8462 gmake CALL linux_rt_sigprocmask(0x2,0xffffbdb0,0,0x8) > 8462 gmake RET linux_rt_sigprocmask 0 > 8462 gmake CALL linux_wait4(0xffffffff,0xffffbe5c,0,0) > 8462 gmake RET linux_wait4 RESTART > 8462 gmake PSIG SIGCHLD caught handler=3D0x80541a0 mask=3D0x0 code= =3D0x0 > 8462 gmake CALL linux_sigreturn(0xffffbb34) > 8462 gmake RET linux_sigreturn JUSTRETURN > 8462 gmake CALL linux_wait4(0xffffffffffffffff,0xffffffffffffbe5c,0= ,0) > 8462 gmake RET linux_wait4 -1 errno 14 Bad address > 8462 gmake CALL write(0x2,0xffff96b8,0xa) > 8462 gmake GIO fd 2 wrote 10 bytes > "make: *** " > 8462 gmake RET write 10/0xa > 8462 gmake CALL write(0x2,0xffff96b8,0x11) > 8462 gmake GIO fd 2 wrote 17 bytes > "wait: Bad address" > 8462 gmake RET write 17/0x11 > 8462 gmake CALL write(0x2,0x8068727,0x9) > 8462 gmake GIO fd 2 wrote 9 bytes > ". Stop. > " > 8462 gmake RET write 9 > 8462 gmake CALL write(0x2,0xffff9618,0x6) > 8462 gmake GIO fd 2 wrote 6 bytes > "make: " > 8462 gmake RET write 6 > 8462 gmake CALL write(0x2,0xffff9618,0x23) > 8462 gmake GIO fd 2 wrote 35 bytes > "*** Waiting for unfinished jobs...." >=20 > ...so something's wrong with the linux_wait4() call. This should be fixed by r217991. --/45fpkxfdnDqFSDa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1B6F0ACgkQC3+MBN1Mb4gGlwCgue2clS+WPI4QU3d4C4KDBXiG Zq4AoJ9hlDTXrTbOQwg4Hclcjl5/D3Bp =KWNx -----END PGP SIGNATURE----- --/45fpkxfdnDqFSDa-- From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 22:20:59 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 169591065670; Thu, 27 Jan 2011 22:20:59 +0000 (UTC) Date: Thu, 27 Jan 2011 22:20:59 +0000 From: Alexander Best To: Kostik Belousov Message-ID: <20110127222059.GA9295@freebsd.org> References: <4D404145.5020507@duke.edu> <20110126175529.GA92874@freebsd.org> <4D4066F5.3070407@duke.edu> <20110126210843.GA21919@freebsd.org> <20110127214918.GS2518@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110127214918.GS2518@deviant.kiev.zoral.com.ua> Cc: freebsd-emulation@freebsd.org, Jacob Frelinger Subject: Re: odd regression in the linux emulator. 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: Thu, 27 Jan 2011 22:20:59 -0000 On Thu Jan 27 11, Kostik Belousov wrote: > On Wed, Jan 26, 2011 at 09:08:43PM +0000, Alexander Best wrote: > > On Wed Jan 26 11, Jacob Frelinger wrote: > > > On 01/26/11 12:55, Alexander Best wrote: > > > >could you provide the output of 'pkg_info -E linux_dist\*' please? > > > > > > [jolly@moku ~]$ pkg_info -E linux_dist\* > > > linux_dist-gentoo-stage3-20100622 > > > > > > >btw: i also experience the problem. newer versions of linux_dist come with > > > >linux binaries that make heavy use of futextes (even 'ls'). you should see > > > >a lot of futex warnings in 'dmesg -a'. > > > > > > linux: pid 8416 (gmake): linux_sys_futex: op FUTEX_WAIT_BITSET not > > > implemented > > > linux: pid 8907 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented > > > linux: pid 8908 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented > > > > > > yup. got those. I saw them before when everything was working though > > > so I assumed they weren't the problem... ls generates them but seems to > > > work just fine. > > > > i think you're right. the futex stuff doesn't seem to be causing problems. i > > performed a kdump -d/linux_ktrace sequence and this is the result: > > > > 8462 gmake RET write 67/0x43 > > 8462 gmake CALL linux_pipe(0xffffbe08) > > 8462 gmake RET linux_pipe 0 > > 8462 gmake CALL close(0x5) > > 8462 gmake RET close 0 > > 8462 gmake CALL linux_fcntl64(0x3,0x2,0x1) > > 8462 gmake RET linux_fcntl64 0 > > 8462 gmake CALL linux_rt_sigprocmask(0,0x806bfe0,0,0x8) > > 8462 gmake RET linux_rt_sigprocmask 0 > > 8462 gmake CALL linux_vfork > > 8462 gmake RET linux_vfork 8463/0x210f > > 8462 gmake CALL linux_rt_sigprocmask(0x2,0xffffbdb0,0,0x8) > > 8462 gmake RET linux_rt_sigprocmask 0 > > 8462 gmake CALL linux_wait4(0xffffffff,0xffffbe5c,0,0) > > 8462 gmake RET linux_wait4 RESTART > > 8462 gmake PSIG SIGCHLD caught handler=0x80541a0 mask=0x0 code=0x0 > > 8462 gmake CALL linux_sigreturn(0xffffbb34) > > 8462 gmake RET linux_sigreturn JUSTRETURN > > 8462 gmake CALL linux_wait4(0xffffffffffffffff,0xffffffffffffbe5c,0,0) > > 8462 gmake RET linux_wait4 -1 errno 14 Bad address > > 8462 gmake CALL write(0x2,0xffff96b8,0xa) > > 8462 gmake GIO fd 2 wrote 10 bytes > > "make: *** " > > 8462 gmake RET write 10/0xa > > 8462 gmake CALL write(0x2,0xffff96b8,0x11) > > 8462 gmake GIO fd 2 wrote 17 bytes > > "wait: Bad address" > > 8462 gmake RET write 17/0x11 > > 8462 gmake CALL write(0x2,0x8068727,0x9) > > 8462 gmake GIO fd 2 wrote 9 bytes > > ". Stop. > > " > > 8462 gmake RET write 9 > > 8462 gmake CALL write(0x2,0xffff9618,0x6) > > 8462 gmake GIO fd 2 wrote 6 bytes > > "make: " > > 8462 gmake RET write 6 > > 8462 gmake CALL write(0x2,0xffff9618,0x23) > > 8462 gmake GIO fd 2 wrote 35 bytes > > "*** Waiting for unfinished jobs...." > > > > ...so something's wrong with the linux_wait4() call. > This should be fixed by r217991. thanks a bunch. indeed this fixed the issue. :) -- a13x From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 27 23:27: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 66E2A106564A; Thu, 27 Jan 2011 23:27:14 +0000 (UTC) (envelope-from jacob.frelinger@duke.edu) Received: from smtp.duke.edu (smtp-04.oit.duke.edu [152.3.174.85]) by mx1.freebsd.org (Postfix) with ESMTP id 26C8E8FC15; Thu, 27 Jan 2011 23:27:13 +0000 (UTC) Received: from smtp.duke.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 24CBE358BBF; Thu, 27 Jan 2011 18:27:13 -0500 (EST) Received: from [192.168.1.222] (cpe-069-134-083-232.nc.res.rr.com [69.134.83.232]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.duke.edu (Postfix) with ESMTP id 99E61358BE3; Thu, 27 Jan 2011 18:27:12 -0500 (EST) Message-ID: <4D41FF4C.6050003@duke.edu> Date: Thu, 27 Jan 2011 18:27:08 -0500 From: Jacob Frelinger User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101216 Thunderbird/3.0.11 MIME-Version: 1.0 To: Kostik Belousov References: <4D404145.5020507@duke.edu> <20110126175529.GA92874@freebsd.org> <4D4066F5.3070407@duke.edu> <20110126210843.GA21919@freebsd.org> <20110127214918.GS2518@deviant.kiev.zoral.com.ua> In-Reply-To: <20110127214918.GS2518@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2011.1.27.230017 Cc: Alexander Best , freebsd-emulation@freebsd.org Subject: Re: odd regression in the linux emulator. 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: Thu, 27 Jan 2011 23:27:14 -0000 On 01/27/11 16:49, Kostik Belousov wrote: > On Wed, Jan 26, 2011 at 09:08:43PM +0000, Alexander Best wrote: >> On Wed Jan 26 11, Jacob Frelinger wrote: >>> On 01/26/11 12:55, Alexander Best wrote: >>>> could you provide the output of 'pkg_info -E linux_dist\*' please? >>> >>> [jolly@moku ~]$ pkg_info -E linux_dist\* >>> linux_dist-gentoo-stage3-20100622 >>> >>>> btw: i also experience the problem. newer versions of linux_dist come with >>>> linux binaries that make heavy use of futextes (even 'ls'). you should see >>>> a lot of futex warnings in 'dmesg -a'. >>> >>> linux: pid 8416 (gmake): linux_sys_futex: op FUTEX_WAIT_BITSET not >>> implemented >>> linux: pid 8907 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented >>> linux: pid 8908 (ls): linux_sys_futex: op FUTEX_WAIT_BITSET not implemented >>> >>> yup. got those. I saw them before when everything was working though >>> so I assumed they weren't the problem... ls generates them but seems to >>> work just fine. >> >> i think you're right. the futex stuff doesn't seem to be causing problems. i >> performed a kdump -d/linux_ktrace sequence and this is the result: >> >> 8462 gmake RET write 67/0x43 >> 8462 gmake CALL linux_pipe(0xffffbe08) >> 8462 gmake RET linux_pipe 0 >> 8462 gmake CALL close(0x5) >> 8462 gmake RET close 0 >> 8462 gmake CALL linux_fcntl64(0x3,0x2,0x1) >> 8462 gmake RET linux_fcntl64 0 >> 8462 gmake CALL linux_rt_sigprocmask(0,0x806bfe0,0,0x8) >> 8462 gmake RET linux_rt_sigprocmask 0 >> 8462 gmake CALL linux_vfork >> 8462 gmake RET linux_vfork 8463/0x210f >> 8462 gmake CALL linux_rt_sigprocmask(0x2,0xffffbdb0,0,0x8) >> 8462 gmake RET linux_rt_sigprocmask 0 >> 8462 gmake CALL linux_wait4(0xffffffff,0xffffbe5c,0,0) >> 8462 gmake RET linux_wait4 RESTART >> 8462 gmake PSIG SIGCHLD caught handler=0x80541a0 mask=0x0 code=0x0 >> 8462 gmake CALL linux_sigreturn(0xffffbb34) >> 8462 gmake RET linux_sigreturn JUSTRETURN >> 8462 gmake CALL linux_wait4(0xffffffffffffffff,0xffffffffffffbe5c,0,0) >> 8462 gmake RET linux_wait4 -1 errno 14 Bad address >> 8462 gmake CALL write(0x2,0xffff96b8,0xa) >> 8462 gmake GIO fd 2 wrote 10 bytes >> "make: *** " >> 8462 gmake RET write 10/0xa >> 8462 gmake CALL write(0x2,0xffff96b8,0x11) >> 8462 gmake GIO fd 2 wrote 17 bytes >> "wait: Bad address" >> 8462 gmake RET write 17/0x11 >> 8462 gmake CALL write(0x2,0x8068727,0x9) >> 8462 gmake GIO fd 2 wrote 9 bytes >> ". Stop. >> " >> 8462 gmake RET write 9 >> 8462 gmake CALL write(0x2,0xffff9618,0x6) >> 8462 gmake GIO fd 2 wrote 6 bytes >> "make: " >> 8462 gmake RET write 6 >> 8462 gmake CALL write(0x2,0xffff9618,0x23) >> 8462 gmake GIO fd 2 wrote 35 bytes >> "*** Waiting for unfinished jobs...." >> >> ...so something's wrong with the linux_wait4() call. > This should be fixed by r217991. This fixed the problem for me as well. Thanks! -- Jacob Frelinger jacob.frelinger@duke.edu CBB Graduate Student From owner-freebsd-emulation@FreeBSD.ORG Fri Jan 28 20:41:53 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id DF6381065670; Fri, 28 Jan 2011 20:41:53 +0000 (UTC) Date: Fri, 28 Jan 2011 20:41:53 +0000 From: Alexander Best To: freebsd-emulation@freebsd.org Message-ID: <20110128204153.GA68740@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline Subject: [patch] a few linprocfs changes 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, 28 Jan 2011 20:41:54 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline the following patch includes the following changes: @@ -176,9 +176,10 @@: - fix a style(9) issue @@ -272,7 +273,7 @@ - use CPU_FOREACH() macro rather than iterating over each cpu manually @@ -282,7 +283,6 @@ - remove comment. we don't gather the vendor, class, model, etc. data per cpu in sys/{i386,amd64}/{i386,amd64}/identcpu.c. so there's no way of accessing per cpu data in linprocfs.c, which relies on the data that gets gathered at boot time by identcpu.c. @@ -299,9 +299,10 @@ - rather calculate the elements of flags[] at compile time, instead of relying on the hardcoded value. cheers. alex -- a13x --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="linprocfs.diff" Index: linprocfs.c =================================================================== --- linprocfs.c (revision 218029) +++ linprocfs.c (working copy) @@ -176,9 +176,10 @@ swapfree = swaptotal - swapused; memshared = 0; mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) + TAILQ_FOREACH(object, &vm_object_list, object_list) { if (object->shadow_count > 1) memshared += object->resident_page_count; + } mtx_unlock(&vm_object_list_mtx); memshared *= PAGE_SIZE; /* @@ -272,7 +273,7 @@ size = sizeof(model); if (kernel_sysctl(td, hw_model, 2, &model, &size, 0, 0, 0, 0) != 0) strcpy(model, "unknown"); - for (i = 0; i < mp_ncpus; ++i) { + CPU_FOREACH(i) { sbuf_printf(sb, "processor\t: %d\n" "vendor_id\t: %.20s\n" @@ -282,7 +283,6 @@ "stepping\t: %u\n\n", i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING); - /* XXX per-cpu vendor / class / model / id? */ } sbuf_cat(sb, "flags\t\t:"); @@ -299,9 +299,10 @@ } #endif - for (i = 0; i < 32; i++) + for (i = 0; i < sizeof(flags)/sizeof(flags[0]); i++) { if (cpu_feature & (1 << i)) sbuf_printf(sb, " %s", flags[i]); + } sbuf_cat(sb, "\n"); if (class >= 5) { fqmhz = (tsc_freq + 4999) / 1000000; --6TrnltStXW4iwmi0-- From owner-freebsd-emulation@FreeBSD.ORG Fri Jan 28 20:47:17 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 3F7CA1065670; Fri, 28 Jan 2011 20:47:17 +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 165F68FC15; Fri, 28 Jan 2011 20:47:17 +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 p0SKlG1Y076695; Fri, 28 Jan 2011 20:47:16 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0SKlG6s076691; Fri, 28 Jan 2011 20:47:16 GMT (envelope-from arundel) Date: Fri, 28 Jan 2011 20:47:16 GMT Message-Id: <201101282047.p0SKlG6s076691@freefall.freebsd.org> To: arundel@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-emulation@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: kern/153887: [linux] Linux emulator not understand STB_GNU_UNIQUE binding 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, 28 Jan 2011 20:47:17 -0000 Synopsis: [linux] Linux emulator not understand STB_GNU_UNIQUE binding Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation Responsible-Changed-By: arundel Responsible-Changed-When: Fri Jan 28 20:46:59 UTC 2011 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=153887 From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 29 12:25:46 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 DC4F9106566C for ; Sat, 29 Jan 2011 12:25:46 +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 725EB8FC13 for ; Sat, 29 Jan 2011 12:25:46 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 3188C1; Sat, 29 Jan 2011 13:28:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Sat, 29 Jan 2011 13:25:45 +0100 From: Bernhard Froehlich To: Brandon Gooch In-Reply-To: References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> <86ei7z4aps.fsf@kopusha.home.net> <44307214e4381602f6381d6a78ded1e2@bluelife.at> Message-ID: X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5 X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0208.4D440748.01D4,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: "Bjoern A. Zeeb" , freebsd-emulation@freebsd.org Subject: Re: VirtualBox + VIMAGE 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, 29 Jan 2011 12:25:46 -0000 On Wed, 26 Jan 2011 18:23:26 -0600, Brandon Gooch wrote: > On Jan 26, 2011, at 5:33 PM, Bernhard Froehlich wrote: > >> On Wed, 26 Jan 2011 23:27:27 +0200, Mikolaj Golub wrote: >>> On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: >>> >>> BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: >>> >>>>> >>>>> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: >>>>> >>>>> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version >>>>> BAZ> checks so that the port, should it run elsewhere or on older >>> FreeBSDs >>>>> BAZ> (if it runs there) not trouble people having to patch it away. >>>>> >>>>> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 >>>>> BAZ> #endif >>>>> >>>>> BAZ> might be a save bet. >>>>> >>>>> Thanks. Something like in the patch below? >>>>> >>>>> Note, I have not run this version yet. Will test it tonight or tomorrow. >>> >>> BAZ> Well, you will need to include as well, and that only if >>> BAZ> you are on FreeBSD so you'll need an extra check for just that I >>> BAZ> guess. Not sure how vbox handles the all this in their guts. >>> >>> The file has already had '#include ' among other includes. It >>> just is not seen in the patch. The file is used only for FreeBSD driver so >>> there is no need in extra check I think. >>> >>> I have tested this latest version of the patch. It works for me. >> >> Could someone with a vimage enabled kernel please test bridging with a >> stock emulators/virtualbox-ose-kmod port? There was a report that this >> causes a crash and it would be good to verify if that is still valid: >> >> http://lists.freebsd.org/pipermail/freebsd-emulation/2009-November/007055.html >> >> -- >> Bernhard Froehlich >> http://www.bluelife.at/ >> _______________________________________________ >> freebsd-emulation@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-emulation >> To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" > > It still crashes. > > -Brandon Thanks for testing that. Does vbox crash or the kernel? Is it possible to get a backtrace? We could try to detect if the kernel has vimage enabled (sysctl?) and also enable the vimage option per default in the port in that case. -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 29 12:26:17 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C0B671065694; Sat, 29 Jan 2011 12:26:17 +0000 (UTC) Date: Sat, 29 Jan 2011 12:26:17 +0000 From: Alexander Best To: freebsd-emulation@freebsd.org Message-ID: <20110129122617.GA77148@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [patch] draft to add support for futex operators FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET to the linuxulator 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, 29 Jan 2011 12:26:17 -0000 hi there, i've spent a couple of hours hacking support for futex operators FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET into the linuxulator. the following patch is far from perfect and in certain places it is probably doing the wrong thing, however it doesn't seem to break anything. i'd appreciate if somebody could have a look at the patch and point out any issues. please note that the patch also contains a few unrelated comment changes and such (however only very few). thanks in advance. the patch can be found in here: http://people.freebsd.org/~arundel/drafts/futex.diff the following linux commit message should give you a rough idea about the purpose of both operators: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=commit;h=cd689985cf49f6ff5c8eddc48d98b9d581d9475d cheers. alex -- a13x From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 29 16:03:59 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 502CF106564A; Sat, 29 Jan 2011 16:03:59 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id EEC918FC08; Sat, 29 Jan 2011 16:03:58 +0000 (UTC) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 113CFC95DD; Sat, 29 Jan 2011 18:45:44 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 296682919; Sat, 29 Jan 2011 18:45:43 +0300 Received: from dchagin.static.corbina.ru (localhost [127.0.0.1]) by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id p0TFjhFX050888; Sat, 29 Jan 2011 18:45:43 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p0TFjcLY050887; Sat, 29 Jan 2011 18:45:38 +0300 (MSK) (envelope-from dchagin) Date: Sat, 29 Jan 2011 18:45:38 +0300 From: Chagin Dmitry To: Alexander Best Message-ID: <20110129154538.GA50877@dchagin.static.corbina.ru> References: <20110129122617.GA77148@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <20110129122617.GA77148@freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] draft to add support for futex operators FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET to the linuxulator 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, 29 Jan 2011 16:03:59 -0000 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 29, 2011 at 12:26:17PM +0000, Alexander Best wrote: > hi there, >=20 > i've spent a couple of hours hacking support for futex operators > FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET into the linuxulator. the followi= ng > patch is far from perfect and in certain places it is probably doing the = wrong > thing, however it doesn't seem to break anything. >=20 > i'd appreciate if somebody could have a look at the patch and point out a= ny > issues. please note that the patch also contains a few unrelated comment > changes and such (however only very few). >=20 > thanks in advance. >=20 > the patch can be found in here: >=20 > http://people.freebsd.org/~arundel/drafts/futex.diff hi, how i can test this? thnx :) --=20 Have fun! chd --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAk1ENiIACgkQ0t2Tb3OO/O1QVwCeOEsqFSoSTaEcgYpAM4cHYSRw HwsAn2uqr7altVGaQLPq1Arxys3gr9GS =ujfE -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V-- From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 29 20:28:46 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 8D6E8106566B for ; Sat, 29 Jan 2011 20:28:46 +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 0C47E8FC20 for ; Sat, 29 Jan 2011 20:28:45 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 247401E000CB; Sat, 29 Jan 2011 21:28:45 +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 p0TKA1Lb011702; Sat, 29 Jan 2011 21:10:01 +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 p0TKA1uR011701; Sat, 29 Jan 2011 21:10:01 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Sat, 29 Jan 2011 21:10:00 +0100 To: freebsd-hackers@FreeBSD.org Message-ID: <20110129201000.GA10774@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-emulation@FreeBSD.org Subject: 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, 29 Jan 2011 20:28:46 -0000 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 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() 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 ) Thanx! Juergen 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 Jan 2011 17:10:21 -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,251 @@ 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 = td->td_proc->p_vmspace; + int error; + vm_size_t size; + + + /* + * 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 boundry */ + 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) +{ + vm_map_t map; + vm_size_t size; + + map = &td->td_proc->p_vmspace->vm_map; + size = (vm_size_t) round_page(sz); + + if (!vm_map_remove(map, addr, addr + size)) + return (EINVAL); + + return (0); +} + +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 = NULL, *l_p; + struct dtv_property *vp = NULL, *p; + size_t l_propsiz, propsiz; + vm_offset_t uvp; + + 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); + if (((l_vp = malloc(l_propsiz, M_LINUX, M_WAITOK)) == NULL) || + (vp = malloc(propsiz, M_LINUX, M_WAITOK)) == NULL) { + error = ENOMEM; + goto out2; + } + 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 Jan 29 20:51:10 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 65E72106566C; Sat, 29 Jan 2011 20:51:10 +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 C67828FC08; Sat, 29 Jan 2011 20:51:09 +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 p0TKp5iG009847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Jan 2011 22:51:05 +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 p0TKp5CP052051; Sat, 29 Jan 2011 22:51:05 +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 p0TKp5SF052050; Sat, 29 Jan 2011 22:51:05 +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, 29 Jan 2011 22:51:05 +0200 From: Kostik Belousov To: Juergen Lock Message-ID: <20110129205105.GI2518@deviant.kiev.zoral.com.ua> References: <20110129201000.GA10774@triton8.kn-bremen.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DaUEczEJLvNJIL0g" Content-Disposition: inline In-Reply-To: <20110129201000.GA10774@triton8.kn-bremen.de> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean 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, 29 Jan 2011 20:51:10 -0000 --DaUEczEJLvNJIL0g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. > 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 ? > 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: >=20 > http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-January/01157= 5.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 > Thanx! > Juergen >=20 > Index: src/sys/compat/linux/linux_ioctl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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 Jan 2011 17:10:21 -0000 > @@ -59,6 +59,14 @@ __FBSDID("$FreeBSD: src/sys/compat/linux > #include > #include > #include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > =20 > #include > #include > @@ -83,6 +91,9 @@ __FBSDID("$FreeBSD: src/sys/compat/linux > #include > #include > =20 > +#include > +#include > + > CTASSERT(LINUX_IFNAMSIZ =3D=3D IFNAMSIZ); > =20 > 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; > =20 > @@ -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 =3D > { linux_ioctl_v4l, LINUX_IOCTL_VIDEO_MIN, LINUX_IOCTL_VIDEO_MAX }; > +static struct linux_ioctl_handler dvb_handler =3D > +{ linux_ioctl_dvb, LINUX_IOCTL_DVB_MIN, LINUX_IOCTL_DVB_MAX }; > static struct linux_ioctl_handler fbsd_usb =3D > { linux_ioctl_fbsd_usb, FBSD_LUSB_MIN, FBSD_LUSB_MAX }; > =20 > @@ -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); > =20 > struct handler_element > @@ -2989,6 +3004,251 @@ linux_ioctl_special(struct thread *td, s > } > =20 > /* > + * 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 =3D td->td_proc->p_vmspace; Style recommends not to initialize in the declaration section. [I do not repeat systematic style violations notes below]. > + int error; > + vm_size_t size; > + > + One empty line is enough. > + /* > + * 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 ? > + > + /* round size up to page boundry */ > + size =3D (vm_size_t) round_page(sz); > + > + error =3D 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) > +{ > + vm_map_t map; > + vm_size_t size; > + > + map =3D &td->td_proc->p_vmspace->vm_map; > + size =3D (vm_size_t) round_page(sz); > + > + if (!vm_map_remove(map, addr, addr + size)) Better do if (vm_map_remove(...) !=3D KERN_SUCCESS) > + return (EINVAL); > + > + return (0); > +} > + > +static int > +linux_to_bsd_dtv_properties(struct l_dtv_properties *lvps, struct dtv_pr= operties *vps) > +{ Empty line between (empty) declaration section and executable statements. > + vps->num =3D lvps->num; > + vps->props =3D PTRIN(lvps->props); /* possible pointer size conversion = */ > + return (0); > +} > + > +static int > +linux_to_bsd_dtv_property(struct l_dtv_property *lvp, struct dtv_propert= y *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 =3D NULL; > + vp->result =3D 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 =3D PTROUT(NULL); > + lvp->result =3D 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 =3D NULL, *l_p; > + struct dtv_property *vp =3D NULL, *p; > + size_t l_propsiz, propsiz; > + vm_offset_t uvp; > + > + 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) !=3D LINUX_IOC_VOID) > + return ENOIOCTL; > + args->cmd =3D (args->cmd & 0xffff) | IOC_VOID; > + break; > + > + case LINUX_DMX_REMOVE_PID: > + /* overlaps with LINUX_NET_ADD_IF */ > + if ((args->cmd & IOC_DIRMASK) =3D=3D 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 =3D (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 =3D (args->cmd & ~IOC_DIRMASK) | IOC_OUT; > + break; > + > + case LINUX_DMX_GET_STC: > + case LINUX_NET_GET_IF: > + net_add_if: > + args->cmd =3D (args->cmd & ~IOC_DIRMASK) | IOC_INOUT; > + break; > + > + case LINUX_FE_SET_PROPERTY: > + case LINUX_FE_GET_PROPERTY: > + error =3D copyin((void *) args->arg, &l_vps, sizeof(l_vps)); > + if (error) > + return (error); > + linux_to_bsd_dtv_properties(&l_vps, &vps); > + if ((vps.num =3D=3D 0) || vps.num > DTV_IOCTL_MAX_MSGS) > + return EINVAL; > + > + l_propsiz =3D vps.num * sizeof(*l_vp); > + propsiz =3D vps.num * sizeof(*vp); > + if (((l_vp =3D malloc(l_propsiz, M_LINUX, M_WAITOK)) =3D=3D NULL) || > + (vp =3D malloc(propsiz, M_LINUX, M_WAITOK)) =3D=3D NULL) { Malloc(M_WAITOK) is guaranteed to never return NULL, you do not need the checks. > + error =3D ENOMEM; > + goto out2; > + } > + error =3D copyin((void *) vps.props, l_vp, l_propsiz); > + if (error) > + goto out2; > + for (i =3D vps.num, l_p =3D l_vp, p =3D vp; i--; ++l_p, ++p) > + linux_to_bsd_dtv_property(l_p, p); > + > + error =3D copyout_map(td, &uvp, propsiz); > + if (error) > + goto out2; > + copyout(vp, (void *) uvp, propsiz); > + > + if ((error =3D fget(td, args->fd, &fp)) !=3D 0) { > + (void) copyout_unmap(td, uvp, propsiz); > + goto out2; > + } > + vps.props =3D (void *) uvp; > + if ((args->cmd & 0xffff) =3D=3D LINUX_FE_SET_PROPERTY) > + error =3D fo_ioctl(fp, FE_SET_PROPERTY, &vps, td->td_ucred, td); > + else > + error =3D fo_ioctl(fp, FE_GET_PROPERTY, &vps, td->td_ucred, td); > + if (error) { > + (void) copyout_unmap(td, uvp, propsiz); > + goto out; > + } > + error =3D copyin((void *) uvp, vp, propsiz); > + (void) copyout_unmap(td, uvp, propsiz); No need in space between cast and expression. Bigger issue is that I do not understand this fragment. You do copyout_map(), and then immediately call copyout_unmap() for the address range returned by copyout_map(), or am I missing something ? [snip] --DaUEczEJLvNJIL0g Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1EfbcACgkQC3+MBN1Mb4hvVgCgsrpJXvp28a9tqjPRfbXwysl3 CmkAn2hYTdD44azUhI6WfRHWhaOnrfKS =0ED8 -----END PGP SIGNATURE----- --DaUEczEJLvNJIL0g-- From owner-freebsd-emulation@FreeBSD.ORG Sat Jan 29 23:56:13 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 3F8F6106566B; Sat, 29 Jan 2011 23:56:13 +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 B36198FC0C; Sat, 29 Jan 2011 23:56:12 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 988791E00161; Sun, 30 Jan 2011 00:56: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 p0TNsnmQ016964; Sun, 30 Jan 2011 00:54:49 +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 p0TNsn1p016963; Sun, 30 Jan 2011 00:54:49 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Sun, 30 Jan 2011 00:54:48 +0100 To: Kostik Belousov Message-ID: <20110129235448.GA15788@triton8.kn-bremen.de> References: <20110129201000.GA10774@triton8.kn-bremen.de> <20110129205105.GI2518@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110129205105.GI2518@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, freebsd-emulation@freebsd.org, Juergen Lock 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, 29 Jan 2011 23:56:13 -0000 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? > > 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 > > > > ) > > > > Thanx! > > Juergen > > > > 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 Jan 2011 17:10:21 -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,251 @@ 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 = td->td_proc->p_vmspace; > Style recommends not to initialize in the declaration section. > [I do not repeat systematic style violations notes below]. > Heh as I said copyout_map() and copyout_unmap() are exact copies from ksyms_map() out of sys/dev/ksyms/ksyms.c so I didnt change those other than the names... > > + int error; > > + vm_size_t size; > > + > > + > One empty line is enough. > > > + /* > > + * 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? > > + > > + /* round size up to page boundry */ > > + 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) > > +{ > > + vm_map_t map; > > + vm_size_t size; > > + > > + map = &td->td_proc->p_vmspace->vm_map; > > + size = (vm_size_t) round_page(sz); > > + > > + if (!vm_map_remove(map, addr, addr + size)) > Better do if (vm_map_remove(...) != KERN_SUCCESS) > > > + return (EINVAL); > > + > > + return (0); > > +} > > + > > +static int > > +linux_to_bsd_dtv_properties(struct l_dtv_properties *lvps, struct dtv_properties *vps) > > +{ > Empty line between (empty) declaration section and executable statements. > Ok. > > + 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 = NULL, *l_p; > > + struct dtv_property *vp = NULL, *p; > > + size_t l_propsiz, propsiz; > > + vm_offset_t uvp; > > + > > + 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); > > + if (((l_vp = malloc(l_propsiz, M_LINUX, M_WAITOK)) == NULL) || > > + (vp = malloc(propsiz, M_LINUX, M_WAITOK)) == NULL) { > Malloc(M_WAITOK) is guaranteed to never return NULL, you do not need the > checks. > Ok. > > + error = ENOMEM; > > + goto out2; > > + } > > + 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); > No need in space between cast and expression. Bigger issue is that I > do not understand this fragment. You do copyout_map(), and then > immediately call copyout_unmap() for the address range returned > by copyout_map(), or am I missing something ? > The vm allocated by copyout_map() is only needed for the fo_ioctl() call because the struct passed to FE_[GS]ET_PROPERTY describes an array that the drivers then copyin() and (possibly) copyout() themselves. So that array needs to be translated from/to the 32bit Linux version to (possibly) 64bit on the host (linux_to_bsd_dtv_property), and the 64bit version is larger so it doesn't fit in the original place in the userland vm. (One optimization here would be to only do this when the sizes differ i.e. in the 32bit-on-64 case...) Thanx! Juergen