[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC 5/5] arm: Simplify cycle counter

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC 5/5] arm: Simplify cycle counter
Date: Mon, 04 May 2015 11:54:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 01/05/2015 00:02, Peter Maydell wrote:
> On 30 April 2015 at 22:33, Christopher Covington
> <address@hidden> wrote:
>> On Apr 30, 2015 2:28 PM, "Peter Maydell" <address@hidden> wrote:
>>> 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.)
>> I thought it wasn't being used because it was new, having been introduced by
>> Pavel Dovgalyuk's determinism patches.
>> When you talk about sanity, what would this patch make insane?

The right function is cpu_get_ticks().  This one works without icount as

At the top there is:

    if (use_icount) {
        return cpu_get_icount();

and perhaps it would be correct to use cpu_get_icount_raw() if you do
not want the cycle counter to increase in halted state.  But at least
x86 wants it to increase.


>> instructions per second and cycles per second that would result? If so, what
>> if seconds/timer ticks were changed in the same patch to be derived from the
>> instruction count. All of this could potentially only apply with -icount
>> specified.
> I don't really know for certain how the code here works, but
> it makes me very dubious when I see a function that is being
> used literally nowhere else in any other target CPU, and
> where every other code path to it goes via taking a lock.
> Paolo: can you suggest what the right function to call to implement
> a cycle counter is?
> thanks
> -- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]