Skip to content
Snippets Groups Projects
  1. Jul 30, 2019
  2. Jul 29, 2019
  3. Jul 26, 2019
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190726' into staging · fff31599
      Peter Maydell authored
      
      target-arm queue:
       * Fix broken migration on pl330 device
       * Fix broken migration on stellaris-input device
       * Add type checks to vmstate varry macros to avoid this class of bugs
       * hw/arm/boot: Fix some remaining cases where we would put the
         initrd on top of the kernel image
      
      # gpg: Signature made Fri 26 Jul 2019 16:19:17 BST
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20190726:
        hw/arm/boot: Further improve initrd positioning code
        hw/arm/boot: Rename elf_{low, high}_addr to image_{low, high}_addr
        vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros
        stellaris_input: Fix vmstate description of buttons field
        pl330: fix vmstate description
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      fff31599
    • Peter Maydell's avatar
      hw/arm/boot: Further improve initrd positioning code · 67505c11
      Peter Maydell authored
      
      In commit e6b2b20d we made the boot loader code try to avoid
      putting the initrd on top of the kernel.  However the expression used
      to calculate the start of the initrd:
      
          info->initrd_start = info->loader_start +
              MAX(MIN(info->ram_size / 2, 128 * 1024 * 1024), kernel_size);
      
      incorrectly uses 'kernel_size' as the offset within RAM of the
      highest address to avoid.  This is incorrect because the kernel
      doesn't start at address 0, but slightly higher than that.  This
      means that we can still incorrectly end up overlaying the initrd on
      the kernel in some cases, for example:
      
      * The kernel's image_size is 0x0a7a8000
      * The kernel was loaded at   0x40080000
      * The end of the kernel is   0x4A828000
      * The DTB was loaded at      0x4a800000
      
      To get this right we need to track the actual highest address used
      by the kernel and use that rather than kernel_size. We already
      set image_low_addr and image_high_addr for ELF images; set them
      also for the various other image types we support, and then use
      image_high_addr as the lowest allowed address for the initrd.
      (We don't use image_low_addr, but we set it for consistency
      with the existing code path for ELF files.)
      
      Fixes: e6b2b20d
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
      Message-id: 20190722151804.25467-3-peter.maydell@linaro.org
      67505c11
    • Peter Maydell's avatar
      hw/arm/boot: Rename elf_{low, high}_addr to image_{low, high}_addr · d5fef92f
      Peter Maydell authored
      
      Rename the elf_low_addr and elf_high_addr variables to image_low_addr
      and image_high_addr -- in the next commit we will extend them to
      be set for other kinds of image file and not just ELF files.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
      Message-id: 20190722151804.25467-2-peter.maydell@linaro.org
      d5fef92f
    • Peter Maydell's avatar
      vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros · 0c413ba0
      Peter Maydell authored
      
      The VMSTATE_STRUCT_VARRAY_UINT32 macro is intended to handle
      migrating a field which is an array of structs, but where instead of
      migrating the entire array we only migrate a variable number of
      elements of it.
      
      The VMSTATE_STRUCT_VARRAY_POINTER_UINT32 macro is intended to handle
      migrating a field which is of pointer type, and points to a
      dynamically allocated array of structs of variable size.
      
      We weren't actually checking that the field passed to
      VMSTATE_STRUCT_VARRAY_UINT32 really is an array, with the result that
      accidentally using it where the _POINTER_ macro was intended would
      compile but silently corrupt memory on migration.
      
      Add type-checking that enforces that the field passed in is
      really of the right array type. This applies to all the VMSTATE
      macros which use flags including VMS_VARRAY_* but not VMS_POINTER.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarDamien Hedde <damien.hedde@greensocs.com>
      Tested-by: default avatarDamien Hedde <damien.hedde@greensocs.com>
      Message-id: 20190725163710.11703-3-peter.maydell@linaro.org
      0c413ba0
    • Peter Maydell's avatar
      stellaris_input: Fix vmstate description of buttons field · 372e458e
      Peter Maydell authored
      
      gamepad_state::buttons is a pointer to an array of structs,
      not an array of structs, so should be declared in the vmstate
      with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we
      corrupt memory on incoming migration.
      
      We bump the vmstate version field as the easiest way to
      deal with the migration break, since migration wouldn't have
      worked reliably before anyway.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarDamien Hedde <damien.hedde@greensocs.com>
      Message-id: 20190725163710.11703-2-peter.maydell@linaro.org
      372e458e
    • Damien Hedde's avatar
      pl330: fix vmstate description · 830fc739
      Damien Hedde authored
      
      Fix the pl330 main and queue vmstate description.
      There were missing POINTER flags causing crashes during
      incoming migration because:
      + PL330State chan field is a pointer to an array
      + PL330Queue queue field is a pointer to an array
      
      Also bump corresponding vmsd version numbers.
      
      Signed-off-by: default avatarDamien Hedde <damien.hedde@greensocs.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daude <philmd@redhat.com>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-id: 20190724143553.21557-1-damien.hedde@greensocs.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      830fc739
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190726' into staging · c985266e
      Peter Maydell authored
      
      MAINTAINERS update for vfio-ccw
      
      # gpg: Signature made Fri 26 Jul 2019 12:22:42 BST
      # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
      # gpg:                issuer "cohuck@redhat.com"
      # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
      # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
      # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
      # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
      # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
      # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
      
      * remotes/cohuck/tags/s390x-20190726:
        MAINTAINERS: vfio-ccw: Remove myself as the maintainer
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c985266e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2019-07-25-1' into staging · 9246fade
      Peter Maydell authored
      
      Merge tpm 2019/07/25 v1
      
      # gpg: Signature made Thu 25 Jul 2019 16:40:54 BST
      # gpg:                using RSA key 75AD65802A0B4211
      # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
      
      * remotes/stefanberger/tags/pull-tpm-2019-07-25-1:
        tpm_emulator: Translate TPM error codes to strings
        tpm: Exit in reset when backend indicates failure
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9246fade
  4. Jul 25, 2019
  5. Jul 24, 2019
    • Ivan Ren's avatar
      migration: fix migrate_cancel multifd migration leads destination hung forever · f193bc0c
      Ivan Ren authored
      
      When migrate_cancel a multifd migration, if run sequence like this:
      
              [source]                              [destination]
      
      multifd_send_sync_main[finish]
                                          multifd_recv_thread wait &p->sem_sync
      shutdown to_dst_file
                                          detect error from_src_file
      send  RAM_SAVE_FLAG_EOS[fail]       [no chance to run multifd_recv_sync_main]
                                          multifd_load_cleanup
                                          join multifd receive thread forever
      
      will lead destination qemu hung at following stack:
      
      pthread_join
      qemu_thread_join
      multifd_load_cleanup
      process_incoming_migration_co
      coroutine_trampoline
      
      Signed-off-by: default avatarIvan Ren <ivanren@tencent.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <1561468699-9819-4-git-send-email-ivanren@tencent.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      f193bc0c
    • Juan Quintela's avatar
      migration: Make explicit that we are quitting multifd · 3c3ca25d
      Juan Quintela authored
      
      We add a bool to indicate that.
      
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      3c3ca25d
    • Ivan Ren's avatar
      migration: fix migrate_cancel leads live_migration thread hung forever · a3ec6b7d
      Ivan Ren authored
      
      When we 'migrate_cancel' a multifd migration, live_migration thread may
      hung forever at some points, because of multifd_send_thread has already
      exit for socket error:
      1. multifd_send_pages may hung at qemu_sem_wait(&multifd_send_state->
         channels_ready)
      2. multifd_send_sync_main my hung at qemu_sem_wait(&multifd_send_state->
         sem_sync)
      
      Signed-off-by: default avatarIvan Ren <ivanren@tencent.com>
      Message-Id: <1561468699-9819-3-git-send-email-ivanren@tencent.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      
      ---
      
      Remove spurious not needed bits
      a3ec6b7d
    • Ivan Ren's avatar
      migration: fix migrate_cancel leads live_migration thread endless loop · 713f762a
      Ivan Ren authored
      
      When we 'migrate_cancel' a multifd migration, live_migration thread may
      go into endless loop in multifd_send_pages functions.
      
      Reproduce steps:
      
      (qemu) migrate_set_capability multifd on
      (qemu) migrate -d url
      (qemu) [wait a while]
      (qemu) migrate_cancel
      
      Then may get live_migration 100% cpu usage in following stack:
      
      pthread_mutex_lock
      qemu_mutex_lock_impl
      multifd_send_pages
      multifd_queue_page
      ram_save_multifd_page
      ram_save_target_page
      ram_save_host_page
      ram_find_and_save_block
      ram_find_and_save_block
      ram_save_iterate
      qemu_savevm_state_iterate
      migration_iteration_run
      migration_thread
      qemu_thread_start
      start_thread
      clone
      
      Signed-off-by: default avatarIvan Ren <ivanren@tencent.com>
      Message-Id: <1561468699-9819-2-git-send-email-ivanren@tencent.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      713f762a
    • Marc-André Lureau's avatar
      docs: correct kconfig option · 6baabe5c
      Marc-André Lureau authored
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20190723120804.29565-1-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6baabe5c
    • Jan Kiszka's avatar
      i386/kvm: Do not sync nested state during runtime · bec7156a
      Jan Kiszka authored
      
      Writing the nested state e.g. after a vmport access can invalidate
      important parts of the kernel-internal state, and it is not needed as
      well. So leave this out from KVM_PUT_RUNTIME_STATE.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Message-Id: <bdd53f40-4e60-f3ae-7ec6-162198214953@siemens.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bec7156a
    • Zhengui Li's avatar
      virtio-scsi: fixed virtio_scsi_ctx_check failed when detaching scsi disk · 9c5aad84
      Zhengui Li authored
      
      commit a6f230c8 move blockbackend back to main AioContext on unplug. It set the AioContext of
      SCSIDevice to the main AioContex, but s->ctx is still the iothread AioContex(if the scsi controller
      is configure with iothread). So if there are having in-flight requests during unplug, a failing assertion
      happend. The bt is below:
      (gdb) bt
      #0  0x0000ffff86aacbd0 in raise () from /lib64/libc.so.6
      #1  0x0000ffff86aadf7c in abort () from /lib64/libc.so.6
      #2  0x0000ffff86aa6124 in __assert_fail_base () from /lib64/libc.so.6
      #3  0x0000ffff86aa61a4 in __assert_fail () from /lib64/libc.so.6
      #4  0x0000000000529118 in virtio_scsi_ctx_check (d=<optimized out>, s=<optimized out>, s=<optimized out>) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:246
      #5  0x0000000000529ec4 in virtio_scsi_handle_cmd_req_prepare (s=0x2779ec00, req=0xffff740397d0) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:559
      #6  0x000000000052a228 in virtio_scsi_handle_cmd_vq (s=0x2779ec00, vq=0xffff7c6d7110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:603
      #7  0x000000000052afa8 in virtio_scsi_data_plane_handle_cmd (vdev=<optimized out>, vq=0xffff7c6d7110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi-dataplane.c:59
      #8  0x000000000054d94c in virtio_queue_host_notifier_aio_poll (opaque=<optimized out>) at /home/qemu-4.0.0/hw/virtio/virtio.c:2452
      
      assert(blk_get_aio_context(d->conf.blk) == s->ctx) failed.
      
      To avoid assertion failed,  moving the "if" after qdev_simple_device_unplug_cb.
      
      In addition, to avoid another qemu crash below, add aio_disable_external before
      qdev_simple_device_unplug_cb, which disable the further processing of external clients
      when doing qdev_simple_device_unplug_cb.
      (gdb) bt
      #0  scsi_req_unref (req=0xffff6802c6f0) at hw/scsi/scsi-bus.c:1283
      #1  0x00000000005294a4 in virtio_scsi_handle_cmd_req_submit (req=<optimized out>,
          s=<optimized out>) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:589
      #2  0x000000000052a2a8 in virtio_scsi_handle_cmd_vq (s=s@entry=0x9c90e90,
          vq=vq@entry=0xffff7c05f110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:625
      #3  0x000000000052afd8 in virtio_scsi_data_plane_handle_cmd (vdev=<optimized out>,
          vq=0xffff7c05f110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi-dataplane.c:60
      #4  0x000000000054d97c in virtio_queue_host_notifier_aio_poll (opaque=<optimized out>)
          at /home/qemu-4.0.0/hw/virtio/virtio.c:2447
      #5  0x00000000009b204c in run_poll_handlers_once (ctx=ctx@entry=0x6efea40,
          timeout=timeout@entry=0xffff7d7f7308) at util/aio-posix.c:521
      #6  0x00000000009b2b64 in run_poll_handlers (ctx=ctx@entry=0x6efea40,
          max_ns=max_ns@entry=4000, timeout=timeout@entry=0xffff7d7f7308) at util/aio-posix.c:559
      #7  0x00000000009b2ca0 in try_poll_mode (ctx=ctx@entry=0x6efea40, timeout=0xffff7d7f7308,
          timeout@entry=0xffff7d7f7348) at util/aio-posix.c:594
      #8  0x00000000009b31b8 in aio_poll (ctx=0x6efea40, blocking=blocking@entry=true)
          at util/aio-posix.c:636
      #9  0x00000000006973cc in iothread_run (opaque=0x6ebd800) at iothread.c:75
      #10 0x00000000009b592c in qemu_thread_start (args=0x6efef60) at util/qemu-thread-posix.c:502
      #11 0x0000ffff8057f8bc in start_thread () from /lib64/libpthread.so.0
      #12 0x0000ffff804e5f8c in thread_start () from /lib64/libc.so.6
      (gdb) p bus
      $1 = (SCSIBus *) 0x0
      
      Signed-off-by: default avatarZhengui li <lizhengui@huawei.com>
      Message-Id: <1563696502-7972-1-git-send-email-lizhengui@huawei.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1563829520-17525-1-git-send-email-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9c5aad84
  6. Jul 23, 2019
    • Peter Maydell's avatar
      bf8b0243
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-230719-4' into staging · b1f0a723
      Peter Maydell authored
      
      Final testing updates:
      
        - docker sphinx updates
        - windows build re-enabled in CI
        - travis_retry for make check
        - build fixes
        - docker cache fixes
      
      # gpg: Signature made Tue 23 Jul 2019 17:20:16 BST
      # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
      # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
      # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
      
      * remotes/stsquad/tags/pull-testing-230719-4: (23 commits)
        tests/docker: Refresh APT cache before installing new packages on Debian
        tests/qemu-iotests: Don't use 'seq' in the iotests
        tests/qemu-iotests/group: Remove some more tests from the "auto" group
        tests/qemu-iotests/check: Allow tests without groups
        tests/docker: invoke the DEBUG shell with --noprofile/--norc
        travis: enable travis_retry for check phase
        hw/i386: also turn off VMMOUSE is VMPORT is disabled
        NSIS: Add missing firmware blobs
        tests/docker: Let the test-mingw test generate a NSIS installer
        buildsys: The NSIS Windows build requires qemu-nsis.bmp installed
        buildsys: The NSIS Windows build requires the documentation installed
        tests/docker: Install texinfo in the Fedora image
        tests/docker: Set the correct cross-PKG_CONFIG_PATH in the MXE images
        tests/docker: Install the NSIS tools in the MinGW capable images
        tests/docker: Install Sphinx in the Debian images
        shippable: re-enable the windows cross builds
        tests/dockerfiles: update the win cross builds to stretch
        tests/migration-test: don't spam the logs when we fail
        tests/docker: Install Ubuntu images noninteractively
        tests/docker: Install Sphinx in the Fedora image
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b1f0a723
    • Philippe Mathieu-Daudé's avatar
      tests/docker: Refresh APT cache before installing new packages on Debian · 98808c3d
      Philippe Mathieu-Daudé authored
      Since docker caches the different layers, updating the package
      list does not invalidate the previous "apt-get update" layer,
      and it is likely "apt-get install" hits an outdated repository.
      
      See commit beac6a98 and
      https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
      
      
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190723141528.18023-1-philmd@redhat.com>
      [AJB: manually applies and fixed up]
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      98808c3d
Loading