On Wednesday 13 April 2011 05:49 pm, Dimitry Andric wrote:
> 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?

That means your VM has broken CPUID support.  To get there, it has to 
meet two conditions, i.e., TSC is invariant and it has APERF/MPERF 
MSRs.  A simple workaround is setting "machdep.disable_tsc=1" 
tuanable from loader but your VM is the real culprit here.

Jung-uk Kim
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to