1. 18 12月, 2018 1 次提交
  2. 14 12月, 2018 6 次提交
  3. 07 11月, 2018 1 次提交
    • M
      memory: learn about non-volatile memory region · c26763f8
      Marc-André Lureau 提交于
      Add a new flag to mark memory region that are used as non-volatile, by
      NVDIMM for example. That bit is propagated down to the flat view, and
      reflected in HMP info mtree with a "nv-" prefix on the memory type.
      
      This way, guest_phys_blocks_region_add() can skip the NV memory
      regions for dumps and TCG memory clear in a following patch.
      
      Cc: dgilbert@redhat.com
      Cc: imammedo@redhat.com
      Cc: pbonzini@redhat.com
      Cc: guangrong.xiao@linux.intel.com
      Cc: mst@redhat.com
      Cc: xiaoguangrong.eric@gmail.com
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20181003114454.5662-2-marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c26763f8
  4. 31 10月, 2018 1 次提交
  5. 26 10月, 2018 1 次提交
    • C
      docs/devel/testing.rst: add missing newlines after code block · 92970812
      Cleber Rosa 提交于
      The line immediate following a ".. code::" block is considered
      to contains arguments to the "code directive".  The lack of a
      new line gives me during at parse time:
      
         testing.rst:63: (ERROR/3) Error in "code" directive:
         maximum 1 argument(s) allowed, 3 supplied.
      
         .. code::
           make check-unit V=1
      
         testing.rst:120: (ERROR/3) Error in "code" directive:
         maximum 1 argument(s) allowed, 3 supplied.
      
         .. code::
           make check-qtest V=1
      
      Let's add the missing newlines, both for consistency and to
      avoid the parsing errors.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-Id: <20181004161852.11673-6-crosa@redhat.com>
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      92970812
  6. 17 10月, 2018 1 次提交
  7. 03 10月, 2018 2 次提交
  8. 29 8月, 2018 3 次提交
    • E
      qapi: Add comments to aid debugging generated introspection · 8c643361
      Eric Blake 提交于
      We consciously chose in commit 1a9a507b to hide QAPI type names
      from the introspection output on the wire, but added a command
      line option -u to unmask the type name when doing a debug build.
      The unmask option still remains useful to some other forms of
      automated analysis, so it will not be removed; however, when it
      is not in use, the generated .c file can be hard to read.  At
      the time when we first introduced masking, the generated file
      consisted only of a monolithic C string, so there was no clean
      way to inject any comments.
      
      Later, in commit 7d0f982b, we switched the generation to output
      a QLit object, in part to make it easier for future addition of
      conditional compilation.  In fact, commit d626b6c1 took advantage
      of this by passing a tuple instead of a bare object for encoding
      the output of conditionals.  By extending that tuple, we can now
      interject strategic comments.
      
      For now, type name debug aid comments are only output once per
      meta-type, rather than at all uses of the number used to encode
      the type within the introspection data.  But this is still a lot
      more convenient than having to regenerate the file with the
      unmask operation temporarily turned on - merely search the
      generated file for '"NNN" =' to learn the corresponding source
      name and associated definition of type NNN.
      
      The generated qapi-introspect.c changes only with the addition
      of comments, such as:
      
      | @@ -14755,6 +15240,7 @@
      |          { "name", QLIT_QSTR("[485]"), },
      |          {}
      |      })),
      | +    /* "485" = QCryptoBlockInfoLUKSSlot */
      |      QLIT_QDICT(((QLitDictEntry[]) {
      |          { "members", QLIT_QLIST(((QLitObject[]) {
      |              QLIT_QDICT(((QLitDictEntry[]) {
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180827213943.33524-3-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Rebased, update to qapi-code-gen.txt corrected]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      8c643361
    • M
      qapi: Update docs for generator changes since commit 9ee86b85 · 913b5e28
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180828120736.32323-3-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      913b5e28
    • P
      qapi: Drop qapi_event_send_FOO()'s Error ** argument · 3ab72385
      Peter Xu 提交于
      The generated qapi_event_send_FOO() take an Error ** argument.  They
      can't actually fail, because all they do with the argument is passing it
      to functions that can't fail: the QObject output visitor, and the
      @qmp_emit callback, which is either monitor_qapi_event_queue() or
      event_test_emit().
      
      Drop the argument, and pass &error_abort to the QObject output visitor
      and @qmp_emit instead.
      Suggested-by: NEric Blake <eblake@redhat.com>
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180815133747.25032-4-peterx@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Commit message rewritten, update to qapi-code-gen.txt corrected]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3ab72385
  9. 22 8月, 2018 1 次提交
  10. 15 8月, 2018 1 次提交
  11. 30 7月, 2018 1 次提交
  12. 19 7月, 2018 1 次提交
  13. 13 7月, 2018 1 次提交
  14. 05 7月, 2018 3 次提交
  15. 04 7月, 2018 3 次提交
  16. 03 7月, 2018 1 次提交
  17. 30 6月, 2018 1 次提交
  18. 27 6月, 2018 1 次提交
  19. 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
  20. 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
  21. 15 6月, 2018 1 次提交
  22. 01 6月, 2018 1 次提交
  23. 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
  24. 16 5月, 2018 1 次提交