1. 07 10月, 2013 1 次提交
  2. 03 9月, 2013 2 次提交
  3. 23 7月, 2013 2 次提交
  4. 10 7月, 2013 3 次提交
  5. 16 6月, 2013 1 次提交
  6. 13 4月, 2013 1 次提交
  7. 12 4月, 2013 1 次提交
    • P
      cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC) · c30d1aea
      Peter Maydell 提交于
      The CONFIG_DEBUG_EXEC define compiles out a single qemu_log_mask()
      call, which is a pretty trivial cost even for something in the main
      cpu_exec() loop.  Having this be conditionally defined means that
      '-d exec' on a non-debug build will silently do nothing.  Drop the
      define and the configure machinery that sets it, in favour of just
      always allowing this log option to be enabled at runtime.  As a
      concession to the mainloopiness, we use qemu_loglevel_mask()+qemu_log()
      rather than qemu_log_mask() to avoid the function call overhead.
      
      Note that DEBUG_DISAS is always defined, so removing the
      '|| defined(CONFIG_DEBUG_EXEC)' from those conditionals makes
      no behavioural change for that logging.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Acked-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c30d1aea
  8. 23 3月, 2013 2 次提交
  9. 12 3月, 2013 2 次提交
  10. 03 3月, 2013 3 次提交
    • P
      Handle CPU interrupts by inline checking of a flag · 378df4b2
      Peter Maydell 提交于
      Fix some of the nasty TCG race conditions and crashes by implementing
      cpu_exit() as setting a flag which is checked at the start of each TB.
      This avoids crashes if a thread or signal handler calls cpu_exit()
      while the execution thread is itself modifying the TB graph (which
      may happen in system emulation mode as well as in linux-user mode
      with a multithreaded guest binary).
      
      This fixes the crashes seen in LP:668799; however there are another
      class of crashes described in LP:1098729 which stem from the fact
      that in linux-user with a multithreaded guest all threads will
      use and modify the same global TCG date structures (including the
      generated code buffer) without any kind of locking. This means that
      multithreaded guest binaries are still in the "unsupported"
      category.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      378df4b2
    • P
      cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC · 77211379
      Peter Maydell 提交于
      If tcg_qemu_tb_exec() returns a value whose low bits don't indicate a
      link to an indexed next TB, this means that the TB execution never
      started (eg because the instruction counter hit zero).  In this case the
      guest PC has to be reset to the address of the start of the TB.
      Refactor the cpu-exec code to make all tcg_qemu_tb_exec() calls pass
      through a wrapper function which does this restoration if necessary.
      
      Note that the apparent change in cpu_exec_nocache() from calling
      cpu_pc_from_tb() with the old TB to calling it with the TB returned by
      do_tcg_qemu_tb_exec() is safe, because in the nocache case we can
      guarantee that the TB we try to execute is not linked to any others,
      so the only possible returned TB is the one we started at. That is,
      we should arguably previously have included in cpu_exec_nocache() an
      assert(next_tb & ~TB_EXIT_MASK) == tb), since the API requires restore
      from next_tb but we were using tb.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      77211379
    • P
      tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses · 0980011b
      Peter Maydell 提交于
      Document tcg_qemu_tb_exec(). In particular, its return value is a
      combination of a pointer to the next translation block and some
      extra information in the low two bits. Provide some #defines for
      the values passed in these bits to improve code clarity.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      0980011b
  11. 24 2月, 2013 1 次提交
    • P
      Replace all setjmp()/longjmp() with sigsetjmp()/siglongjmp() · 6ab7e546
      Peter Maydell 提交于
      The setjmp() function doesn't specify whether signal masks are saved and
      restored; on Linux they are not, but on BSD (including MacOSX) they are.
      We want to have consistent behaviour across platforms, so we should
      always use "don't save/restore signal mask" (this is also generally
      going to be faster). This also works around a bug in MacOSX where the
      signal-restoration on longjmp() affects the signal mask for a completely
      different thread, not just the mask for the thread which did the longjmp.
      The most visible effect of this was that ctrl-C was ignored on MacOSX
      because the CPU thread did a longjmp which resulted in its signal mask
      being applied to every thread, so that all threads had SIGINT and SIGTERM
      blocked.
      
      The POSIX-sanctioned portable way to do a jump without affecting signal
      masks is to siglongjmp() to a sigjmp_buf which was created by calling
      sigsetjmp() with a zero savemask parameter, so change all uses of
      setjmp()/longjmp() accordingly. [Technically POSIX allows sigsetjmp(buf, 0)
      to save the signal mask; however the following siglongjmp() must not
      restore the signal mask, so the pair can be effectively considered as
      "sigjmp/longjmp which don't touch the mask".]
      
      For Windows we provide a trivial sigsetjmp/siglongjmp in terms of
      setjmp/longjmp -- this is OK because no user will ever pass a non-zero
      savemask.
      
      The setjmp() uses in tests/tcg/test-i386.c and tests/tcg/linux-test.c
      are left untouched because these are self-contained singlethreaded
      test programs intended to be run under QEMU's Linux emulation, so they
      have neither the portability nor the multithreading issues to deal with.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Tested-by: NStefan Weil <sw@weilnetz.de>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      6ab7e546
  12. 16 2月, 2013 3 次提交
  13. 19 12月, 2012 3 次提交
  14. 31 10月, 2012 1 次提交
  15. 05 10月, 2012 1 次提交
  16. 27 8月, 2012 1 次提交
  17. 24 8月, 2012 1 次提交
  18. 11 8月, 2012 1 次提交
  19. 28 7月, 2012 2 次提交
  20. 10 7月, 2012 1 次提交
    • J
      apic: Defer interrupt updates to VCPU thread · 5d62c43a
      Jan Kiszka 提交于
      KVM performs TPR raising asynchronously to QEMU, specifically outside
      QEMU's global lock. When an interrupt is injected into the APIC and TPR
      is checked to decide if this can be delivered, a stale TPR value may be
      used, causing spurious interrupts in the end.
      
      Fix this by deferring apic_update_irq to the context of the target VCPU.
      We introduce a new interrupt flag for this, CPU_INTERRUPT_POLL. When it
      is set, the VCPU calls apic_poll_irq before checking for further pending
      interrupts. To avoid special-casing KVM, we also implement this logic
      for TCG mode.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      5d62c43a
  21. 29 6月, 2012 1 次提交
    • B
      x86: avoid AREG0 for exceptions · 77b2bc2c
      Blue Swirl 提交于
      Add an explicit CPUX86State parameter instead of relying on AREG0.
      
      Merge raise_exception_env() to raise_exception(), likewise with
      raise_exception_err_env() and raise_exception_err().
      
      Introduce cpu_svm_check_intercept_param() and cpu_vmexit()
      as wrappers.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      77b2bc2c
  22. 25 6月, 2012 1 次提交
  23. 15 6月, 2012 1 次提交
  24. 05 6月, 2012 2 次提交
  25. 16 4月, 2012 1 次提交
  26. 30 3月, 2012 1 次提交
    • A
      qtest: add test framework · c7f0f3b1
      Anthony Liguori 提交于
      The idea behind qtest is pretty simple.  Instead of executing a CPU via TCG or
      KVM, rely on an external process to send events to the device model that the CPU
      would normally generate.
      
      qtest presents itself as an accelerator.  In addition, a new option is added to
      establish a qtest server (-qtest) that takes a character device.  This is what
      allows the external process to send CPU events to the device model.
      
      qtest uses a simple line based protocol to send the events.  Documentation of
      that protocol is in qtest.c.
      
      I considered reusing the monitor for this job.  Adding interrupts would be a bit
      difficult.  In addition, logging would also be difficult.
      
      qtest has extensive logging support.  All protocol commands are logged with
      time stamps using a new command line option (-qtest-log).  Logging is important
      since ultimately, this is a feature for debugging.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c7f0f3b1