1. 14 3月, 2014 6 次提交
  2. 27 2月, 2014 1 次提交
    • P
      target-arm: Store AIF bits in env->pstate for AArch32 · 4cc35614
      Peter Maydell 提交于
      To avoid complication in code that otherwise would not need to
      care about whether EL1 is AArch32 or AArch64, we should store
      the interrupt mask bits (CPSR.AIF in AArch32 and PSTATE.DAIF
      in AArch64) in one place consistently regardless of EL1's mode.
      Since AArch64 has an extra enable bit (D for debug exceptions)
      which isn't visible in AArch32, this means we need to keep
      the enables in env->pstate. (This is also consistent with the
      general approach we're taking that we handle 32 bit CPUs as
      being like AArch64/ARMv8 CPUs but which only run in 32 bit mode.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      4cc35614
  3. 11 2月, 2014 1 次提交
  4. 08 1月, 2014 1 次提交
  5. 24 12月, 2013 1 次提交
  6. 23 12月, 2013 1 次提交
  7. 07 10月, 2013 1 次提交
  8. 03 9月, 2013 2 次提交
  9. 23 7月, 2013 2 次提交
  10. 10 7月, 2013 3 次提交
  11. 16 6月, 2013 1 次提交
  12. 13 4月, 2013 1 次提交
  13. 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
  14. 23 3月, 2013 2 次提交
  15. 12 3月, 2013 2 次提交
  16. 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
  17. 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
  18. 16 2月, 2013 3 次提交
  19. 19 12月, 2012 3 次提交
  20. 31 10月, 2012 1 次提交
  21. 05 10月, 2012 1 次提交
  22. 27 8月, 2012 1 次提交
  23. 24 8月, 2012 1 次提交