1. 15 4月, 2011 1 次提交
    • P
      enable vm_clock to "warp" in the iothread+icount case · ab33fcda
      Paolo Bonzini 提交于
      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
      icount, but the vCPU doesn't run any insns.
      
      You could say that VCPUs should never go to sleep in icount
      mode if there is a pending vm_clock timer; rather time should
      just warp to the next vm_clock event with no sleep ever taking place.
      Even better, you can sleep for some time related to the
      time left until the next event, to avoid that the warps are too visible
      externally; for example, you could be sending network packets continously
      instead of every 100ms.
      
      This is what this patch implements.  qemu_clock_warp is called: 1)
      whenever a vm_clock timer is adjusted, to ensure the warp_timer is
      synchronized; 2) at strategic points in the CPU thread, to make sure
      the insn counter is synchronized before the CPU starts running.
      In any case, the warp_timer is disabled while the CPU is running,
      because the insn counter will then be making progress on its own.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      ab33fcda
  2. 21 3月, 2011 3 次提交
  3. 30 10月, 2010 1 次提交
  4. 23 10月, 2010 1 次提交
    • B
      qemu-timer: move commonly used timer code to qemu-timer-common · c57c846a
      Blue Swirl 提交于
      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)
      to qemu-timer.h.
      
      Adjust block/raw-posix.c and simpletrace.c to use get_clock() directly.
      Remove a similar/duplicate definition in qemu-tool.c.
      
      Adjust hw/omap_clk.c to include qemu-timer.h because muldiv64() is used
      there.
      
      After this change, tracing can be used also for user code and
      simpletrace on Win32.
      
      Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Acked-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      c57c846a
  5. 27 4月, 2010 1 次提交
  6. 18 4月, 2010 1 次提交
  7. 03 4月, 2010 1 次提交
    • A
      Make cpu_get_real_ticks use mfspr · 4a9590f3
      Alexander Graf 提交于
      PowerPC CPUs have had two ways to read the time base for quite some time now.
      They provide it using the mfspr instruction or - if a special bit is set in
      that opcode - using mftb. For timekeeping we're currently using mftb.
      
      While trying to get Qemu up and running on an e500v2 system, I stumbled over
      the CPU not supporting mftbu. It just throws an illegal instruction trap.
      
      So let's read the SPR values instead. All PPC CPUs should support them anyways.
      
      I tested this patch on an e500v2 system where it makes qemu work and on my 970MP
      system with 32-bit user space where everything still works with this patch
      applied.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: Nmalc <av1474@comtv.ru>
      4a9590f3
  8. 30 3月, 2010 1 次提交
  9. 18 3月, 2010 1 次提交
  10. 10 2月, 2010 1 次提交
  11. 05 10月, 2009 1 次提交
    • J
      Introduce QEMU_CLOCK_HOST · 21d5d12b
      Jan Kiszka 提交于
      Despite its name QEMU_CLOCK_REALTIME is (normally) not using
      CLOCK_REALTIME / the host system time as base. In order to allow also
      non-trivial RTC emulations (MC146818) to follow the host time instead of
      the virtual guest time, introduce the new clock type QEMU_CLOCK_HOST. It
      is unconditionally based on CLOCK_REALTIME, thus will follow system time
      changes of the host.
      
      The only limitation of its current implementation is that pending
      host_clock timers may not fire early if the host time is pushed forward
      beyond their expiry. So far no urgent need to overcome this limitation
      was identified, so it's left as simple as it is (expiry on next alarm
      timer tick).
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      21d5d12b
  12. 12 9月, 2009 1 次提交
    • A
      Make get_ticks_per_sec() a static inline · 274dfed8
      Anthony Liguori 提交于
      ticks_per_sec is a constant.  There's no need to store it as a variable as it
      never changes since our time is based on units.
      
      Convert get_ticks_per_sec() to a static inline and move the constant into
      qemu-timer.h.  Remove all references to QEMU_TIMER_BASE so that we consistently
      use this interface.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      274dfed8
  13. 11 9月, 2009 1 次提交
  14. 11 8月, 2009 1 次提交
  15. 18 11月, 2007 1 次提交