qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VI


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock
Date: Fri, 28 Nov 2014 13:40:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


On 28/11/2014 12:28, Pavel Dovgaluk wrote:
> Not so easy :)
> cpu_get_clock() checks vm_clock_seqlock which is locked in icount_warp_rt().
> And after locking it requests the value of QEMU_CLOCK_VIRTUAL_RT:
> 
>     seqlock_write_lock(&timers_state.vm_clock_seqlock);
>     if (runstate_is_running()) {
>         int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);

Not so hard :D  You can use cpu_get_clock_locked() there.

In fact, cpu_get_clock_locked() is already used below in the "if", so we
can reuse "clock" instead of the other variable "cur_time".

Paolo



reply via email to

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