Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 2010 13:26:05 +0100
From:      Giovanni Trematerra <giovanni.trematerra@gmail.com>
To:        Jacques Fourie <jacques.fourie@gmail.com>
Cc:        Ian FREISLICH <ianf@clue.co.za>, Shteryana Shopova <shteryana@gmail.com>, current@freebsd.org
Subject:   Re: Virtualbox
Message-ID:  <4e6cba831002240426l6a549e24i81ea85e523422fe4@mail.gmail.com>
In-Reply-To: <be2f52431002240316g62f2b7f7oefc36a9b6ec66a2b@mail.gmail.com>
References:  <E1NjxUk-0007m6-Nr@clue.co.za> <61b573981002240058m51a45bf8l1ca55063ef277492@mail.gmail.com> <be2f52431002240316g62f2b7f7oefc36a9b6ec66a2b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 24, 2010 at 12:16 PM, Jacques Fourie
<jacques.fourie@gmail.com> wrote:
> As a test you can apply the following mod to sys/i386/include/pmap.h
> and re-compile vboxdrv.ko. It fixed the problem for me but I'm by no
> means an expert on the i386 pmap stuff so use at your own risk. Also
> revert the change to pmap.h after re-compiling vboxdrv just so that
> you don't inadvertently break something else.
>
> Index: pmap.h
> =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
> --- pmap.h =A0 =A0 =A0(revision 204194)
> +++ pmap.h =A0 =A0 =A0(working copy)
> @@ -296,7 +296,10 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * however, safe to use the old PDE becaus=
e the page table
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * page is preserved by the promotion.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa =3D KPTmap[i386_btop(va)];
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (va >=3D KERNBASE)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa =3D KPTmap[i386_btop(va)=
];
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa =3D *vtopte(va);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pa =3D (pa & PG_FRAME) | (va & PAGE_MASK);
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0return (pa);

pmap_kextract is intend to be used with kernel virtual addresses and
not user virtual addresses.
The problem lies in the driver not in the kernel.

The vboxdrv call vtophys macro passing user virtual addresses through
rtR0MemObjNativeGetPagePhysAddr and this is wrong.

If you want a way to get virtualbox works try to revert this commit (r20289=
4):
http://www.mail-archive.com/svn-src-all@freebsd.org/msg19081.html

If you don't use ZFS with superpages enable you have a good chance to
get a work system until a patch to vboxdrv will be around.

--
Gianni



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4e6cba831002240426l6a549e24i81ea85e523422fe4>