qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/5] qemu-timer: fix off-by-one
Date: Fri, 10 Mar 2017 09:46:02 +0000	[thread overview]
Message-ID: <871su5ihwl.fsf@linaro.org> (raw)
In-Reply-To: <20170303131113.25898-2-pbonzini@redhat.com>


Paolo Bonzini <pbonzini@redhat.com> writes:

> If the first timer is exactly at the current value of the clock, the
> deadline is met and the timer should fire.  This fixes itself without icount,
> but with icount execution of instructions will stop exactly at the deadline.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  util/qemu-timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/qemu-timer.c b/util/qemu-timer.c
> index 6cf70b9..2f20151 100644
> --- a/util/qemu-timer.c
> +++ b/util/qemu-timer.c
> @@ -199,7 +199,7 @@ bool timerlist_expired(QEMUTimerList *timer_list)
>      expire_time = timer_list->active_timers->expire_time;
>      qemu_mutex_unlock(&timer_list->active_timers_lock);
>
> -    return expire_time < qemu_clock_get_ns(timer_list->clock->type);
> +    return expire_time <= qemu_clock_get_ns(timer_list->clock->type);
>  }
>
>  bool qemu_clock_expired(QEMUClockType type)


--
Alex Bennée

  parent reply	other threads:[~2017-03-10  9:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 13:11 [Qemu-devel] [PATCH 0/6] tcg: fix icount super slowdown Paolo Bonzini
2017-03-03 13:11 ` [Qemu-devel] [PATCH 1/5] qemu-timer: fix off-by-one Paolo Bonzini
2017-03-03 13:48   ` Edgar E. Iglesias
2017-03-10  9:46   ` Alex Bennée [this message]
2017-03-03 13:11 ` [Qemu-devel] [PATCH 2/5] qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h Paolo Bonzini
2017-03-03 13:48   ` Edgar E. Iglesias
2017-03-03 14:50   ` Alex Bennée
2017-03-03 14:55     ` Paolo Bonzini
2017-03-10  7:42   ` [Qemu-devel] [PATCH] fixup! " Alex Bennée
2017-03-10  8:27     ` Peter Maydell
2017-03-10  9:47   ` [Qemu-devel] [PATCH 2/5] " Alex Bennée
2017-03-03 13:11 ` [Qemu-devel] [PATCH 3/5] cpus: define QEMUTimerListNotifyCB for QEMU system emulation Paolo Bonzini
2017-03-03 13:53   ` Edgar E. Iglesias
2017-03-03 13:11 ` [Qemu-devel] [PATCH 4/5] main-loop: remove now unnecessary optimization Paolo Bonzini
2017-03-03 13:53   ` Edgar E. Iglesias
2017-03-13 16:23   ` Alex Bennée
2017-03-03 13:11 ` [Qemu-devel] [PATCH 5/5] icount: process QEMU_CLOCK_VIRTUAL timers in vCPU thread Paolo Bonzini
2017-03-13 16:53   ` Alex Bennée
2017-03-13 17:16     ` Paolo Bonzini
2017-03-13 18:15       ` Alex Bennée
2017-03-14 10:05         ` Paolo Bonzini
2017-03-14 12:57           ` Paolo Bonzini
2017-03-14 15:43             ` Alex Bennée
2017-03-14 16:23               ` Paolo Bonzini
2017-03-09 17:19 ` [Qemu-devel] [PATCH 0/6] tcg: fix icount super slowdown Alex Bennée
2017-03-09 17:22   ` Paolo Bonzini

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=871su5ihwl.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).