Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jan 2013 23:06:39 -0800
From:      Neel Natu <neelnatu@gmail.com>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Neel Natu <neel@freebsd.org>
Subject:   Re: svn commit: r245066 - head/sys/kern
Message-ID:  <CAFgRE9HH1f%2B-RT8MUZjChva-7hBDMOzd865rKJJ2sABOOcptMA@mail.gmail.com>
In-Reply-To: <999FD346-D6A2-473C-91F6-BDCE8363A62E@gmail.com>
References:  <201301051918.r05JIptx030509@svn.freebsd.org> <999FD346-D6A2-473C-91F6-BDCE8363A62E@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Garrett,

On Sun, Jan 6, 2013 at 7:22 PM, Garrett Cooper <yanegomi@gmail.com> wrote:
> On Jan 5, 2013, at 11:18 AM, Neel Natu <neel@FreeBSD.org> wrote:
>
>> Author: neel
>> Date: Sat Jan  5 19:18:50 2013
>> New Revision: 245066
>> URL: http://svnweb.freebsd.org/changeset/base/245066
>>
>> Log:
>>  Teach the kernel to recognize that it is executing inside a bhyve virtu=
al
>>  machine.
>>
>>  Obtained from:    NetApp
>>
>> Modified:
>>  head/sys/kern/subr_param.c
>>
>> Modified: head/sys/kern/subr_param.c
>> =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=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/kern/subr_param.c    Sat Jan  5 18:48:23 2013    (r245065)
>> +++ head/sys/kern/subr_param.c    Sat Jan  5 19:18:50 2013    (r245066)
>> @@ -160,6 +160,7 @@ static const char *const vm_bnames[] =3D {
>>    "Plex86",            /* Plex86 */
>>    "Bochs",            /* Bochs */
>>    "Xen",                /* Xen */
>> +    "BHYVE",            /* bhyve */
>>    NULL
>> };
>
> Interesting. This needs to be abstracted out a bit in order to work more =
properly with VMware and other platforms that use the VT calls properly (an=
d get rid of some duplicated effort in tsc.c), but this is definitely a goo=
d breadcrumb for cleaning up our vm detection and handling layer.
>

Agreed.

One possible approach would be to have an arch-dependent call which
could check for presence of the CPUID2_HV. It would have the added
bonus of getting rid of x86-specific code from subr_param.c.

Also, I am not sure what you mean by "platforms that use the VT calls
properly" ...

best
Neel

> Thanks for the commit :).
>
> -Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFgRE9HH1f%2B-RT8MUZjChva-7hBDMOzd865rKJJ2sABOOcptMA>