From owner-freebsd-emulation@FreeBSD.ORG Sat Mar 10 16:53:05 2012 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 84DB41065670; Sat, 10 Mar 2012 16:53:05 +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 3B4D68FC0C; Sat, 10 Mar 2012 16:53:04 +0000 (UTC) Received: by iahk25 with SMTP id k25so5212738iah.13 for ; Sat, 10 Mar 2012 08:53:04 -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=M9VloOZ0TwDM4E3ZhVko9ZyXErpuqi2y3hof38JC/8o=; b=ikSXoRZIYsD18//cY5u7nCU38fhyl2i4i0PdU1Ps1S6FyvBJaq4iua514wcPEAJTga F5NE8G9L5fHj5pzLzjkk45lEkAJ0ALepvy+W4RjQGkRiOcT0r5IuX5bOyJ3eOHkor8K7 QbxiHgxumNZnnnzAgr61Pl6zGK5h6UZEm1jRRVWgHNdvaffae8kB8XHf3eB5SlyeVH/n Lfg4yBm26w+MvGN7zuNOnLlBk6EF88XsyypdkRxitAuybaS/qBCgYQnrlGaSX2C2KAJF mhTRW+AuTKq2yaDqtJYL+ZkXClhWJrk7PbsqDaANKtgEZ++QMPWPqGnLn7HMOr9qNCho nTzQ== MIME-Version: 1.0 Received: by 10.182.38.8 with SMTP id c8mr2480709obk.34.1331394628594; Sat, 10 Mar 2012 07:50:28 -0800 (PST) Received: by 10.60.17.10 with HTTP; Sat, 10 Mar 2012 07:50:28 -0800 (PST) In-Reply-To: <9e02ac1bc0f7a8043f28ced31e319a20@bluelife.at> References: <9e02ac1bc0f7a8043f28ced31e319a20@bluelife.at> Date: Sat, 10 Mar 2012 09:50:28 -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 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: Sat, 10 Mar 2012 16:53:05 -0000 On Sat, Mar 10, 2012 at 3:00 AM, Bernhard Froehlich wro= te: > 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/VBoxNetA= dp/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/