qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e8faee: cpus: make all_vcpus_paused() return


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e8faee: cpus: make all_vcpus_paused() return bool
Date: Mon, 31 Oct 2016 09:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e8faee06f36eefea4df56d8f27f7d0e6cd44d0e8
      
https://github.com/qemu/qemu/commit/e8faee06f36eefea4df56d8f27f7d0e6cd44d0e8
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  cpus: make all_vcpus_paused() return bool

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

Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 955939a2b51f72bea1c200b559ea39985df5a633
      
https://github.com/qemu/qemu/commit/955939a2b51f72bea1c200b559ea39985df5a633
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate_all: DEBUG_FLUSH -> DEBUG_TB_FLUSH

Make the debug define consistent with the others. The flush operation is
all about invalidating TranslationBlocks on flush events.

Also fix up the commenting on the other DEBUG for the benefit of
checkpatch.

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


  Commit: 301e40ed8005306c009978be295ed9a4b725178b
      
https://github.com/qemu/qemu/commit/301e40ed8005306c009978be295ed9a4b725178b
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M bsd-user/mmap.c
    M include/exec/exec-all.h
    M linux-user/mmap.c
    M translate-all.c

  Log Message:
  -----------
  translate-all: add DEBUG_LOCKING asserts

This adds asserts to check the locking on the various translation
engines structures. There are two sets of structures that are protected
by locks.

The first the l1map and PageDesc structures used to track which
translation blocks are associated with which physical addresses. In
user-mode this is covered by the mmap_lock.

The second case are TB context related structures which are protected by
tb_lock which is also user-mode only.

Currently the asserts do nothing in SoftMMU mode but this will change
for MTTCG.

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


  Commit: 4426f83a9ac7bbce48602c712333efc79cd57b29
      
https://github.com/qemu/qemu/commit/4426f83a9ac7bbce48602c712333efc79cd57b29
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpu-exec.c

  Log Message:
  -----------
  cpu-exec: include cpu_index in CPU_LOG_EXEC messages

Even more important when debugging MTTCG is seeing which vCPU is
currently executing.

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


  Commit: 7d7500d99895f888f97397ef32bb536bb0df3b74
      
https://github.com/qemu/qemu/commit/7d7500d99895f888f97397ef32bb536bb0df3b74
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

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

  Log Message:
  -----------
  tcg: comment on which functions have to be called with tb_lock held

softmmu requires more functions to be thread-safe, because translation
blocks can be invalidated from e.g. notdirty callbacks.  Probably the
same holds for user-mode emulation, it's just that no one has ever
tried to produce a coherent locking there.

This patch will guide the introduction of more tb_lock and tb_unlock
calls for system emulation.

Note that after this patch some (most) of the mentioned functions are
still called outside tb_lock/tb_unlock.  The next one will rectify this.

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


  Commit: 98c1076cc9a3ccebd1316fecf65149f6052a24fc
      
https://github.com/qemu/qemu/commit/98c1076cc9a3ccebd1316fecf65149f6052a24fc
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: ensure mmap_lock() held while setting up

Future patches will enforce the holding of mmap_lock() when we are
manipulating internal memory structures. Technically it doesn't matter
in the case of elfload as we haven't started executing yet. However it
is easier to grab the lock when required than special case the
translate-all API.

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


  Commit: e505a063bac780a4ca190aee29df2cc0b767c67a
      
https://github.com/qemu/qemu/commit/e505a063bac780a4ca190aee29df2cc0b767c67a
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all: Add assert_(memory|tb)_lock annotations

This adds calls to the assert_(memory|tb)_lock for all public APIs which
are documented as needing them held for linux-user mode. The asserts are
NOPs for system-mode although these will be converted when MTTCG is
enabled.

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


  Commit: a5e998262fd76fd4b3e537db77bfb8a396bfae69
      
https://github.com/qemu/qemu/commit/a5e998262fd76fd4b3e537db77bfb8a396bfae69
  Author: KONRAD Frederic <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpu-exec.c
    M exec.c
    M hw/i386/kvmvapic.c
    M translate-all.c

  Log Message:
  -----------
  tcg: protect translation related stuff with tb_lock.

This protects all translation related work with tb_lock() too ensure
thread safety. This effectively serialises all code generation. In
addition to the code generation we also take the lock for TB
invalidation. This has a knock on effect of meaning tb_lock() is held
for modification of the SoftMMU TLB by non-self threads which will be
used in later patches.

Signed-off-by: KONRAD Frederic <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
[AJB: moved into tree, clean-up history]
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 548ebcaf361443420a9f3ab0e2118c4d1f0a1b72
      
https://github.com/qemu/qemu/commit/548ebcaf361443420a9f3ab0e2118c4d1f0a1b72
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M target-arm/Makefile.objs
    M target-arm/arm-powerctl.c

  Log Message:
  -----------
  target-arm/arm-powerctl: wake up sleeping CPUs

Testing with Alexander's bare metal syncronisation tests fails in MTTCG
leaving one CPU spinning forever waiting for the second CPU to wake up.
We simply need to kick the vCPU once we have processed the PSCI power on
call.

As the power control API is for system emulation only as is the
qemu_kick_cpu function we also ensure we only build arm-powerctl for
SoftMMU builds.

Tested-by: Alex Bennée <address@hidden>
CC: Alexander Spyridakis <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>

Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1be7fcb8aa930b279ae81bfaf39974c7e5dded80
      
https://github.com/qemu/qemu/commit/1be7fcb8aa930b279ae81bfaf39974c7e5dded80
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  tcg: move tcg_exec_all and helpers above thread fn

This is a pure mechanical change in preparation for up-coming
re-factoring. Instead of a forward declaration for tcg_exec_all it and
the associated helper functions are moved in front of the call from
qemu_tcg_cpu_thread_fn.

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


  Commit: c93bbbefca1795f5afb98ea93b2ada68e53e185b
      
https://github.com/qemu/qemu/commit/c93bbbefca1795f5afb98ea93b2ada68e53e185b
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  tcg: cpus rm tcg_exec_all()

In preparation for multi-threaded TCG we remove tcg_exec_all and move
all the CPU cycling into the main thread function. When MTTCG is enabled
we shall use a separate thread function which only handles one vCPU.

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

Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 12e9700d7a926aeb7f97a5d3c368bbe6745be884
      
https://github.com/qemu/qemu/commit/12e9700d7a926aeb7f97a5d3c368bbe6745be884
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  cpus: re-factor out handle_icount_deadline

In preparation for adding a MTTCG thread we re-factor out a bit of what
will be common code to handle the QEMU_CLOCK_VIRTUAL expiration.

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


  Commit: 14e6fe12a705c065fecdfd2a97199728123d4d9a
      
https://github.com/qemu/qemu/commit/14e6fe12a705c065fecdfd2a97199728123d4d9a
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M cpus-common.c
    M cpus.c
    M hw/i386/kvm/apic.c
    M hw/i386/kvmvapic.c
    M hw/ppc/ppce500_spin.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M include/qom/cpu.h
    M kvm-all.c
    M target-i386/helper.c
    M target-i386/kvm.c
    M target-s390x/cpu.c
    M target-s390x/cpu.h
    M target-s390x/kvm.c
    M target-s390x/misc_helper.c
    M translate-all.c

  Log Message:
  -----------
  *_run_on_cpu: introduce run_on_cpu_data type

This changes the *_run_on_cpu APIs (and helpers) to pass data in a
run_on_cpu_data type instead of a plain void *. This is because we
sometimes want to pass a target address (target_ulong) and this fails on
32 bit hosts emulating 64 bit guests.

Signed-off-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ba051fb5e56d5ff5e4fa672d37954452e58543b2
      
https://github.com/qemu/qemu/commit/ba051fb5e56d5ff5e4fa672d37954452e58543b2
  Author: Alex Bennée <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M exec.c
    M translate-all.c

  Log Message:
  -----------
  tcg: move locking for tb_invalidate_phys_page_range up

In the linux-user case all things that involve ''l1_map' and PageDesc
tweaks are protected by the memory lock (mmpa_lock). For SoftMMU mode
we previously relied on single threaded behaviour, with MTTCG we now use
the tb_lock().

As a result we need to do a little re-factoring  and push the taking of
this lock up the call tree. This requires a slightly different entry for
the SoftMMU and user-mode cases from tb_invalidate_phys_range.

This also means user-mode breakpoint insertion needs to take two locks
but it hadn't taken any previously so this is an improvement.

Signed-off-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 6bc56d317f7b5004ea2d89d264bddc8b4d081700
      
https://github.com/qemu/qemu/commit/6bc56d317f7b5004ea2d89d264bddc8b4d081700
  Author: Peter Maydell <address@hidden>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M bsd-user/mmap.c
    M cpu-exec.c
    M cpus-common.c
    M cpus.c
    M exec.c
    M hw/i386/kvm/apic.c
    M hw/i386/kvmvapic.c
    M hw/ppc/ppce500_spin.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M include/exec/exec-all.h
    M include/qom/cpu.h
    M kvm-all.c
    M linux-user/elfload.c
    M linux-user/mmap.c
    M target-arm/Makefile.objs
    M target-arm/arm-powerctl.c
    M target-i386/helper.c
    M target-i386/kvm.c
    M target-s390x/cpu.c
    M target-s390x/cpu.h
    M target-s390x/kvm.c
    M target-s390x/misc_helper.c
    M tcg/tcg.h
    M translate-all.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-mttcg' into 
staging

Base patches for MTTCG enablement.

# gpg: Signature made Mon 31 Oct 2016 14:01:41 GMT
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <address@hidden>"
# gpg:                 aka "Paolo Bonzini <address@hidden>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream-mttcg:
  tcg: move locking for tb_invalidate_phys_page_range up
  *_run_on_cpu: introduce run_on_cpu_data type
  cpus: re-factor out handle_icount_deadline
  tcg: cpus rm tcg_exec_all()
  tcg: move tcg_exec_all and helpers above thread fn
  target-arm/arm-powerctl: wake up sleeping CPUs
  tcg: protect translation related stuff with tb_lock.
  translate-all: Add assert_(memory|tb)_lock annotations
  linux-user/elfload: ensure mmap_lock() held while setting up
  tcg: comment on which functions have to be called with tb_lock held
  cpu-exec: include cpu_index in CPU_LOG_EXEC messages
  translate-all: add DEBUG_LOCKING asserts
  translate_all: DEBUG_FLUSH -> DEBUG_TB_FLUSH
  cpus: make all_vcpus_paused() return bool

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


Compare: https://github.com/qemu/qemu/compare/0bb1137930f5...6bc56d317f7b

reply via email to

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