History | View | Annotate | Download (30.4 kB)
timer: drop HPET and RTC
dynticks will provide equally good timer granularity on all modern Linuxsystems. This is more or less dead code these days.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-timer: Add and use new function qemu_timer_expired_ns
This simply moves code which is used three timesinto a new function thus improving readability.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
qemu-timer: Avoid type casts
The type casts are no longer needed after some small changesin struct qemu_alarm_timer. This also improves readabilityof the code.
qemu-timer: Fix timers for w32
Commit 68c23e5520e8286d79d96ab47c0ea722ceb75041 removed themultimedia timer, but this timer is needed for certainLinux kernels. Otherwise Linux boot stops with this error:
MP-BIOS bug: 8254 timer not connected to IO-APIC...
enable vm_clock to "warp" in the iothread+icount case
The previous patch however is not enough, because if the virtual CPUgoes to sleep waiting for a future timer interrupt to wake it up, qemudeadlocks. The timer interrupt never comes because time is driven by...
Revert wrong fixes for -icount in the iothread case
This reverts commits 225d02cd and c9f7383c. While some parts ofthe latter could be saved, I preferred a smooth, complete revert.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Tested-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
qemu_next_deadline should not consider host-time timers
It is purely for icount-based virtual timers. And now that we got thecode right, rename the function to clarify the intended scope.
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/' \...
change all other clock references to use nanosecond resolution accessors
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\>' )...
add a generic scaling mechanism for timers
This enables rt_clock timers to use nanosecond resolution, just byusing the _ns functions; there is really no reason to forbid that.
Migrated timers are all using vm_clock (of course; but I checked thatanyway) so the timers in the savevm files are already in nanosecond...
remove qemu_get_clock
These patches are already not doing a great service to out-of-treemodifications to QEMU. However, at least we can warn them by gettingrid of the old confusing functions, or otherwise causing compilationerrors. This patch removes qemu_get_clock; the previous one changed...
implement win32 dynticks timer
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
use win32 timer queues
Multimedia timers are only useful for compatibility with Windows NT 4.0and earlier. Plus, the implementation in Wine is extremely heavyweight.
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 aswell be infinite and is only masking bugs, use the higher value.With this change the !use_icount code is handled equivalently...
qemu-timer: Fix compilation of new timer code for w32, w64
qemu_next_alarm_deadline() is needed by MinGW, too.
Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Anthony Liguori <aliguori@us.ibm.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
use nanoseconds everywhere for timeout computation
Suggested by Aurelien Jarno.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Correct alarm deadline computation
When the QEMU_CLOCK_HOST clock was added, computation of itsdeadline was added to qemu_next_deadline, which is correct butincomplete.
I noticed this by reading the very convoluted rules wherebyqemu_next_deadline_dyntick is computed, which miss QEMU_CLOCK_HOST...
Unify alarm deadline computation
This patch shows how using the correct formula forqemu_next_deadline_dyntick can simplify the code ofhost_alarm_handler and eliminate useless duplication.
Avoid deadlock whith iothread and icount
When using the iothread together with icount, make sure theqemu_icount counter makes forward progress when the vcpu isidle to avoid deadlocks.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
qemu-timer: move commonly used timer code to qemu-timer-common
Move timer init functions to a new file, qemu-timer-common.c. Make othercritical timer functions inlined to preserve performance inqemu-timer.c, also move muldiv64() (used by the inline functions)...
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
Compile qemu-timer only once
Arrange various declarations so that also non-CPU code can accessthem, adjust users.
Move CPU specific code to cpus.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add a missing #include for FreeBSD hosts
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix race between timer firing vs. alarm_timer->pending = 0
The period for Win32 timers is very short and always the sameindependent of dynticks, so it's possible that the timer firesbefore qemu_run_all_timers has reset alarm_timer->pending to zero.Reset alarm_timer->pending before rearming....
split out qemu-timer.c