From owner-freebsd-emulation@FreeBSD.ORG Sun Mar 11 00:07:52 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3233106566C; Sun, 11 Mar 2012 00:07:52 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9918FC15; Sun, 11 Mar 2012 00:07:52 +0000 (UTC) Received: by iahk25 with SMTP id k25so5799104iah.13 for ; Sat, 10 Mar 2012 16:07:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=wbHddrRhJcEYwwWmf6xDnejlzV1TVdXsl4Xo1XDEXNg=; b=EyViLLEqQXk+CiR1PKDGo2uaK/3UkluI1ka/ctNr3AcRMptYhnbPBLH7bk8p8UBarb zB4F846s23eIrEeEOgKO3lCP+Ym3j/l2WQDBXqYtl/ylaCWdogl7yOPiiwZiDRqn8z0V GUfu7XKvhn+0+WHTWUw+i4IfAlQrf8iyT1iB29gLsG3VyFRbuVdn36DwH3pMdaChn62Q UR5gSTyny+xUzsCpnAAepypSp45DNYZBn7oz8/3fhVNw4zmc7pKiCATxl4u+eeKfANUr 8qSYfcdsoMWKE6GccIyXIUb2XQdncMrQJ9kSdw6AeqofF94U20VdvvsaKQgBOYn2HYdW GdVw== MIME-Version: 1.0 Received: by 10.182.111.3 with SMTP id ie3mr3194918obb.14.1331424471788; Sat, 10 Mar 2012 16:07:51 -0800 (PST) Received: by 10.60.17.10 with HTTP; Sat, 10 Mar 2012 16:07:51 -0800 (PST) In-Reply-To: References: <9e02ac1bc0f7a8043f28ced31e319a20@bluelife.at> Date: Sat, 10 Mar 2012 18:07:51 -0600 Message-ID: From: Brandon Gooch To: Bernhard Froehlich Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-emulation@freebsd.org, "Bjoern A. Zeeb" , Marko Zec Subject: Re: [PATCH] VirtualBox 4.1.8 kmod panic with VIMAGE kernel 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, 11 Mar 2012 00:07:52 -0000 On Sat, Mar 10, 2012 at 9:50 AM, Brandon Gooch wrote: > On Sat, Mar 10, 2012 at 3:00 AM, Bernhard Froehlich w= rote: >> On 10.03.2012 05:42, Brandon Gooch wrote: >>> >>> It's my guess that not many people are running VirtualBox on a >>> VIMAGE-enabled kernel. =A0However, for those of us who do (just me?), >>> the attached patch is required to prevent a panic when running >>> VirtualBox in such an environment. The patch belongs to the >>> emulators/virtualbox-ose-kmod port. >>> >>> --- src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c.orig =A0 2011-12-19 >>> 07:01:06.000000000 -0600 >>> +++ src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c =A0 =A0 =A0 =A02011-12= -26 >>> 14:54:27.000000000 -0600 >>> @@ -1189,6 +1189,7 @@ >>> =A0int =A0vboxNetAdpInit(void) >>> =A0{ >>> =A0 =A0 unsigned i; >>> + =A0 =A0PVBOXNETADP pVboxnet0; >>> =A0 =A0 /* >>> =A0 =A0 =A0* Init common members and call OS-specific init. >>> =A0 =A0 =A0*/ >>> @@ -1201,7 +1202,8 @@ >>> =A0 =A0 =A0 =A0 vboxNetAdpOsInit(&g_aAdapters[i]); >>> =A0 =A0 } >>> >>> - =A0 =A0return VINF_SUCCESS; >>> + =A0 =A0/* Create vboxnet0 */ >>> + =A0 =A0return vboxNetAdpCreate(&pVboxnet0, NULL); >>> =A0} >>> >>> =A0/** >>> >>> If there is a more appropriate fix, please help me find it, otherwise, >>> it would be great to have this committed! >> >> >> Sorry, that I haven't committed the patch until now. Do you agree that >> this patch is licensed under MIT License so I can send it upstream? > > Yes, absolutely. Do with it as you please... > > What I found when tracking this down led to this commit: > > https://www.virtualbox.org/changeset/35785/vbox > > https://www.virtualbox.org/browser/vbox/trunk/src/VBox/HostDrivers/VBoxNe= tAdp/VBoxNetAdp.c?rev=3D35785 > > I'm not sure how the initial VBox network adapter is supposed to be > created; maybe it should be deferred to the OS-specific init process > (in VBoxNetAdp-freebsd.c)? Trouble is, not sure how to do that > exactly, but anyway it seems more like a bug that was introduced. > > Attempting to push this upstream will reveal something I imagine :) > >> Current VIMAGE support is only for vboxnetflt and you are touching >> vboxnetadp so that is probably why nobody used it before. Have you >> tested it with a non VIMAGE kernel? > > I tested it with GENERIC, a custom kernel WITHOUT VIMAGE, and a custom > kernel WITH VIMAGE. I tested on 9-STABLE (from this month) and now > 10-CURRENT. > >> -- >> Bernhard Froehlich >> http://www.bluelife.at/ Y'know, I think the real problem is that a VIMAGE-enabled kernel doesn't allow for the creation of new interfaces after boot. At least it was that way back in late 2010 when I was using a USB network device... So this is at BEST an attempt at a work-around, which I suspect will fail in any case more complicated than VirtualBox running in vnet0 with 1 network interface -- but I'm not totally sure I even understand the way the VBoxNetFlt and VBoxNetAdp drivers work! -Brandon