From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 1 10:25:55 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41607106564A for ; Mon, 1 Mar 2010 10:25:55 +0000 (UTC) (envelope-from alexeichi@yahoo.de) Received: from web27603.mail.ukl.yahoo.com (web27603.mail.ukl.yahoo.com [217.146.177.222]) by mx1.freebsd.org (Postfix) with SMTP id A92518FC13 for ; Mon, 1 Mar 2010 10:25:54 +0000 (UTC) Received: (qmail 30920 invoked by uid 60001); 1 Mar 2010 09:59:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1267437550; bh=9Zn6zBImBRnv88l4sFWlLnK6VG3NlW5QhibKoiz4hTs=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lPOWLrAcYty5CsxfQeLFdmTH437FLGxN73ewDMVGfTk5pfo5rLdXoHTdx8loRJ4oDttUIdJPsajNe2Cgsvvwz1IO5HE+ZcEzIz28XPrf6UPj/3TyJMb6XYnLxdSJhCw4zTOuxTzhheDXtSzqHikEzDMatPMBVAcQJtk68b5tD9c= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=rpOEr6kyq2bDDs52Tb/PDkBxoPhDTBhj3PCEBi/Zqi2KBPVcCRwwRSh5JJ8lL4N1Vn+RDI4bqa7Qg2+uFwgkLZafQW1ZovWACFiPpu6Ad7DfhN1hbu7dZGs7eW+Q9GK/3hOalyMnq243AsVz/er55MrphfmX1JechLaSy4HnEiA=; Message-ID: <317657.30145.qm@web27603.mail.ukl.yahoo.com> X-YMail-OSG: BaQZtX8VM1kDsI0gu3MmxolsXXzjoUjZW.VCh9Nnrqo57cTi_uAmLV0aQicIIF6FxWY0_sUpZs2Gr2XaIJ0nwBbxjTyMk5LIVYftFDKoNEHjO6x0BI6zF._Z0e4kxgveorQFk4jezKX9XsJx_T3s0HQkNkAjjkJWw76HW8ECSLNRV7L.P3Kd.J8.mtwd0LT0kzbSaEbCEwS7TUHrwt6HKpTetoynnDAV9MVIFYdVh0U7z7zQ7Q2gKDjHqt35yzshzKilSnIdR_iD7S0sORyYR36M7q_6IB7mjZWzzLA6AYuZZon5oSo2IwKIHRpgZ4xng51XZg-- Received: from [87.187.210.251] by web27603.mail.ukl.yahoo.com via HTTP; Mon, 01 Mar 2010 09:59:10 GMT X-Mailer: YahooMailClassic/9.2.12 YahooMailWebService/0.8.100.260964 Date: Mon, 1 Mar 2010 09:59:10 +0000 (GMT) From: Alexander Eichner To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Allocating physical memory without a kernel mapping X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 10:25:55 -0000 Hi,=0A=0AI'm currently trying to finish the R0 memory implementation[1] of = FreeBSD for VirtualBox. One of the missing methods allocates physical non c= ontiguous pages which don't need to have a kernel mapping (rtR0MemObjNative= AllocPhysNC). I'm using vm_phys_alloc_contig to achieve this. The pages are= than mapped into the user space VM process using pmap_enter (rtR0MemObjNat= iveMapUser) and if they are not needed anymore vm_page_free_toq is used to = free the pages (rtR0MemObjNativeFree).=0AEverything works as long as the VM= runs but if the VM process terminates and I do something else the host wil= l panic at some point (usually when I try to start a gnome session) with "p= map_enter: missing reference to page table page "[2].=0AThere seems to = some problem with the wire count of that page but I can't see what I'm doin= g wrong at the moment.=0AThanks in advance for any help.=0A=0ARegards,=0AAl= exander Eichner=0A=0A[1] http://www.virtualbox.org/browser/trunk/src/VBox/R= untime/r0drv/freebsd/memobj-r0drv-freebsd.c?rev=3D26899=0A[2]http://fxr.wat= son.org/fxr/source/amd64/amd64/pmap.c?im=3Dbigexcerpts#L3076=0A=0A_________= _________________________________________=0ADo You Yahoo!?=0ASie sind Spam = leid? Yahoo! Mail verf=FCgt =FCber einen herausragenden Schutz gegen Massen= mails. =0Ahttp://mail.yahoo.com