All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sebastian Tanase <sebastian.tanase@openwide.fr>
Cc: kwolf@redhat.com, peter maydell <peter.maydell@linaro.org>,
	aliguori@amazon.com, wenchaoqemu@gmail.com, quintela@redhat.com,
	qemu-devel@nongnu.org, mst@redhat.com, stefanha@redhat.com,
	armbru@redhat.com, lcapitulino@redhat.com, michael@walle.cc,
	camille begue <camille.begue@openwide.fr>,
	alex@alex.org.uk, crobinso@redhat.com, afaerber@suse.de,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks
Date: Tue, 22 Jul 2014 16:59:18 +0200	[thread overview]
Message-ID: <53CE7C46.7010908@redhat.com> (raw)
In-Reply-To: <47507527.20044186.1406037761337.JavaMail.root@openwide.fr>

Il 22/07/2014 16:02, Sebastian Tanase ha scritto:
> Yes, QEMU_CLOCK_VIRTUAL counts up from qemu_clock_get_ns(QEMU_CLOCK_REALTIME)
> on ARM (I have only tested with the versatilepb and vexpress boards).

That's a bug to fix indeed, then---it should count up from 0 without
icount, and icount shouldn't affect this.  Thanks for investigating it.

> Supposing the patch that changes vm_clock_warp_start from 0 to -1 is accepted,

... which shouldn't be a problem,... :)

> I could use the information in timers_state.cpu_clock_offset instead of recalculating
> the offset. Besides, given that I only need this particular field from the whole 
> structure, I think I don't have to make timers_state public; I could add a function 
> in cpus.c, for example:
> 
>     int64_t cpu_get_clock_offset(void)
>     {
>         int64_t ti;
>         unsigned start;
> 
>         do {
>             start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
>             ti = -timers_state.cpu_clock_offset;
>         } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
> 
>         return ti;
>     }
> 
> that will return the cpu_clock_offset field.

Indeed what I was proposing is a bit more sloppy.  If you do that, you
have to make the function a bit more general:

    ti = timers_state.cpu_clock_offset;
    if (!timers_state.cpu_ticks_enabled) {
        ti -= get_clock();
    }
    ...

    return -ti;

even though in cpus.c you'll only be using it when cpu_ticks_enabled is
true.  See cpu_enable_ticks() and cpu_disable_ticks().

Paolo

  reply	other threads:[~2014-07-22 15:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 12:18 [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 1/6] icount: Add QemuOpts for icount Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 2/6] icount: Add align option to icount Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 3/6] icount: Make icount_time_shift available everywhere Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 4/6] cpu_exec: Add sleeping algorithm Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 5/6] cpu_exec: Print to console if the guest is late Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 6/6] monitor: Add drift info to 'info jit' Sebastian Tanase
2014-07-16 13:18   ` Paolo Bonzini
2014-07-22  9:58     ` Sebastian Tanase
2014-07-22 10:19       ` Paolo Bonzini
2014-07-22 13:55         ` Sebastian Tanase
2014-07-16 13:20 ` [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks Paolo Bonzini
2014-07-22 14:02   ` Sebastian Tanase
2014-07-22 14:59     ` Paolo Bonzini [this message]
2014-07-22 15:17       ` Sebastian Tanase
2014-07-22 15:22         ` Paolo Bonzini
2014-07-22 15:28           ` Sebastian Tanase
2014-07-22 15:44             ` Paolo Bonzini
2014-07-16 13:40 ` Luiz Capitulino

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=53CE7C46.7010908@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alex@alex.org.uk \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=camille.begue@openwide.fr \
    --cc=crobinso@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=michael@walle.cc \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=sebastian.tanase@openwide.fr \
    --cc=stefanha@redhat.com \
    --cc=wenchaoqemu@gmail.com \
    /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.