From owner-svn-src-all@FreeBSD.ORG Wed Apr 13 21:49:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91D31106564A; Wed, 13 Apr 2011 21:49:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5478D8FC08; Wed, 13 Apr 2011 21:49:19 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:ad8b:7db5:9520:7ed0] (unknown [IPv6:2001:7b8:3a7:0:ad8b:7db5:9520:7ed0]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id AA82A5C59; Wed, 13 Apr 2011 23:49:18 +0200 (CEST) Message-ID: <4DA61A70.8040609@FreeBSD.org> Date: Wed, 13 Apr 2011 23:49:36 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16pre) Gecko/20110319 Lanikai/3.1.10pre MIME-Version: 1.0 To: Jung-uk Kim References: <201104122349.p3CNn7kK039179@svn.freebsd.org> <4DA6189A.5040200@FreeBSD.org> In-Reply-To: <4DA6189A.5040200@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 21:49:19 -0000 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?