All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Frederic Konrad <fred.konrad@greensocs.com>
Cc: mark.burton@greensocs.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount.
Date: Thu, 18 Jul 2013 18:26:06 +0200	[thread overview]
Message-ID: <51E8171E.6070305@redhat.com> (raw)
In-Reply-To: <51E8169E.9080100@greensocs.com>

Il 18/07/2013 18:23, Frederic Konrad ha scritto:
> On 18/07/2013 17:36, Paolo Bonzini wrote:
>> Il 18/07/2013 17:02, fred.konrad@greensocs.com ha scritto:
>>> From: KONRAD Frederic <fred.konrad@greensocs.com>
>>>
>>> This bases rt_clock on icount, as vm_clock.
>>> So vm_clock = rt_clock.
>>>
>>> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
>>> ---
>>>   qemu-timer.c | 6 +++++-
>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/qemu-timer.c b/qemu-timer.c
>>> index b2d95e2..6c607e5 100644
>>> --- a/qemu-timer.c
>>> +++ b/qemu-timer.c
>>> @@ -401,7 +401,11 @@ int64_t qemu_get_clock_ns(QEMUClock *clock)
>>>         switch(clock->type) {
>>>       case QEMU_CLOCK_REALTIME:
>>> -        return get_clock();
>>> +        if (use_icount) {
>>> +            return cpu_get_icount();
>>> +        } else {
>>> +            return get_clock();
>>> +        }
>>>       default:
>>>       case QEMU_CLOCK_VIRTUAL:
>>>           if (use_icount) {
>>>
>> rt_clock is very little used in general.  You should use "-rtc clock=vm"
>> if you want to base the RTC on vm_clock.
>>
>> Paolo
> 
> True but it seems used in some place:
> 
> For example: ui/console.c:
> ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds);
> 
> Maybe it can cause trouble no?

In theory it is only used in places where it shouldn't cause trouble
(those that do should use the similarly named rtc_clock variable).

Paolo

  reply	other threads:[~2013-07-18 16:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 15:02 [Qemu-devel] [RFC 0/3] Determinitic behaviour with icount fred.konrad
2013-07-18 15:02 ` [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount fred.konrad
2013-07-18 15:36   ` Paolo Bonzini
2013-07-18 16:23     ` Frederic Konrad
2013-07-18 16:26       ` Paolo Bonzini [this message]
2013-07-18 15:02 ` [Qemu-devel] [RFC 2/3] icount: sync vm_clock on the next event fred.konrad
2013-07-18 15:02 ` [Qemu-devel] [RFC 3/3] icount: create a new icount based timer fred.konrad
2013-07-18 15:08   ` Peter Maydell
2013-07-18 15:06 ` [Qemu-devel] [RFC 0/3] Determinitic behaviour with icount Peter Maydell
2013-07-18 15:09   ` Frederic Konrad
2013-07-18 15:12     ` Peter Maydell
2013-07-18 15:35   ` Paolo Bonzini
2013-07-18 16:31     ` Frederic Konrad
2013-07-18 16:35       ` Paolo Bonzini
2013-07-19 15:26         ` Frederic Konrad
2013-07-29 15:27     ` Frederic Konrad
2013-07-29 16:42       ` Paolo Bonzini
2013-07-30  7:06         ` Frederic Konrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E8171E.6070305@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=fred.konrad@greensocs.com \
    --cc=mark.burton@greensocs.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.