Date: Wed, 13 Apr 2011 23:49:36 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: Jung-uk Kim <jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220584 - in head/sys: amd64/amd64 i386/i386 Message-ID: <4DA61A70.8040609@FreeBSD.org> In-Reply-To: <4DA6189A.5040200@FreeBSD.org> References: <201104122349.p3CNn7kK039179@svn.freebsd.org> <4DA6189A.5040200@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2011-04-13 23:41, Dimitry Andric wrote: ... > But I don't really see why, yet. :) With 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(): wrmsr(MSR_MPERF, 0); wrmsr(MSR_APERF, 0); tsc1 = rdtsc(); DELAY(1000); mcnt = rdmsr(MSR_MPERF); acnt = rdmsr(MSR_APERF); tsc2 = rdtsc(); intr_restore(reg); perf = 1000 * acnt / mcnt; will still read 0 from MSR_MPERF, leading to a division by zero. Maybe just fallback to the second method in the 'else' branch then?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DA61A70.8040609>