qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 89fee7: tb: consistently use uint32_t for tb-


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 89fee7: tb: consistently use uint32_t for tb->flags
Date: Fri, 13 May 2016 03:30:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 89fee74a0f066dfd73830a7b5fa137e87888c870
      
https://github.com/qemu/qemu/commit/89fee74a0f066dfd73830a7b5fa137e87888c870
  Author: Emilio G. Cota <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c
    M exec.c
    M hw/i386/kvmvapic.c
    M include/exec/exec-all.h
    M target-alpha/cpu.h
    M target-arm/cpu.h
    M target-cris/cpu.h
    M target-i386/cpu.h
    M target-i386/translate.c
    M target-lm32/cpu.h
    M target-m68k/cpu.h
    M target-microblaze/cpu.h
    M target-mips/cpu.h
    M target-moxie/cpu.h
    M target-openrisc/cpu.h
    M target-ppc/cpu.h
    M target-s390x/cpu.h
    M target-sh4/cpu.h
    M target-sparc/cpu.h
    M target-tilegx/cpu.h
    M target-tricore/cpu.h
    M target-unicore32/cpu.h
    M target-xtensa/cpu.h
    M translate-all.c

  Log Message:
  -----------
  tb: consistently use uint32_t for tb->flags

We are inconsistent with the type of tb->flags: usage varies loosely
between int and uint64_t. Settle to uint32_t everywhere, which is
superior to both: at least one target (aarch64) uses the most significant
bit in the u32, and uint64_t is wasteful.

Compile-tested for all targets.

Suggested-by: Laurent Desnogues <address@hidden>
Suggested-by: Richard Henderson <address@hidden>
Tested-by: Edgar E. Iglesias <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Reviewed-by: Laurent Desnogues <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>


  Commit: 18a60a76147569ca9e11b0607e50ce4012fe1aaa
      
https://github.com/qemu/qemu/commit/18a60a76147569ca9e11b0607e50ce4012fe1aaa
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  include/qemu/osdep.h: Add a macro to check for alignment

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 6b587d3cda48e7ba26de8d30bf0d8a7063970715
      
https://github.com/qemu/qemu/commit/6b587d3cda48e7ba26de8d30bf0d8a7063970715
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  include/qemu/osdep.h: Add macros for pointer alignment

These macros provide a convenient way to n-byte align pointers up and
down and check if a pointer is n-byte aligned.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 76442a939ef8fc062b35a890a824de203bb5bd5f
      
https://github.com/qemu/qemu/commit/76442a939ef8fc062b35a890a824de203bb5bd5f
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/tci/tcg-target.inc.c
    M tci.c

  Log Message:
  -----------
  tci: Make direct jump patching thread-safe

Ensure direct jump patching in TCI is atomic by:
 * naturally aligning a location of direct jump address;
 * using atomic_read()/atomic_set() to load/store the address.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 399f1648573d49b9411089e4e2ea62b6357b166e
      
https://github.com/qemu/qemu/commit/399f1648573d49b9411089e4e2ea62b6357b166e
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M tcg/ppc/tcg-target.inc.c
    M translate-all.c

  Log Message:
  -----------
  tcg/ppc: Make direct jump patching thread-safe

Ensure direct jump patching in PPC is atomic by:
 * limiting translation buffer size in 32-bit mode to be addressable by
   Branch I-form instruction;
 * using atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 0d07abf05e98903c7faf204a9a90f7d45b7554dc
      
https://github.com/qemu/qemu/commit/0d07abf05e98903c7faf204a9a90f7d45b7554dc
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/i386/tcg-target.inc.c

  Log Message:
  -----------
  tcg/i386: Make direct jump patching thread-safe

Ensure direct jump patching in i386 is atomic by:
 * naturally aligning a location of direct jump address;
 * using atomic_read()/atomic_set() for code patching.

tcg_out_nopn() implementation:
Suggested-by: Richard Henderson <address@hidden>.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: ed3d51ecd7fe248d3959e469d53890ac9ffe0cd2
      
https://github.com/qemu/qemu/commit/ed3d51ecd7fe248d3959e469d53890ac9ffe0cd2
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/s390/tcg-target.inc.c

  Log Message:
  -----------
  tcg/s390: Make direct jump patching thread-safe

Ensure direct jump patching in s390 is atomic by:
 * naturally aligning a location of direct jump address;
 * using atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 7d14e0e2d661479985197203589c38840e1066df
      
https://github.com/qemu/qemu/commit/7d14e0e2d661479985197203589c38840e1066df
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/arm/tcg-target.inc.c

  Log Message:
  -----------
  tcg/arm: Make direct jump patching thread-safe

Ensure direct jump patching in ARM is atomic by using
atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 9e269112953be4d670cb0d25042bd6546fcf3e45
      
https://github.com/qemu/qemu/commit/9e269112953be4d670cb0d25042bd6546fcf3e45
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M tcg/aarch64/tcg-target.inc.c

  Log Message:
  -----------
  tcg/aarch64: Make direct jump patching thread-safe

Ensure direct jump patching in AArch64 is atomic by using
atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 84f79fb7c6e857edc807e4a251338243ce0cbac3
      
https://github.com/qemu/qemu/commit/84f79fb7c6e857edc807e4a251338243ce0cbac3
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M tcg/sparc/tcg-target.inc.c

  Log Message:
  -----------
  tcg/sparc: Make direct jump patching thread-safe

Ensure direct jump patching in SPARC is atomic by using
atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: c82460a560176ef69c2f0662bd280612e274db96
      
https://github.com/qemu/qemu/commit/c82460a560176ef69c2f0662bd280612e274db96
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M tcg/mips/tcg-target.inc.c

  Log Message:
  -----------
  tcg/mips: Make direct jump patching thread-safe

Ensure direct jump patching in MIPS is atomic by using
atomic_read()/atomic_set() for code patching.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
[rth: Merged the deposit32 followup.]
[rth: Merged the following followup.]
Message-Id: <address@hidden>


  Commit: 10b4f4855537dd421e193a7d0416513116370558
      
https://github.com/qemu/qemu/commit/10b4f4855537dd421e193a7d0416513116370558
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h

  Log Message:
  -----------
  tcg: Note requirement on atomic direct jump patching

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 835154b6e2200460f04719d0028716a37c178368
      
https://github.com/qemu/qemu/commit/835154b6e2200460f04719d0028716a37c178368
  Author: Emilio G. Cota <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all: remove redundant setting of tcg_ctx.code_gen_buffer_size

The setting of tcg_ctx.code_gen_buffer_size is done by the only caller of
size_code_gen_buffer(), which is code_gen_alloc():

  $ git grep size_code_gen_buffer
  translate-all.c:static inline size_t size_code_gen_buffer(size_t tb_size)
  translate-all.c:    tcg_ctx.code_gen_buffer_size = 
size_code_gen_buffer(tb_size);

Signed-off-by: Emilio G. Cota <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 8bdf4997823126a39bd4c99e4b2283b02cc7865f
      
https://github.com/qemu/qemu/commit/8bdf4997823126a39bd4c99e4b2283b02cc7865f
  Author: Emilio G. Cota <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all: add missing munmap of the code_gen guard page for MIPS

Signed-off-by: Emilio G. Cota <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 7ba6a512ae439c98c0c1f0f4348c079d90f9dd9d
      
https://github.com/qemu/qemu/commit/7ba6a512ae439c98c0c1f0f4348c079d90f9dd9d
  Author: Richard Henderson <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all: Adjust 256mb testing for mips64

Make sure we preserve the high 32-bits when masking for mips64.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: f309101c26b59641fc1aa8fb2a98a5441cdaea03
      
https://github.com/qemu/qemu/commit/f309101c26b59641fc1aa8fb2a98a5441cdaea03
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/aarch64/tcg-target.inc.c
    M tcg/arm/tcg-target.inc.c
    M tcg/i386/tcg-target.inc.c
    M tcg/ia64/tcg-target.inc.c
    M tcg/mips/tcg-target.inc.c
    M tcg/ppc/tcg-target.inc.c
    M tcg/s390/tcg-target.inc.c
    M tcg/sparc/tcg-target.inc.c
    M tcg/tcg.h
    M tcg/tci/tcg-target.inc.c
    M translate-all.c

  Log Message:
  -----------
  tcg: Clean up direct block chaining data fields

Briefly describe in a comment how direct block chaining is done. It
should help in understanding of the following data fields.

Rename some fields in TranslationBlock and TCGContext structures to
better reflect their purpose (dropping excessive 'tb_' prefix in
TranslationBlock but keeping it in TCGContext):
   tb_next_offset  =>  jmp_reset_offset
   tb_jmp_offset   =>  jmp_insn_offset
   tb_next         =>  jmp_target_addr
   jmp_next        =>  jmp_list_next
   jmp_first       =>  jmp_list_first

Avoid using a magic constant as an invalid offset which is used to
indicate that there's no n-th jump generated.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: c37e6d7e3589ecb96914faa21025ad7ba6654aea
      
https://github.com/qemu/qemu/commit/c37e6d7e3589ecb96914faa21025ad7ba6654aea
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h
    M translate-all.c

  Log Message:
  -----------
  tcg: Use uintptr_t type for jmp_list_{next|first} fields of TB

These fields do not contain pure pointers to a TranslationBlock
structure. So uintptr_t is the most appropriate type for them.
Also put some asserts to assure that the two least significant bits of
the pointer are always zero before assigning it to jmp_list_first.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: e90d96b158665a684ab89b4f002838034b5fafc8
      
https://github.com/qemu/qemu/commit/e90d96b158665a684ab89b4f002838034b5fafc8
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: Rearrange tb_link_page() to avoid forward declaration

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 901bc3deb43bf37c85e43955905d003be7ae5fa5
      
https://github.com/qemu/qemu/commit/901bc3deb43bf37c85e43955905d003be7ae5fa5
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: Init TB's direct jumps before making it visible

Initialize TB's direct jump list data fields and reset the jumps before
tb_link_page() puts it into the physical hash table and the physical
page list. So TB is completely initialized before it becomes visible.

This is pure rearrangement of code to a more suitable place, though it
could be a preparation for relaxing the locking scheme in future.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 9962c478b153a18fe88a6509fe58cd178aff8abc
      
https://github.com/qemu/qemu/commit/9962c478b153a18fe88a6509fe58cd178aff8abc
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M include/exec/exec-all.h

  Log Message:
  -----------
  tcg: Clarify thread safety check in tb_add_jump()

The check is to make sure that another thread hasn't already done the
same while we were outside of tb_lock. Mention this in a comment.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 133626783aa5a1bf86332fa3e6f7b8efe005f924
      
https://github.com/qemu/qemu/commit/133626783aa5a1bf86332fa3e6f7b8efe005f924
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: Rename tb_jmp_remove() to tb_remove_from_jmp_list()

tb_jmp_remove() was only used to remove the TB from a list of all TBs
jumping to the same TB which is n-th jump destination of the given TB.
Put a comment briefly describing the function behavior and rename it to
better reflect its purpose.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 89bba496322d4cf996d42cdd4bb0912231656c3d
      
https://github.com/qemu/qemu/commit/89bba496322d4cf996d42cdd4bb0912231656c3d
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: Extract removing of jumps to TB from tb_phys_invalidate()

Move the code for removing jumps to a TB out of tb_phys_invalidate() to
a separate static inline function tb_jmp_unlink(). This simplifies
tb_phys_invalidate() and improves code structure.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: f9c5b66f487a04d3747dc6997b1503f9258df945
      
https://github.com/qemu/qemu/commit/f9c5b66f487a04d3747dc6997b1503f9258df945
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: Clean up tb_jmp_unlink()

Unify the code of this function with tb_jmp_remove_from_list(). Making
these functions similar improves their readability. Also this could be a
step towards making this function thread-safe.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 5b053a4a28278bca606eeff7d1c0730df1b047e9
      
https://github.com/qemu/qemu/commit/5b053a4a28278bca606eeff7d1c0730df1b047e9
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c
    M target-arm/translate.c
    M target-cris/translate.c
    M target-i386/translate.c
    M target-m68k/translate.c
    M target-s390x/translate.c
    M tcg/tcg-op.h

  Log Message:
  -----------
  tcg: Clean up direct block chaining safety checks

We don't take care of direct jumps when address mapping changes. Thus we
must be sure to generate direct jumps so that they always keep valid
even if address mapping changes. Luckily, we can only allow to execute a
TB if it was generated from the pages which match with current mapping.

Document tcg_gen_goto_tb() declaration and note the reason for
destination PC limitations.

Some targets with variable length instructions allow TB to straddle a
page boundary. However, we make sure that both of TB pages match the
current address mapping when looking up TBs. So it is safe to do direct
jumps into the both pages. Correct the checks for some of those targets.

Given that, we can safely patch a TB which spans two pages. Remove the
unnecessary check in cpu_exec() and allow such TBs to be patched.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 90aa39a1cc4837360889f0e033ca25cc82100308
      
https://github.com/qemu/qemu/commit/90aa39a1cc4837360889f0e033ca25cc82100308
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M target-alpha/translate.c
    M target-arm/translate-a64.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-moxie/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-tricore/translate.c
    M target-unicore32/translate.c
    M target-xtensa/translate.c
    M tcg/tcg-op.h

  Log Message:
  -----------
  tcg: Allow goto_tb to any target PC in user mode

In user mode, there's only a static address translation, TBs are always
invalidated properly and direct jumps are reset when mapping change.
Thus the destination address is always valid for direct jumps and
there's no need to restrict it to the pages the TB resides in.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Cc: Riku Voipio <address@hidden>
Cc: Blue Swirl <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 6fad459c91e8a1dedbb6681d3f57ede5222a225c
      
https://github.com/qemu/qemu/commit/6fad459c91e8a1dedbb6681d3f57ede5222a225c
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  tcg: code_bitmap and code_write_count are not used by user-mode emulation

Signed-off-by: Paolo Bonzini <address@hidden>
[Sergey Fedorov: eliminate the field entirely in user-mode]
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson  <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
[rth: merged followup fixup]
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 1279f323d67b482f942c411d8a705fa9cf36e372
      
https://github.com/qemu/qemu/commit/1279f323d67b482f942c411d8a705fa9cf36e372
  Author: Alex Bennée <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  tcg: reorganize tb_find_physical loop

Put some comments and improve code structure. This should help reading
the code.

Signed-off-by: Alex Bennée <address@hidden>
[Sergey Fedorov: provide commit message; bring back resetting of
tb_invalidated_flag]
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson  <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 7687bf52e5dc39215cde723bb2afb7c53b8bd842
      
https://github.com/qemu/qemu/commit/7687bf52e5dc39215cde723bb2afb7c53b8bd842
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: elide more icount code if CONFIG_USER_ONLY

Signed-off-by: Paolo Bonzini <address@hidden>
[Alex Bennée: #ifndef replay code to match elided functions]
Signed-off-by: Alex Bennée <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 819af24b9c1e95e6576f1cefd32f4d6bf56dfa56
      
https://github.com/qemu/qemu/commit/819af24b9c1e95e6576f1cefd32f4d6bf56dfa56
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c
    M tcg/tcg.h
    M tci.c
    M trace-events

  Log Message:
  -----------
  tcg: Clean up from 'next_tb'

The value returned from tcg_qemu_tb_exec() is the value passed to the
corresponding tcg_gen_exit_tb() at translation time of the last TB
attempted to execute. It is a little confusing to store it in a variable
named 'next_tb'. In fact, it is a combination of 4-byte aligned pointer
and additional information in its two least significant bits. Break it
down right away into two variables named 'last_tb' and 'tb_exit' which
are a pointer to the last TB attempted to execute and the TB exit
reason, correspondingly. This simplifies the code and improves its
readability.

Correct a misleading documentation comment for tcg_qemu_tb_exec() and
fix logging in cpu_tb_exec(). Also rename a misleading 'next_tb' in
another couple of places.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 6f789be56d3f38e9214dafcfab3bf9be7191f370
      
https://github.com/qemu/qemu/commit/6f789be56d3f38e9214dafcfab3bf9be7191f370
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

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

  Log Message:
  -----------
  tcg: Rework tb_invalidated_flag

'tb_invalidated_flag' was meant to catch two events:
 * some TB has been invalidated by tb_phys_invalidate();
 * the whole translation buffer has been flushed by tb_flush().

Then it was checked:
 * in cpu_exec() to ensure that the last executed TB can be safely
   linked to directly call the next one;
 * in cpu_exec_nocache() to decide if the original TB should be provided
   for further possible invalidation along with the temporarily
   generated TB.

It is always safe to patch an invalidated TB since it is not going to be
used anyway. It is also safe to call tb_phys_invalidate() for an already
invalidated TB. Thus, setting this flag in tb_phys_invalidate() is
simply unnecessary. Moreover, it can prevent from pretty proper linking
of TBs, if any arbitrary TB has been invalidated. So just don't touch it
in tb_phys_invalidate().

If this flag is only used to catch whether tb_flush() has been called
then rename it to 'tb_flushed'. Declare it as 'bool' and stick to using
only 'true' and 'false' to set its value. Also, instead of setting it in
tb_gen_code(), just after tb_flush() has been called, do it right inside
of tb_flush().

In cpu_exec(), this flag is used to track if tb_flush() has been called
and have made 'next_tb' (a reference to the last executed TB) invalid
for linking it to directly call the next TB. tb_flush() can be called
during the CPU execution loop from tb_gen_code(), during TB execution or
by another thread while 'tb_lock' is released. Catch for translation
buffer flush reliably by resetting this flag once before first TB lookup
and each time we find it set before trying to add a direct jump. Don't
touch in in tb_find_physical().

Each vCPU has its own execution loop in multithreaded mode and thus
should have its own copy of the flag to be able to reset it with its own
'next_tb' and don't affect any other vCPU execution thread. So make this
flag per-vCPU and move it to CPUState.

In cpu_exec_nocache(), we only need to check if tb_flush() has been
called from tb_gen_code() called by cpu_exec_nocache() itself. To do
this reliably, preserve the old value of the flag, reset it before
calling tb_gen_code(), check afterwards, and combine the saved value
back to the flag.

This patch is based on the patch "tcg: move tb_invalidated_flag to
CPUState" from Paolo Bonzini <address@hidden>.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: a0522c7a55cc8ac76d82884cf8e52f76daa664cc
      
https://github.com/qemu/qemu/commit/a0522c7a55cc8ac76d82884cf8e52f76daa664cc
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Move TB chaining into tb_find_fast()

Move tb_add_jump() call and surrounding code from cpu_exec() into
tb_find_fast(). That simplifies cpu_exec() a little by hiding the direct
chaining optimization details into tb_find_fast(). It also allows to
move tb_lock()/tb_unlock() pair into tb_find_fast(), putting it closer
to tb_find_slow() which also manipulates the lock.

Suggested-by: Alex Bennée <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
[rth: Fixed rebase typo in nochain test.]


  Commit: 3213525f8ab48742db09dab18cb9ae6f36a6c921
      
https://github.com/qemu/qemu/commit/3213525f8ab48742db09dab18cb9ae6f36a6c921
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec-common.c
    M cpu-exec.c
    M cputlb.c
    M hw/i386/kvmvapic.c
    M include/qom/cpu.h
    M qom/cpu.c
    M translate-all.c

  Log Message:
  -----------
  tcg: Remove needless CPUState::current_tb

This field was used for telling cpu_interrupt() to unlink a chain of TBs
being executed when it worked that way. Now, cpu_interrupt() don't do
this anymore. So we don't need this field anymore.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: c6f0d9f84c43ae973270df1a77482466558ee487
      
https://github.com/qemu/qemu/commit/c6f0d9f84c43ae973270df1a77482466558ee487
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Remove relic orphaned comment

This comment should have been deleted by commit 0ac087f1f3ae ("removed
unused code") but somehow it is still here. There's no point to keep it.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 8b2d34e997371c9729a0f41e3cc624d4300bbe78
      
https://github.com/qemu/qemu/commit/8b2d34e997371c9729a0f41e3cc624d4300bbe78
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Move halt handling out of cpu_exec()

Simplify cpu_exec() by extracting CPU halt state handling code out of
cpu_exec() into a new static inline function cpu_handle_halt().

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: ea284766ec6b9f1712369249566b4c372f3cec8b
      
https://github.com/qemu/qemu/commit/ea284766ec6b9f1712369249566b4c372f3cec8b
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Move exception handling out of cpu_exec()

Simplify cpu_exec() by extracting exception handling code out of
cpu_exec() into a new static inline function cpu_handle_exception().
Also make cpu_handle_debug_exception() inline as it is used only once.

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: c385e6e49763c6dd5dbbd90fadde95d986f8bd38
      
https://github.com/qemu/qemu/commit/c385e6e49763c6dd5dbbd90fadde95d986f8bd38
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Move interrupt handling out of cpu_exec()

Simplify cpu_exec() by extracting interrupt handling code outside of
cpu_exec() into a new static inline function cpu_handle_interrupt().

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson  <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 928de9ee14b0b63ee9f9275732ed3e1c8b5f4790
      
https://github.com/qemu/qemu/commit/928de9ee14b0b63ee9f9275732ed3e1c8b5f4790
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Move TB execution stuff out of cpu_exec()

Simplify cpu_exec() by extracting TB execution code outside of
cpu_exec() into a new static inline function cpu_loop_exec_tb().

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: ba048a4ae15ba0f70c6dcb12ee05db120408de78
      
https://github.com/qemu/qemu/commit/ba048a4ae15ba0f70c6dcb12ee05db120408de78
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec()

Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 8b1fe3f439eaa2f0a6ee7737942bb6c405725867
      
https://github.com/qemu/qemu/commit/8b1fe3f439eaa2f0a6ee7737942bb6c405725867
  Author: Sergey Fedorov <address@hidden>
  Date:   2016-05-12 (Thu, 12 May 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()

Suggested-by: Richard Henderson <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 20c20318f9fb0e64c41202c4cd66a7c599cfeecb
      
https://github.com/qemu/qemu/commit/20c20318f9fb0e64c41202c4cd66a7c599cfeecb
  Author: Peter Maydell <address@hidden>
  Date:   2016-05-13 (Fri, 13 May 2016)

  Changed paths:
    M cpu-exec-common.c
    M cpu-exec.c
    M cputlb.c
    M exec.c
    M hw/i386/kvmvapic.c
    M include/exec/exec-all.h
    M include/qemu/osdep.h
    M include/qom/cpu.h
    M qom/cpu.c
    M target-alpha/cpu.h
    M target-alpha/translate.c
    M target-arm/cpu.h
    M target-arm/translate-a64.c
    M target-arm/translate.c
    M target-cris/cpu.h
    M target-cris/translate.c
    M target-i386/cpu.h
    M target-i386/translate.c
    M target-lm32/cpu.h
    M target-lm32/translate.c
    M target-m68k/cpu.h
    M target-m68k/translate.c
    M target-microblaze/cpu.h
    M target-microblaze/translate.c
    M target-mips/cpu.h
    M target-mips/translate.c
    M target-moxie/cpu.h
    M target-moxie/translate.c
    M target-openrisc/cpu.h
    M target-openrisc/translate.c
    M target-ppc/cpu.h
    M target-ppc/translate.c
    M target-s390x/cpu.h
    M target-s390x/translate.c
    M target-sh4/cpu.h
    M target-sh4/translate.c
    M target-sparc/cpu.h
    M target-sparc/translate.c
    M target-tilegx/cpu.h
    M target-tricore/cpu.h
    M target-tricore/translate.c
    M target-unicore32/cpu.h
    M target-unicore32/translate.c
    M target-xtensa/cpu.h
    M target-xtensa/translate.c
    M tcg/aarch64/tcg-target.inc.c
    M tcg/arm/tcg-target.inc.c
    M tcg/i386/tcg-target.inc.c
    M tcg/ia64/tcg-target.inc.c
    M tcg/mips/tcg-target.inc.c
    M tcg/ppc/tcg-target.inc.c
    M tcg/s390/tcg-target.inc.c
    M tcg/sparc/tcg-target.inc.c
    M tcg/tcg-op.h
    M tcg/tcg.h
    M tcg/tci/tcg-target.inc.c
    M tci.c
    M trace-events
    M translate-all.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20160512' into staging

queued 2.7 patches

# gpg: Signature made Fri 13 May 2016 01:08:20 BST using RSA key ID 4DD0279B
# gpg: Good signature from "Richard Henderson <address@hidden>"
# gpg:                 aka "Richard Henderson <address@hidden>"
# gpg:                 aka "Richard Henderson <address@hidden>"

* remotes/rth/tags/pull-tcg-20160512: (39 commits)
  cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
  cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec()
  cpu-exec: Move TB execution stuff out of cpu_exec()
  cpu-exec: Move interrupt handling out of cpu_exec()
  cpu-exec: Move exception handling out of cpu_exec()
  cpu-exec: Move halt handling out of cpu_exec()
  cpu-exec: Remove relic orphaned comment
  tcg: Remove needless CPUState::current_tb
  cpu-exec: Move TB chaining into tb_find_fast()
  tcg: Rework tb_invalidated_flag
  tcg: Clean up from 'next_tb'
  cpu-exec: elide more icount code if CONFIG_USER_ONLY
  tcg: reorganize tb_find_physical loop
  tcg: code_bitmap and code_write_count are not used by user-mode emulation
  tcg: Allow goto_tb to any target PC in user mode
  tcg: Clean up direct block chaining safety checks
  tcg: Clean up tb_jmp_unlink()
  tcg: Extract removing of jumps to TB from tb_phys_invalidate()
  tcg: Rename tb_jmp_remove() to tb_remove_from_jmp_list()
  tcg: Clarify thread safety check in tb_add_jump()
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/f68419eee9a9...20c20318f9fb

reply via email to

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