qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 098001: tcg: Document tcg_qemu_tb_exec() and


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 098001: tcg: Document tcg_qemu_tb_exec() and provide const...
Date: Sun, 03 Mar 2013 08:00:13 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0980011b4f66482d2733ab2dd0f2f61747772c6b
      
https://github.com/qemu/qemu/commit/0980011b4f66482d2733ab2dd0f2f61747772c6b
  Author: Peter Maydell <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M cpu-exec.c
    M include/exec/gen-icount.h
    M tcg/tcg.h

  Log Message:
  -----------
  tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses

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: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


  Commit: fadf982584b040527aeee0ede270a4d01463d293
      
https://github.com/qemu/qemu/commit/fadf982584b040527aeee0ede270a4d01463d293
  Author: Andreas Färber <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M target-alpha/cpu-qom.h
    M target-arm/cpu-qom.h
    M target-cris/cpu-qom.h
    M target-i386/cpu-qom.h
    M target-lm32/cpu-qom.h
    M target-m68k/cpu-qom.h
    M target-microblaze/cpu-qom.h
    M target-mips/cpu-qom.h
    M target-openrisc/cpu.h
    M target-ppc/cpu-qom.h
    M target-s390x/cpu-qom.h
    M target-sh4/cpu-qom.h
    M target-sparc/cpu-qom.h
    M target-unicore32/cpu-qom.h
    M target-xtensa/cpu-qom.h

  Log Message:
  -----------
  cpu: Introduce ENV_OFFSET macros

Introduce ENV_OFFSET macros which can be used in non-target-specific
code that needs to generate TCG instructions which reference CPUState
fields given the cpu_env register that TCG targets set up with a
pointer to the CPUArchState struct.

Signed-off-by: Andreas Färber <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


  Commit: 77211379d73ea0c89c0b5bb6eee74b17cb06f9a8
      
https://github.com/qemu/qemu/commit/77211379d73ea0c89c0b5bb6eee74b17cb06f9a8
  Author: Peter Maydell <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC

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: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


  Commit: 378df4b23753a11be650af7664ca76bc75cb9f01
      
https://github.com/qemu/qemu/commit/378df4b23753a11be650af7664ca76bc75cb9f01
  Author: Peter Maydell <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M cpu-exec.c
    M exec.c
    M include/exec/gen-icount.h
    M include/qom/cpu.h
    M tcg/tcg.h
    M translate-all.c

  Log Message:
  -----------
  Handle CPU interrupts by inline checking of a flag

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: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


  Commit: 3a808cc407744c30daa7470b5f191cde1fbc1aae
      
https://github.com/qemu/qemu/commit/3a808cc407744c30daa7470b5f191cde1fbc1aae
  Author: Peter Maydell <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all.c: Remove cpu_unlink_tb()

The (unsafe) function cpu_unlink_tb() is now unused, so we can simply
remove it and any code that was only used by it.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


  Commit: 806f352d3d6f7b326b0ab3a49c622b124459dc8d
      
https://github.com/qemu/qemu/commit/806f352d3d6f7b326b0ab3a49c622b124459dc8d
  Author: Peter Maydell <address@hidden>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M include/exec/gen-icount.h
    M target-alpha/translate.c
    M target-arm/translate.c
    M target-cris/translate.c
    M target-i386/translate.c
    M target-lm32/translate.c
    M target-m68k/translate.c
    M target-microblaze/translate.c
    M target-mips/translate.c
    M target-openrisc/translate.c
    M target-ppc/translate.c
    M target-s390x/translate.c
    M target-sh4/translate.c
    M target-sparc/translate.c
    M target-unicore32/translate.c
    M target-xtensa/translate.c

  Log Message:
  -----------
  gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end

The gen_icount_start/end functions are now somewhat misnamed since they
are useful for generic "start/end of TB" code, used for more than just
icount. Rename them to gen_tb_start/end.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>


Compare: https://github.com/qemu/qemu/compare/07ca08bac88f...806f352d3d6f

reply via email to

[Prev in Thread] Current Thread [Next in Thread]