mbox

[PULL,v2.5,00/19] tcg queued patches

Message ID 20180621143715.27176-1-richard.henderson@linaro.org
State New
Headers show

Pull-request

https://github.com/rth7680/qemu.git tags/pull-tcg-20180615

Message

Richard Henderson June 21, 2018, 2:37 p.m. UTC
Re-issuing the v2 pull request with the proper form.


r~


The following changes since commit 42747d6abb5035473e5585fa17620c1e8983a70b:

  Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2018-06-15.for-upstream' into staging (2018-06-15 17:28:37 +0100)

are available in the Git repository at:

  https://github.com/rth7680/qemu.git tags/pull-tcg-20180615

for you to fetch changes up to 9f754620651d3432114f4bb89c7f12cbea814b3e:

  tcg: Reduce max TB opcode count (2018-06-15 09:39:53 -1000)

----------------------------------------------------------------
TCG patch queue:

Workaround macos assembler lossage.
Eliminate tb_lock.
Fix TB code generation overflow.

----------------------------------------------------------------
Emilio G. Cota (17):
      qht: require a default comparison function
      qht: return existing entry when qht_insert fails
      tcg: track TBs with per-region BST's
      tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx
      translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB
      translate-all: make l1_map lockless
      translate-all: remove hole in PageDesc
      translate-all: work page-by-page in tb_invalidate_phys_range_1
      translate-all: move tb_invalidate_phys_page_range up in the file
      translate-all: use per-page locking in !user-mode
      translate-all: add page_locked assertions
      translate-all: introduce assert_no_pages_locked
      translate-all: discard TB when tb_link_page returns an existing matching TB
      translate-all: protect TB jumps with a per-destination-TB lock
      cputlb: remove tb_lock from tlb_flush functions
      translate-all: remove tb_lock mention from cpu_restore_state_from_tb
      tcg: remove tb_lock

John Arbuckle (1):
      tcg/i386: Use byte form of xgetbv instruction

Richard Henderson (1):
      tcg: Reduce max TB opcode count

 accel/tcg/translate-all.h       |    6 +-
 include/exec/cpu-common.h       |    2 +-
 include/exec/exec-all.h         |   51 +-
 include/exec/memory-internal.h  |    6 +-
 include/exec/tb-context.h       |    4 -
 include/qemu/qht.h              |   32 +-
 tcg/tcg.h                       |   19 +-
 accel/tcg/cpu-exec.c            |   96 ++--
 accel/tcg/cputlb.c              |    8 -
 accel/tcg/translate-all.c       | 1045 +++++++++++++++++++++++++++------------
 exec.c                          |   26 +-
 linux-user/main.c               |    3 -
 tcg/aarch64/tcg-target.inc.c    |    2 +-
 tcg/arm/tcg-target.inc.c        |    2 +-
 tcg/i386/tcg-target.inc.c       |    7 +-
 tcg/mips/tcg-target.inc.c       |    2 +-
 tcg/ppc/tcg-target.inc.c        |    4 +-
 tcg/s390/tcg-target.inc.c       |    2 +-
 tcg/sparc/tcg-target.inc.c      |    4 +-
 tcg/tcg.c                       |  218 +++++++-
 tcg/tci/tcg-target.inc.c        |    2 +-
 tests/qht-bench.c               |   18 +-
 tests/test-qht.c                |   23 +-
 util/qht.c                      |   41 +-
 docs/devel/multi-thread-tcg.txt |   24 +-
 25 files changed, 1157 insertions(+), 490 deletions(-)

Comments

Peter Maydell June 22, 2018, 8:58 a.m. UTC | #1
On 21 June 2018 at 15:37, Richard Henderson
<richard.henderson@linaro.org> wrote:
> Re-issuing the v2 pull request with the proper form.
>
>
> r~
>
>
> The following changes since commit 42747d6abb5035473e5585fa17620c1e8983a70b:
>
>   Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2018-06-15.for-upstream' into staging (2018-06-15 17:28:37 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/rth7680/qemu.git tags/pull-tcg-20180615
>
> for you to fetch changes up to 9f754620651d3432114f4bb89c7f12cbea814b3e:
>
>   tcg: Reduce max TB opcode count (2018-06-15 09:39:53 -1000)
>
> ----------------------------------------------------------------
> TCG patch queue:
>
> Workaround macos assembler lossage.
> Eliminate tb_lock.
> Fix TB code generation overflow.
>
Applied, thanks.

-- PMM
Peter Maydell June 22, 2018, 12:46 p.m. UTC | #2
On 22 June 2018 at 09:58, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 21 June 2018 at 15:37, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>> The following changes since commit 42747d6abb5035473e5585fa17620c1e8983a70b:
>>
>>   Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2018-06-15.for-upstream' into staging (2018-06-15 17:28:37 +0100)
>>
>> are available in the Git repository at:
>>
>>   https://github.com/rth7680/qemu.git tags/pull-tcg-20180615
>>
>> for you to fetch changes up to 9f754620651d3432114f4bb89c7f12cbea814b3e:
>>
>>   tcg: Reduce max TB opcode count (2018-06-15 09:39:53 -1000)
>>
>> ----------------------------------------------------------------
>> TCG patch queue:
>>
>> Workaround macos assembler lossage.
>> Eliminate tb_lock.
>> Fix TB code generation overflow.
>>
> Applied, thanks.

...looks like it's broken builds with --disable-tcg, though.
Travis builds with that config fail:

/home/travis/build/qemu/qemu/accel/stubs/tcg-stub.c:24:6: error: no
previous prototype for "tb_unlock" [-Werror=missing-prototypes]
 void tb_unlock(void)
      ^
cc1: all warnings being treated as errors

(sample failing job log: https://api.travis-ci.org/v3/job/395399220/log.txt)

Should just be a matter of deleting the stub function, I guess.

thanks
-- PMM
Peter Maydell June 22, 2018, 2:40 p.m. UTC | #3
On 22 June 2018 at 13:46, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 22 June 2018 at 09:58, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 21 June 2018 at 15:37, Richard Henderson
>> <richard.henderson@linaro.org> wrote:
>>> The following changes since commit 42747d6abb5035473e5585fa17620c1e8983a70b:
>>>
>>>   Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2018-06-15.for-upstream' into staging (2018-06-15 17:28:37 +0100)
>>>
>>> are available in the Git repository at:
>>>
>>>   https://github.com/rth7680/qemu.git tags/pull-tcg-20180615
>>>
>>> for you to fetch changes up to 9f754620651d3432114f4bb89c7f12cbea814b3e:
>>>
>>>   tcg: Reduce max TB opcode count (2018-06-15 09:39:53 -1000)
>>>
>>> ----------------------------------------------------------------
>>> TCG patch queue:
>>>
>>> Workaround macos assembler lossage.
>>> Eliminate tb_lock.
>>> Fix TB code generation overflow.
>>>
>> Applied, thanks.
>
> ...looks like it's broken builds with --disable-tcg, though.
> Travis builds with that config fail:
>
> /home/travis/build/qemu/qemu/accel/stubs/tcg-stub.c:24:6: error: no
> previous prototype for "tb_unlock" [-Werror=missing-prototypes]
>  void tb_unlock(void)
>       ^
> cc1: all warnings being treated as errors
>
> (sample failing job log: https://api.travis-ci.org/v3/job/395399220/log.txt)
>
> Should just be a matter of deleting the stub function, I guess.

Hmm, not quite that easy. After that the link fails:

  LINK    x86_64-softmmu/qemu-system-x86_64
exec.o: In function `tlb_reset_dirty_range_all':
/home/petmay01/linaro/qemu-from-laptop/qemu/exec.c:1334: undefined
reference to `tlb_reset_dirty'
exec.o: In function `memory_notdirty_write_complete':
/home/petmay01/linaro/qemu-from-laptop/qemu/exec.c:2658: undefined
reference to `page_collection_unlock'
exec.o: In function `tcg_commit':
/home/petmay01/linaro/qemu-from-laptop/qemu/exec.c:3052: undefined
reference to `cpu_reloading_memory_map'
cpus.o: In function `tcg_cpu_exec':
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1362: undefined
reference to `cpu_exec'
cpus.o: In function `qemu_tcg_rr_cpu_thread_fn':
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1401: undefined
reference to `tcg_register_thread'
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1471: undefined
reference to `cpu_exec_step_atomic'
cpus.o: In function `qemu_tcg_cpu_thread_fn':
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1637: undefined
reference to `tcg_register_thread'
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1673: undefined
reference to `cpu_exec_step_atomic'
cpus.o: In function `qemu_tcg_init_vcpu':
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1865: undefined
reference to `tcg_region_init'
/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1875: undefined
reference to `parallel_cpus'

Some of those are probably best handled with stub functions
(eg tcg_register_thread()), but some of them might be better
off handled by guarding functions with #ifndef CONFIG_TCG
or moving them to source files in accel/tcg ?

This is probably best fixed by somebody familiar with the
commits in question...

thanks
-- PMM
Emilio Cota June 22, 2018, 4:23 p.m. UTC | #4
On Fri, Jun 22, 2018 at 15:40:33 +0100, Peter Maydell wrote:
(snip)
> /home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1637: undefined
> reference to `tcg_register_thread'
> /home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1673: undefined
> reference to `cpu_exec_step_atomic'
> cpus.o: In function `qemu_tcg_init_vcpu':
> /home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1865: undefined
> reference to `tcg_region_init'
> /home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1875: undefined
> reference to `parallel_cpus'
> 
> Some of those are probably best handled with stub functions
> (eg tcg_register_thread()), but some of them might be better
> off handled by guarding functions with #ifndef CONFIG_TCG
> or moving them to source files in accel/tcg ?
> 
> This is probably best fixed by somebody familiar with the
> commits in question...

Just sent a patch that fixes the --disable-tcg build for me,
tested for x86_64-softmmu and i386-softmmu targets.

However, I'm puzzled by the fact that I cannot replicate all
of the link errors you report above. My build (tried with gcc
5.4.0 and 8.1.0) completes even though I don't see how
some symbols are resolved (I don't see them in the final
binary), e.g. tcg_register_thread().
Is the compiler somehow determining that it doesn't need those?

Thanks,

		Emilio