From owner-freebsd-emulation@FreeBSD.ORG Fri Aug 12 06:51: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 E75FD1065670; Fri, 12 Aug 2011 06:51:25 +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 7C29B8FC0A; Fri, 12 Aug 2011 06:51:25 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 00CFC2; Fri, 12 Aug 2011 08:51:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Fri, 12 Aug 2011 08:51:25 +0200 From: Bernhard Froehlich To: Jung-uk Kim In-Reply-To: <201108111544.20198.jkim@FreeBSD.org> References: <4E441A9D.1060102@protected-networks.net> <201108111544.20198.jkim@FreeBSD.org> Message-ID: X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5.3 X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0202.4E44CD6C.00A8,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: freebsd-emulation@FreeBSD.org Subject: Re: PG_UNMANAGED disappearance in -current 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, 12 Aug 2011 06:51:26 -0000 On Thu, 11 Aug 2011 15:44:12 -0400, Jung-uk Kim wrote: > On Thursday 11 August 2011 02:08 pm, Michael Butler wrote: >> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-4.0.12_OSE >>/out/freebsd.x86/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv- >>freebsd.c: In function 'rtR0MemObjFreeBSDPhysPageInit': >> >> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-4.0.12_OSE >>/out/freebsd.x86/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv- >>freebsd.c:396: error: 'PG_UNMANAGED' undeclared (first use in this >> function) >> >> Should "pPage->flags = PG_UNMANAGED" now be replaced by some page >> lock/unlock function which applies "pPage->oflags = VPO_UNMANAGED"? > > I am not sure if it is really correct but this patch worked for me: > > --- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig > +++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c > @@ -392,8 +392,13 @@ > pPage->wire_count = 1; > pPage->pindex = iPage; > pPage->act_count = 0; > +#if __FreeBSD_version < 900000 > pPage->oflags = 0; > pPage->flags = PG_UNMANAGED; > +#else > + pPage->oflags = VPO_UNMANAGED; > + pPage->flags = 0; > +#endif > atomic_add_int(&cnt.v_wire_count, 1); > } I have started the same way and then talked to kib. He told me that vm_phys_alloc_contig() already initializes the page as unmanaged so this stuff should be a noop in the kmod. I have not runtime tested it myself though so i would welcome some feedback on that. http://home.bluelife.at/patches/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c --- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-04-05 14:34:09.000000000 +0200 +++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-08-11 15:06:46.000000000 +0200 @@ -394,9 +394,13 @@ pPage->wire_count = 1; pPage->pindex = iPage; pPage->act_count = 0; - pPage->oflags = 0; - pPage->flags = PG_UNMANAGED; atomic_add_int(&cnt.v_wire_count, 1); + +#if __FreeBSD_version >= 900040 + Assert(pPage->oflags & VPO_UNMANAGED != 0); +#else + Assert(pPage->flags & PG_UNMANAGED != 0); +#endif } -- Bernhard Froehlich http://www.bluelife.at/