From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YntBv-00077r-3C for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YntBq-0006P1-Cj for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:28:07 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:34387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YntBq-0006Ox-9b for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:28:02 -0400 Received: by iedfl3 with SMTP id fl3so83380308ied.1 for ; Thu, 30 Apr 2015 11:28:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1430417667-4245-5-git-send-email-christopher.covington@linaro.org> References: <1430417667-4245-1-git-send-email-christopher.covington@linaro.org> <1430417667-4245-5-git-send-email-christopher.covington@linaro.org> From: Peter Maydell Date: Thu, 30 Apr 2015 19:27:41 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC 5/5] arm: Simplify cycle counter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christopher Covington Cc: QEMU Developers On 30 April 2015 at 19:14, Christopher Covington wrote: > Present a system with an instructions per cycle of exactly one. > This makes it less likely a user will mistake the cycle counter > values as meaningful and makes calculations involving cycles > trivial while preserving the necessary property of the cycle > counter register as monotonically increasing. > > Signed-off-by: Christopher Covington > --- > target-arm/helper.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 3e6fb0b..a027a19 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -648,8 +648,7 @@ void pmccntr_sync(CPUARMState *env) > { > uint64_t temp_ticks; > > - temp_ticks = muldiv64(qemu_clock_get_us(QEMU_CLOCK_VIRTUAL), > - get_ticks_per_sec(), 1000000); > + temp_ticks = cpu_get_icount_raw(); Are you really really sure the _raw function is the correct one? Nowhere else in the codebase calls it except the other wrappers in cpu.c which provide a sane view of the instruction count... (I suspect cpu_get_icount_raw() should really be static.) PS: it would be helpful if you could make sure you include a cover letter for future patchseries: patchsets without a cover letter are awkward for my workflow... (A single standalone patch doesn't need a coverletter.) thanks -- PMM