Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2011 15:29:03 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim <jkim@freebsd.org>
Subject:   Re: svn commit: r220584 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <BANLkTin-1-0OvX2SZrfr=ynAmg%2B%2BdHVKag@mail.gmail.com>
In-Reply-To: <4DA61A70.8040609@FreeBSD.org>
References:  <201104122349.p3CNn7kK039179@svn.freebsd.org> <4DA6189A.5040200@FreeBSD.org> <4DA61A70.8040609@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 13, 2011 at 2:49 PM, Dimitry Andric <dim@freebsd.org> wrote:
> On 2011-04-13 23:41, Dimitry Andric wrote:
> ...
>>
>> But I don't really see why, yet. :) =A0With r220532, it worked fine.
>
> Ah, I failed to notice the commit that came before, r220583.
> Apparently, it can happen (at least in a VM environment) that the
> DELAY(1000) in this fragment from cpu_est_clockrate():
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wrmsr(MSR_MPERF, 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wrmsr(MSR_APERF, 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tsc1 =3D rdtsc();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DELAY(1000);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mcnt =3D rdmsr(MSR_MPERF);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0acnt =3D rdmsr(MSR_APERF);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tsc2 =3D rdtsc();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0intr_restore(reg);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0perf =3D 1000 * acnt / mcnt;
>
> will still read 0 from MSR_MPERF, leading to a division by zero. =A0Maybe
> just fallback to the second method in the 'else' branch then?

    Yeah, it kind of peeves me that this kind of rinky dink stuff is
done with VMware ESXi, etc (fake RAM returning 0MHz in the SMBIOS
table in certain scenarios).
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTin-1-0OvX2SZrfr=ynAmg%2B%2BdHVKag>