History | View | Annotate | Download (30.4 kB)
main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring1.0. Besides allowing true SMP support with KVM, the I/O thread means that theTCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-timer: Introduce clock reset notifier
QEMU_CLOCK_HOST is based on the system time which may jump backward incase the admin or NTP adjusts it. RTC emulations and other device modelscan suffer in this case as timers will stall for the period the clock...
Register Linux dyntick timer as per-thread signal
Derived from kvm-tool patchhttp://thread.gmane.org/gmane.comp.emulators.kvm.devel/74309
Ingo Molnar pointed out that sending the timer signal to the wholeprocess, just blocking it everywhere, is suboptimal with an increasing...
qemu-timer: change unix timer to dynticks
A timer that wakes up every millisecond puts a lot of stress on theiothread. The large amount of IPIs causes very high context switchactivity, making emulation slow and the UI unusable. This is by theway the same reason why the Windows timers were switched to dynticks....
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.
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