Statistics
| Branch: | Revision:

root / qemu-timer.c @ 66fcf8ff

History | View | Annotate | Download (33.3 kB)

# Date Author Comment
45c7b37f 04/27/2011 02:30 pm Stefan Weil

qemu-timer: Add and use new function qemu_timer_expired_ns

This simply moves code which is used three times
into a new function thus improving readability.

Signed-off-by: Stefan Weil <>

cd0544ee 04/27/2011 02:30 pm Stefan Weil

qemu-timer: Avoid type casts

The type casts are no longer needed after some small changes
in struct qemu_alarm_timer. This also improves readability
of the code.

Signed-off-by: Stefan Weil <>

2f9cba0c 04/27/2011 02:30 pm Stefan Weil

qemu-timer: Fix timers for w32

Commit 68c23e5520e8286d79d96ab47c0ea722ceb75041 removed the
multimedia timer, but this timer is needed for certain
Linux kernels. Otherwise Linux boot stops with this error:

MP-BIOS bug: 8254 timer not connected to IO-APIC...
ab33fcda 04/15/2011 10:27 am Paolo Bonzini

enable vm_clock to "warp" in the iothread+icount case

The previous patch however is not enough, because if the virtual CPU
goes to sleep waiting for a future timer interrupt to wake it up, qemu
deadlocks. The timer interrupt never comes because time is driven by...

1ece93a9 04/15/2011 10:27 am Paolo Bonzini

Revert wrong fixes for -icount in the iothread case

This reverts commits 225d02cd and c9f7383c. While some parts of
the latter could be saved, I preferred a smooth, complete revert.

Signed-off-by: Paolo Bonzini <>
Tested-by: Edgar E. Iglesias <>...

cb842c90 04/15/2011 10:27 am Paolo Bonzini

qemu_next_deadline should not consider host-time timers

It is purely for icount-based virtual timers. And now that we got the
code right, rename the function to clarify the intended scope.

Signed-off-by: Paolo Bonzini <>
Tested-by: Edgar E. Iglesias <>...

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

This was done with:

sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \
$(git grep -l 'get_clock\>.*rt_clock' )
sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
74475455 03/21/2011 10:23 am Paolo Bonzini

change all other clock references to use nanosecond resolution accessors

This was done with:

sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
$(git grep -l 'qemu_get_clock\>' )
sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
$(git grep -l 'qemu_new_timer\>' )...
4a998740 03/21/2011 10:23 am Paolo Bonzini

add a generic scaling mechanism for timers

This enables rt_clock timers to use nanosecond resolution, just by
using the _ns functions; there is really no reason to forbid that.

Migrated timers are all using vm_clock (of course; but I checked that
anyway) so the timers in the savevm files are already in nanosecond...

6d5ad9bf 03/21/2011 10:23 am Paolo Bonzini

remove qemu_get_clock

These patches are already not doing a great service to out-of-tree
modifications to QEMU. However, at least we can warn them by getting
rid of the old confusing functions, or otherwise causing compilation
errors. This patch removes qemu_get_clock; the previous one changed...

cfced5b2 03/13/2011 04:44 pm Paolo Bonzini

implement win32 dynticks timer

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

68c23e55 03/13/2011 04:44 pm Paolo Bonzini

use win32 timer queues

Multimedia timers are only useful for compatibility with Windows NT 4.0
and earlier. Plus, the implementation in Wine is extremely heavyweight.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

c9f7383c 02/23/2011 11:42 am Paolo Bonzini

do not use qemu_icount_delta in the !use_icount case

The !use_icount code is the same for iothread and non-iothread,
except that the timeout is different. Since the timeout might as
well be infinite and is only masking bugs, use the higher value.
With this change the !use_icount code is handled equivalently...

f26e5a54 02/07/2011 09:50 pm Stefan Weil

qemu-timer: Fix compilation of new timer code for w32, w64

qemu_next_alarm_deadline() is needed by MinGW, too.

Cc: Paolo Bonzini <>
Cc: Anthony Liguori <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Stefan Weil <>...

9c13246a 02/04/2011 02:33 pm Paolo Bonzini

use nanoseconds everywhere for timeout computation

Suggested by Aurelien Jarno.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

6ad0a1ed 02/04/2011 02:33 pm Paolo Bonzini

Correct alarm deadline computation

When the QEMU_CLOCK_HOST clock was added, computation of its
deadline was added to qemu_next_deadline, which is correct but
incomplete.

I noticed this by reading the very convoluted rules whereby
qemu_next_deadline_dyntick is computed, which miss QEMU_CLOCK_HOST...

4c3d45eb 02/04/2011 02:33 pm Paolo Bonzini

Unify alarm deadline computation

This patch shows how using the correct formula for
qemu_next_deadline_dyntick can simplify the code of
host_alarm_handler and eliminate useless duplication.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

225d02cd 01/23/2011 05:44 am Edgar E. Iglesias

Avoid deadlock whith iothread and icount

When using the iothread together with icount, make sure the
qemu_icount counter makes forward progress when the vcpu is
idle to avoid deadlocks.

Signed-off-by: Edgar E. Iglesias <>

c57c846a 10/23/2010 06:24 pm Blue Swirl

qemu-timer: move commonly used timer code to qemu-timer-common

Move timer init functions to a new file, qemu-timer-common.c. Make other
critical timer functions inlined to preserve performance in
qemu-timer.c, also move muldiv64() (used by the inline functions)...

0be71e32 07/06/2010 06:36 pm Alex Williamson

savevm: Add DeviceState param

When available, we'd like to be able to access the DeviceState
when registering a savevm. For buses with a get_dev_path()
function, this will allow us to create more unique savevm
id strings.

Signed-off-by: Alex Williamson <>...

29e922b6 03/29/2010 10:24 pm Blue Swirl

Compile qemu-timer only once

Arrange various declarations so that also non-CPU code can access
them, adjust users.

Move CPU specific code to cpus.c.

Signed-off-by: Blue Swirl <>

44459349 03/27/2010 03:38 pm Juergen Lock

Add a missing #include for FreeBSD hosts

Signed-off-by: Juergen Lock <>
Signed-off-by: Aurelien Jarno <>

ca5a2a4b 03/27/2010 03:05 pm Paolo Bonzini

fix race between timer firing vs. alarm_timer->pending = 0

The period for Win32 timers is very short and always the same
independent of dynticks, so it's possible that the timer fires
before qemu_run_all_timers has reset alarm_timer->pending to zero.
Reset alarm_timer->pending before rearming....

db1a4972 03/17/2010 06:16 pm Paolo Bonzini

split out qemu-timer.c

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>