History | View | Annotate | Download (21.7 kB)
timer: protect timers_state's clock with seqlock
QEMU_CLOCK_VIRTUAL may be read outside BQL. This will make itsfoundation, i.e. cpu_clock_offset exposed to race condition.Using private lock to protect it.
After this patch, reading QEMU_CLOCK_VIRTUAL is thread safe...
qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe
Introduce QEMUTimerList->active_timers_lock to protect the linked listof active timers. This allows qemu_timer_mod_ns() to be called from anythread.
Note that vm_clock is not thread-safe and its use of...
aio / timers: Rearrange timer.h & make legacy functions call non-legacy
Rearrange timer.h so it is in order by function type.
Make legacy functions call non-legacy functions rather than vice-versa.
Convert cpus.c to use new API.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
aio / timers: Remove main_loop_timerlist
Now we have timerlistgroups implemented and main_loop_tlg, weno longer need the concept of a default timer list associatedwith each clock. Remove it and simplify initialisation ofclocks and timer lists.
aio / timers: Remove legacy interface
Remove the legacy interface from include/qemu/timers.h.
Ensure struct QEMUClock is not exposed at all.
Signed-off-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio / timers: Remove alarm timers
Remove alarm timers from qemu-timers.c now we use g_poll / ppollinstead.
aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline
Remove qemu_clock_deadline and qemu_timerlist_deadline now we are usingthe ns functions throughout.
aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms
Add utility functions qemu_clock_get_ms and qemu_clock_get_us
aio / timers: Add documentation and new format calls
Add documentation for existing qemu timer calls. Add new formatcalls of the format timer_XXX rather than qemu_XXX_timerfor consistency.
aio / timers: Add a notify callback to QEMUTimerList
Add a notify pointer to QEMUTimerList so it knows what to notifyon a timer change.
aio / timers: On timer modification, qemu_notify or aio_notify
On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called toend the appropriate poll(), irrespective of use_icount value.
On qemu_clock_enable, ensure qemu_notify or aio_notify is called for...
aio / timers: Introduce new API timer_new and friends
Introduce new API for creating timers - timer_new and_ns, _ms, _us derivatives.
aio / timers: Use all timerlists in icount warp calculations
Notify all timerlists derived from vm_clock in icount warpcalculations.
When calculating timer delay based on vm_clock deadline, useall timerlists.
For compatibility, maintain an apparent bug where when using...
aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress
Make qemu_run_timers and qemu_run_all_timers return progressso that aio_poll etc. can determine whether a timer has beenrun.
aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList
Split QEMUClock into QEMUClock and QEMUTimerList so that we canhave more than one QEMUTimerList associated with the same clock.
Introduce a main_loop_timerlist concept and make existingqemu_clock_* calls that actually should operate on a QEMUTimerList...
aio / timers: Untangle include files
include/qemu/timer.h has no need to include main-loop.h anddoing so causes an issue for the next patch. Unfortunatelyvarious files assume including timers.h will pull in main-loop.h.Untangle this mess.
aio / timers: Add QEMUTimerListGroup and helper functions
Add QEMUTimerListGroup and helper functions, to representa QEMUTimerList associated with each clock. Add a defaultQEMUTimerListGroup representing the default timer listswhich are not associated with any other object (e.g....
aio / timers: add ppoll support with qemu_poll_ns
Add qemu_poll_ns which works like g_poll but takes a nanosecondtimeout.
aio / timers: Rename qemu_timer_* functions
Rename four functions in preparation for new API.
Rename qemu_timer_expired to timer_expiredRename qemu_timer_expire_time_ns to timer_expire_time_nsRename qemu_timer_pending to timer_pendingRename qemu_timer_expired_ns to timer_expired_ns...
aio / timers: Rename qemu_new_clock and expose clock types
Rename qemu_new_clock to qemu_clock_new.
Expose clock types.
aio / timers: add qemu-timer.c utility functions
Add utility functions to qemu-timer.c for nanosecond timing.
Add qemu_clock_deadline_ns to calculate deadlines tonanosecond accuracy.
Add utility function qemu_soonest_timeout to calculate soonest deadline....
Remove unnecessary FreeBSD #include
sys/param.h was included to define __FreeBSD_version, but the conditionalusing it was removed by commit d05ef160453e98546a4197496dc8a3cb2defac53(Brad Smith, "Allow clock_gettime() monotonic clock to be utilized on more...
Allow clock_gettime() monotonic clock to be utilized on more OS's
Allow the clock_gettime() code using monotonic clock to be utilized onmore POSIX compliannt OS's. This started as a fix for OpenBSD which waslisted in one function as part of the previous hard coded list of OS's...
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>