1. 04 7月, 2018 4 次提交
    • M
      qapi: Polish command flags documentation in qapi-code-gen.txt · 153d73f3
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180703085358.13941-33-armbru@redhat.com>
      153d73f3
    • M
      qmp: Redo how the client requests out-of-band execution · 00ecec15
      Markus Armbruster 提交于
      Commit cf869d53 "qmp: support out-of-band (oob) execution" added a
      general mechanism for command-independent arguments just for an
      out-of-band flag:
      
          The "control" key is introduced to store this extra flag.  "control"
          field is used to store arguments that are shared by all the commands,
          rather than command specific arguments.  Let "run-oob" be the first.
      
      However, it failed to reject unknown members of "control".  For
      instance, in QMP command
      
          {"execute": "query-name", "id": 42, "control": {"crap": true}}
      
      "crap" gets silently ignored.
      
      Instead of fixing this, revert the general "control" mechanism
      (because YAGNI), and do it the way I initially proposed, with key
      "exec-oob".  Simpler code, simpler interface.
      
      An out-of-band command
      
          {"execute": "migrate-pause", "id": 42, "control": {"run-oob": true}}
      
      becomes
      
          {"exec-oob": "migrate-pause", "id": 42}
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180703085358.13941-13-armbru@redhat.com>
      [Commit message typo fixed]
      00ecec15
    • M
      qmp: Make "id" optional again even in "oob" monitors · 80cd93bd
      Markus Armbruster 提交于
      Commit cf869d53 "qmp: support out-of-band (oob) execution" made
      "id" mandatory for all commands when the client accepted capability
      "oob".  This is rather onerous when you play with QMP by hand, and
      unnecessarily so: only out-of-band commands need an ID for reliable
      matching of response to command.
      
      Revert that part of commit cf869d53 for now, but have documentation
      advise on the need to use "id" with out-of-band commands.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180703085358.13941-8-armbru@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      80cd93bd
    • M
      docs/interop/qmp: Improve OOB documentation · 71696cc6
      Markus Armbruster 提交于
      OOB documentation is spread over qmp-spec.txt sections 2.2.1
      Capabilities and 2.3 Issuing Commands.  The amount of detail is a bit
      distracting there.  Move the meat of the matter to new section 2.3.1
      Out of band execution.
      
      Throw in a few other improvements while there:
      
      * 2.2 Server Greeting: Drop advice to search entire capabilities
        array; should be obvious.
      
      * 3. QMP Examples
      
        - 3.1 Server Greeting: Update greeting to the one we expect for the
          release.  Now shows capability "oob".  Update qmp-intro.txt
          likewise.
      
        - 3.2 Capabilities negotiation: Show client accepting capability
          "oob".
      
        - 3.7 Out-of-band execution: New.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180703085358.13941-4-armbru@redhat.com>
      [Whitespace tidied up]
      71696cc6
  2. 03 7月, 2018 1 次提交
  3. 30 6月, 2018 1 次提交
  4. 29 6月, 2018 1 次提交
  5. 27 6月, 2018 1 次提交
  6. 22 6月, 2018 1 次提交
    • A
      qapi: allow empty branches in flat unions · 800877bb
      Anton Nefedov 提交于
      It often happens that just a few discriminator values imply extra data in
      a flat union. Existing checks did not make possible to leave other values
      uncovered. Such cases had to be worked around by either stating a dummy
      (empty) type or introducing another (subset) discriminator enumeration.
      
      Both options create redundant entities in qapi files for little profit.
      
      With this patch it is not necessary anymore to add designated union
      fields for every possible value of a discriminator enumeration.
      Signed-off-by: NAnton Nefedov <anton.nefedov@virtuozzo.com>
      Message-Id: <1529311206-76847-2-git-send-email-anton.nefedov@virtuozzo.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      800877bb
  7. 21 6月, 2018 1 次提交
  8. 16 6月, 2018 5 次提交
    • C
      Add functional/acceptance tests infrastructure · c3d7e8c9
      Cleber Rosa 提交于
      This patch adds the very minimum infrastructure necessary for writing
      and running functional/acceptance tests, including:
      
       * Documentation
       * The avocado_qemu.Test base test class
       * One example tests (version.py)
      
      Additional functionality is expected to be added along the tests that
      require them.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      Message-Id: <20180530184156.15634-2-crosa@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      [ehabkost: fix typo on testing.rst]
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      c3d7e8c9
    • E
      tcg: remove tb_lock · 0ac20318
      Emilio G. Cota 提交于
      Use mmap_lock in user-mode to protect TCG state and the page descriptors.
      In !user-mode, each vCPU has its own TCG state, so no locks needed.
      Per-page locks are used to protect the page descriptors.
      
      Per-TB locks are used in both modes to protect TB jumps.
      
      Some notes:
      
      - tb_lock is removed from notdirty_mem_write by passing a
        locked page_collection to tb_invalidate_phys_page_fast.
      
      - tcg_tb_lookup/remove/insert/etc have their own internal lock(s),
        so there is no need to further serialize access to them.
      
      - do_tb_flush is run in a safe async context, meaning no other
        vCPU threads are running. Therefore acquiring mmap_lock there
        is just to please tools such as thread sanitizer.
      
      - Not visible in the diff, but tb_invalidate_phys_page already
        has an assert_memory_lock.
      
      - cpu_io_recompile is !user-only, so no mmap_lock there.
      
      - Added mmap_unlock()'s before all siglongjmp's that could
        be called in user-mode while mmap_lock is held.
        + Added an assert for !have_mmap_lock() after returning from
          the longjmp in cpu_exec, just like we do in cpu_exec_step_atomic.
      
      Performance numbers before/after:
      
      Host: AMD Opteron(tm) Processor 6376
      
                       ubuntu 17.04 ppc64 bootup+shutdown time
      
        700 +-+--+----+------+------------+-----------+------------*--+-+
            |    +    +      +            +           +           *B    |
            |         before ***B***                            ** *    |
            |tb lock removal ###D###                         ***        |
        600 +-+                                           ***         +-+
            |                                           **         #    |
            |                                        *B*          #D    |
            |                                     *** *         ##      |
        500 +-+                                ***           ###      +-+
            |                             * ***           ###           |
            |                            *B*          # ##              |
            |                          ** *          #D#                |
        400 +-+                      **            ##                 +-+
            |                      **           ###                     |
            |                    **           ##                        |
            |                  **         # ##                          |
        300 +-+  *           B*          #D#                          +-+
            |    B         ***        ###                               |
            |    *       **       ####                                  |
            |     *   ***      ###                                      |
        200 +-+   B  *B     #D#                                       +-+
            |     #B* *   ## #                                          |
            |     #*    ##                                              |
            |    + D##D#     +            +           +            +    |
        100 +-+--+----+------+------------+-----------+------------+--+-+
                 1    8      16      Guest CPUs       48           64
        png: https://imgur.com/HwmBHXe
      
                    debian jessie aarch64 bootup+shutdown time
      
        90 +-+--+-----+-----+------------+------------+------------+--+-+
           |    +     +     +            +            +            +    |
           |         before ***B***                                B    |
        80 +tb lock removal ###D###                              **D  +-+
           |                                                   **###    |
           |                                                 **##       |
        70 +-+                                             ** #       +-+
           |                                             ** ##          |
           |                                           **  #            |
        60 +-+                                       *B  ##           +-+
           |                                       **  ##               |
           |                                    ***  #D                 |
        50 +-+                               ***   ##                 +-+
           |                             * **   ###                     |
           |                           **B*  ###                        |
        40 +-+                     ****  # ##                         +-+
           |                   ****     #D#                             |
           |             ***B**      ###                                |
        30 +-+    B***B**        ####                                 +-+
           |    B *   *     # ###                                       |
           |     B       ###D#                                          |
        20 +-+   D  ##D##                                             +-+
           |      D#                                                    |
           |    +     +     +            +            +            +    |
        10 +-+--+-----+-----+------------+------------+------------+--+-+
                1     8     16      Guest CPUs        48           64
        png: https://imgur.com/iGpGFtv
      
      The gains are high for 4-8 CPUs. Beyond that point, however, unrelated
      lock contention significantly hurts scalability.
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      0ac20318
    • E
      translate-all: protect TB jumps with a per-destination-TB lock · 194125e3
      Emilio G. Cota 提交于
      This applies to both user-mode and !user-mode emulation.
      
      Instead of relying on a global lock, protect the list of incoming
      jumps with tb->jmp_lock. This lock also protects tb->cflags,
      so update all tb->cflags readers outside tb->jmp_lock to use
      atomic reads via tb_cflags().
      
      In order to find the destination TB (and therefore its jmp_lock)
      from the origin TB, we introduce tb->jmp_dest[].
      
      I considered not using a linked list of jumps, which simplifies
      code and makes the struct smaller. However, it unnecessarily increases
      memory usage, which results in a performance decrease. See for
      instance these numbers booting+shutting down debian-arm:
                            Time (s)  Rel. err (%)  Abs. err (s)  Rel. slowdown (%)
      ------------------------------------------------------------------------------
       before                  20.88          0.74      0.154512                 0.
       after                   20.81          0.38      0.079078        -0.33524904
       GTree                   21.02          0.28      0.058856         0.67049808
       GHashTable + xxhash     21.63          1.08      0.233604          3.5919540
      
      Using a hash table or a binary tree to keep track of the jumps
      doesn't really pay off, not only due to the increased memory usage,
      but also because most TBs have only 0 or 1 jumps to them. The maximum
      number of jumps when booting debian-arm that I measured is 35, but
      as we can see in the histogram below a TB with that many incoming jumps
      is extremely rare; the average TB has 0.80 incoming jumps.
      
      n_jumps: 379208; avg jumps/tb: 0.801099
      dist: [0.0,1.0)|▄█▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁ ▁▁▁  ▁▁▁     ▁|[34.0,35.0]
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      194125e3
    • E
      translate-all: discard TB when tb_link_page returns an existing matching TB · 95590e24
      Emilio G. Cota 提交于
      Use the recently-gained QHT feature of returning the matching TB if it
      already exists. This allows us to get rid of the lookup we perform
      right after acquiring tb_lock.
      Suggested-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      95590e24
    • E
      translate-all: make l1_map lockless · 78722ed0
      Emilio G. Cota 提交于
      Groundwork for supporting parallel TCG generation.
      
      We never remove entries from the radix tree, so we can use cmpxchg
      to implement lockless insertions.
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      78722ed0
  9. 15 6月, 2018 1 次提交
  10. 12 6月, 2018 2 次提交
  11. 02 6月, 2018 1 次提交
  12. 01 6月, 2018 2 次提交
    • L
      docs/interop: add "firmware.json" · 3a0adfc9
      Laszlo Ersek 提交于
      Add a schema that describes the different uses and properties of virtual
      machine firmware.
      
      Each firmware executable installed on a host system should come with at
      least one JSON file that conforms to this schema. Each file informs the
      management applications about
      - the firmware's properties and one possible use case / feature set,
      - configuration bits that are required to run the firmware binary.
      
      In addition, define rules for management apps for picking the highest
      priority firmware JSON file when multiple such files match the search
      criteria.
      
      Cc: "Daniel P. Berrange" <berrange@redhat.com>
      Cc: David Gibson <dgibson@redhat.com>
      Cc: Eric Blake <eblake@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Kashyap Chamarthy <kchamart@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Thomas Huth <thuth@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Message-Id: <20180509152608.9343-1-lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3a0adfc9
    • P
      memory: get rid of memory_region_init_reservation · 257a7430
      Paolo Bonzini 提交于
      The function has been deprecated for 2.5 years, and there are just a handful
      of users.  Convert them to memory_region_init_io with NULL callbacks,
      and while at it pass the right device as the owner.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      257a7430
  13. 31 5月, 2018 1 次提交
    • I
      qapi: introduce new cmd option "allow-preconfig" · d6fe3d02
      Igor Mammedov 提交于
      New option will be used to allow commands, which are prepared/need
      to run, during preconfig state. Other commands that should be able
      to run in preconfig state, should be amended to not expect machine
      in initialized state or deal with it.
      
      For compatibility reasons, commands that don't use new flag
      'allow-preconfig' explicitly are not permitted to run in
      preconfig state but allowed in all other states like they used
      to be.
      
      Within this patch allow following commands in preconfig state:
         qmp_capabilities
         query-qmp-schema
         query-commands
         query-command-line-options
         query-status
         exit-preconfig
      to allow qmp connection, basic introspection and moving to the next
      state.
      
      PS:
      set-numa-node and query-hotpluggable-cpus will be enabled later in
      a separate patches.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1526057503-39287-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [ehabkost: Changed "since 2.13" to "since 3.0"]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d6fe3d02
  14. 25 5月, 2018 3 次提交
  15. 23 5月, 2018 2 次提交
  16. 16 5月, 2018 1 次提交
  17. 15 5月, 2018 2 次提交
  18. 14 5月, 2018 1 次提交
  19. 04 5月, 2018 1 次提交
  20. 27 4月, 2018 1 次提交
  21. 26 4月, 2018 1 次提交
  22. 09 4月, 2018 1 次提交
  23. 20 3月, 2018 5 次提交