Skip to content
Snippets Groups Projects
  1. Oct 02, 2018
    • Daniel P. Berrangé's avatar
      configure: preserve various environment variables in config.status · e811da7f
      Daniel P. Berrangé authored
      
      The config.status script is auto-generated by configure upon
      completion. The intention is that config.status can be later invoked by
      the developer directly, or by make indirectly, to re-detect the same
      environment that configure originally used.
      
      The current config.status script, however, only contains a record of the
      command line arguments to configure. Various environment variables have
      an effect on what configure will find. In particular PKG_CONFIG_LIBDIR &
      PKG_CONFIG_PATH vars will affect what libraries pkg-config finds. The
      PATH var will affect what toolchain binaries and XXXX-config scripts are
      found. The LD_LIBRARY_PATH var will affect what libraries are
      found. Most commands have env variables that will override the name/path
      of the default version configure finds.
      
      All these key env variables should be recorded in the config.status script.
      
      Autoconf would also preserve CFLAGS, LDFLAGS, LIBS, CPPFLAGS, but QEMU
      deals with those differently, expecting extra flags to be set using
      configure args, rather than env variables. At the end of the script we
      also don't have the original values of those env vars, as we modify them
      during configure.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20180904123603.10016-1-berrange@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      e811da7f
    • Jan Kiszka's avatar
      kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case · 0ea1472d
      Jan Kiszka authored
      
      The AMD IOMMU does not (yet) support interrupt remapping. But
      kvm_arch_fixup_msi_route assumes that all implementations do and crashes
      when the AMD IOMMU is used in KVM mode.
      
      Fixes: 8b5ed7df ("intel_iommu: add support for split irqchip")
      Reported-by: default avatarChristopher Goldsworthy <christopher.goldsworthy@outlook.com>
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Message-Id: <48ae78d8-58ec-8813-8680-6f407ea46041@siemens.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0ea1472d
    • Marc-André Lureau's avatar
      hostmem-memfd: add checks before adding hostmem-memfd & properties · 38296400
      Marc-André Lureau authored
      
      Run some memfd-related checks before registering hostmem-memfd &
      various properties. This will help libvirt to figure out what the host
      is supposed to be capable of.
      
      qemu_memfd_check() is changed to a less optimized version, since it is
      used with various flags, it no longer caches the result.
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20180906161415.8543-1-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      38296400
    • Viktor Prutyanov's avatar
      dump: fix Windows dump memory run mapping · 7184de64
      Viktor Prutyanov authored
      
      We should map and use guest memory run by parts if it can't be mapped as
      a whole.
      After this patch, continuos guest physical memory blocks which are not
      continuos in host virtual address space will be processed correctly.
      
      Signed-off-by: default avatarViktor Prutyanov <viktor.prutyanov@virtuozzo.com>
      Message-Id: <1535567456-6904-1-git-send-email-viktor.prutyanov@virtuozzo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7184de64
    • Emilio G. Cota's avatar
      cpus: access .qemu_icount_bias with atomic64 · c97595d1
      Emilio G. Cota authored
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-11-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c97595d1
    • Emilio G. Cota's avatar
      cpus: access .qemu_icount with atomic64 · 38adcb6e
      Emilio G. Cota authored
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-10-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      38adcb6e
    • Paolo Bonzini's avatar
      cpus: take seqlock across qemu_icount updates · 9b4e6f49
      Paolo Bonzini authored
      
      Even though writes of qemu_icount can safely race with reads in
      qemu_icount_raw, qemu_icount is also read by icount_adjust, which
      runs in the I/O thread.  Therefore, writes do needs protection of
      the vm_clock_lock; for simplicity the patch protects it with both
      seqlock+spinlock, which we already do for hosts that lack 64-bit atomics.
      
      The bug actually predated the introduction of vm_clock_lock;
      cpu_update_icount would have needed the BQL before the spinlock was
      introduced.
      
      Reported-by: default avatarEmilio G. Cota <cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9b4e6f49
    • Emilio G. Cota's avatar
      test-rcu-list: access n_reclaims and n_nodes_removed with atomic64 · 39fe576c
      Emilio G. Cota authored
      
      To avoid undefined behaviour.
      
      Note that these "atomics" are atomic in the "access once" sense.
      The variables are updated by a single thread at a time, so no
      "full" atomics are necessary.
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-6-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      39fe576c
    • Emilio G. Cota's avatar
      qsp: use atomic64 accessors · ac8c7748
      Emilio G. Cota authored
      
      With the seqlock, we either have to use atomics to remain
      within defined behaviour (and note that 64-bit atomics aren't
      always guaranteed to compile, irrespective of __nocheck), or
      drop the atomics and be in undefined behaviour territory.
      
      Fix it by dropping the seqlock and using atomic64 accessors.
      This will limit scalability when !CONFIG_ATOMIC64, but those
      machines (1) don't have many users and (2) are unlikely to
      have many cores.
      
      - With CONFIG_ATOMIC64:
      $ tests/atomic_add-bench -n 1 -m -p
       Throughput:         13.00 Mops/s
      
      - Forcing !CONFIG_ATOMIC64:
      $ tests/atomic_add-bench -n 1 -m -p
       Throughput:         10.89 Mops/s
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-5-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ac8c7748
    • Emilio G. Cota's avatar
      tests: add atomic64-bench · 82fdfcbe
      Emilio G. Cota authored
      
      - With CONFIG_ATOMIC64:
      $ tests/atomic64-bench  -n 1
       Throughput:         310.40 Mops/s
      
      - Without:
      $ tests/atomic64-bench  -n 1
       Throughput:         149.08 Mops/s
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-4-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      82fdfcbe
    • Emilio G. Cota's avatar
      util: add atomic64 · 782da5b2
      Emilio G. Cota authored
      
      This introduces read/set accessors for int64_t and uint64_t.
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-3-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      782da5b2
    • Emilio G. Cota's avatar
      cacheinfo: add i/d cache_linesize_log · 5fe21034
      Emilio G. Cota authored
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-2-cota@braap.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5fe21034
    • Emilio G. Cota's avatar
      cpus: initialize timers_state.vm_clock_lock · 87a09cdc
      Emilio G. Cota authored
      
      We forgot to initialize the spinlock introduced in 94377115
      ("cpus: protect TimerState writes with a spinlock", 2018-08-23).
      Fix it.
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180903171831.15446-5-cota@braap.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      87a09cdc
    • Emilio G. Cota's avatar
      atomic: fix comment s/x64_64/x86_64/ · 119c440c
      Emilio G. Cota authored
      
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Message-Id: <20180903171831.15446-4-cota@braap.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      119c440c
    • Pavel Dovgaluk's avatar
      ps2: prevent changing irq state on save and load · a1f2ed2a
      Pavel Dovgaluk authored
      
      Commit 2858ab09 changed
      PS/2 keyboard/mouse buffers to the standard size. However, its state
      may change when migrating from the old buffer size and therefore irq needs
      updating. But this change made wrong, because it throws the whole queue
      if there are too much data instead of cropping it.
      
      That commit also updates irq (because the queue state may change).
      But updating the irq may change the VM state (and determinism of
      the execution). E.g., when replaying the execution, one may save
      the VM state and the state of the interrupt controller will be updated
      at the moment of saving, instead of using the recorded update events.
      
      This patch makes the queue update deterministic: it removes the update_irq
      call and crops the queue to prevent losing the characters and changing
      the required irq status.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Message-Id: <20180511081601.14610.39946.stgit@pasha-VirtualBox>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a1f2ed2a
    • Paolo Bonzini's avatar
      es1370: fix ADC_FRAMEADR and ADC_FRAMECNT · cf9270e5
      Paolo Bonzini authored
      
      They are not consecutive with DAC1_FRAME* and DAC2_FRAME*.
      
      Fixes: 154c1d1f
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cf9270e5
    • Paolo Bonzini's avatar
      qsp: hide indirect function calls from Coverity · 07d66672
      Paolo Bonzini authored
      
      Coverity does not see anymore that qemu_mutex_lock is taking a lock.
      Hide all the QSP magic so that static analysis works again.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      07d66672
    • Fam Zheng's avatar
      virtio: Return true from virtio_queue_empty if broken · 2d1df859
      Fam Zheng authored
      
      Both virtio-blk and virtio-scsi use virtio_queue_empty() as the
      loop condition in VQ handlers (virtio_blk_handle_vq,
      virtio_scsi_handle_cmd_vq). When a device is marked broken in
      virtqueue_pop, for example if a vIOMMU address translation failed, we
      want to break out of the loop.
      
      This fixes a hanging problem when booting a CentOS 3.10.0-862.el7.x86_64
      kernel with ATS enabled:
      
        $ qemu-system-x86_64 \
          ... \
          -device intel-iommu,intremap=on,caching-mode=on,eim=on,device-iotlb=on \
          -device virtio-scsi-pci,iommu_platform=on,ats=on,id=scsi0,bus=pci.4,addr=0x0
      
      The dead loop happens immediately when the kernel boots and initializes
      the device, where virtio_scsi_data_plane_handle_cmd will not return:
      
          > ...
          > #13 0x00005586602b7793 in virtio_scsi_handle_cmd_vq
          > #14 0x00005586602b8d66 in virtio_scsi_data_plane_handle_cmd
          > #15 0x00005586602ddab7 in virtio_queue_notify_aio_vq
          > #16 0x00005586602dfc9f in virtio_queue_host_notifier_aio_poll
          > #17 0x00005586607885da in run_poll_handlers_once
          > #18 0x000055866078880e in try_poll_mode
          > #19 0x00005586607888eb in aio_poll
          > #20 0x0000558660784561 in aio_wait_bh_oneshot
          > #21 0x00005586602b9582 in virtio_scsi_dataplane_stop
          > #22 0x00005586605a7110 in virtio_bus_stop_ioeventfd
          > #23 0x00005586605a9426 in virtio_pci_stop_ioeventfd
          > #24 0x00005586605ab808 in virtio_pci_common_write
          > #25 0x0000558660242396 in memory_region_write_accessor
          > #26 0x00005586602425ab in access_with_adjusted_size
          > #27 0x0000558660245281 in memory_region_dispatch_write
          > #28 0x00005586601e008e in flatview_write_continue
          > #29 0x00005586601e01d8 in flatview_write
          > #30 0x00005586601e04de in address_space_write
          > #31 0x00005586601e052f in address_space_rw
          > #32 0x00005586602607f2 in kvm_cpu_exec
          > #33 0x0000558660227148 in qemu_kvm_cpu_thread_fn
          > #34 0x000055866078bde7 in qemu_thread_start
          > #35 0x00007f5784906594 in start_thread
          > #36 0x00007f5784639e6f in clone
      
      With this patch, virtio_queue_empty will now return 1 as soon as the
      vdev is marked as broken, after a "virtio: zero sized buffers are not
      allowed" error.
      
      To be consistent, update virtio_queue_empty_rcu as well.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20180910145616.8598-2-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2d1df859
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgibson/tags/libfdt-20181002' into staging · 3892f1f1
      Peter Maydell authored
      
      Update dtc submodule to v1.4.7
      
      We have some upcoming things planned for ppc that will require some
      newer libfdt features.  In preparation, update the dtc/libfdt
      submodule to upstreasm version v1.4.7.
      
      # gpg: Signature made Tue 02 Oct 2018 05:23:43 BST
      # gpg:                using RSA key 6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/libfdt-20181002:
        Update dtc/libfdt submodule to v1.4.7
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3892f1f1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/xtensa/tags/20181001-xtensa' into staging · 8f09da69
      Peter Maydell authored
      
      target/xtensa: preparation for FLIX support
      
      Separate generation of per-instruction code (such as raising exceptions
      and terminating TB) from per-opcode code.
      
      # gpg: Signature made Mon 01 Oct 2018 19:14:34 BST
      # gpg:                using RSA key 51F9CC91F83FA044
      # gpg: Good signature from "Max Filippov <filippov@cadence.com>"
      # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>"
      # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>"
      # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
      
      * remotes/xtensa/tags/20181001-xtensa:
        target/xtensa: extract gen_check_interrupts call
        target/xtensa: make rsr/wsr helpers return void
        target/xtensa: extract unconditional TB termination via slot 0
        target/xtensa: always end TB on CCOUNT access/CCOMPARE write
        target/xtensa: change SR number checks to assertions
        target/xtensa: extract unconditional TB termination
        target/xtensa: extract test for division by zero
        target/xtensa: extract test for cpdisabled exception
        target/xtensa: extract test for alloca exception
        target/xtensa: extract test for window underflow exception
        target/xtensa: extract test for window overflow exception
        target/xtensa: extract test for debug exception
        target/xtensa: extract test for syscall instruction
        target/xtensa: extract test for privileged instruction
        target/xtensa: extract test for an illegal instruction
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8f09da69
    • David Gibson's avatar
      Update dtc/libfdt submodule to v1.4.7 · 0b001b30
      David Gibson authored
      
      dtc v1.4.7 contains a bunch of improvements to make libfdt safer against
      handling a corrupted or malicious tree, which is a good thing to have.  It
      also includes an explicit fdt checking function that we'll be wanting in
      future.
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      0b001b30
  2. Oct 01, 2018
    • Max Filippov's avatar
      target/xtensa: extract gen_check_interrupts call · d74624e5
      Max Filippov authored
      
      - mark instructions that affect active IRQ level;
      - put call for gen_check_interrupts right after the instruction
        translation; when FLIX is enabled it will need to appear before
        other exits from the TB as well;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      d74624e5
    • Max Filippov's avatar
      target/xtensa: make rsr/wsr helpers return void · c7159acb
      Max Filippov authored
      
      Now that all logic for TB termination is extracted from rsr/wsr their
      return value is not used and may be dropped.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      c7159acb
    • Max Filippov's avatar
      target/xtensa: extract unconditional TB termination via slot 0 · bf525107
      Max Filippov authored
      
      - mark instructions that require TB termination via slot 0;
      - put TB termination right after the instruction translation loop, if
        termination w/o TB linking wasn't requested;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      bf525107
    • Max Filippov's avatar
      target/xtensa: always end TB on CCOUNT access/CCOMPARE write · 06ec08a0
      Max Filippov authored
      
      Currently we only end TB in icount mode, because access to CCOUNT or
      write to CCOMPARE are IO operations. Simplify the behaviour a bit and
      end TB unconditionally.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      06ec08a0
    • Max Filippov's avatar
      target/xtensa: change SR number checks to assertions · 9dccbd1c
      Max Filippov authored
      
      Opcode decoding with libisa takes care about range of valid group SRs,
      like CCOMPARE, IBREAKA, DBREAKA or DBREAKC. Turn range checks in wsr
      implementations into assertions.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      9dccbd1c
    • Max Filippov's avatar
      target/xtensa: extract unconditional TB termination · 226444a8
      Max Filippov authored
      
      - mark all instructions that exit TB and require dynamic search for the
        next TB;
      - put TB termination right after the instruction translation loop;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      226444a8
    • Max Filippov's avatar
      target/xtensa: extract test for division by zero · 4a038955
      Max Filippov authored
      
      - mark quos/quou/rems/remu instructions;
      - drop parameter 0 from the translate_quou and split translate_remu from
        it;
      - put test for division by zero exception right after the coprocessor
        exception test;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      4a038955
    • Max Filippov's avatar
      target/xtensa: extract test for cpdisabled exception · 582fef0f
      Max Filippov authored
      
      - add XtensaOpcodeOps::coprocessor with bitmask of coprocessors used by
        the instruction;
      - replace coprocessor id parameter of gen_check_cpenable with the
        bitmask of used coprocessors;
      - collect coprocessor IDs used by an instruction in the disassembly
        loop;
      - put test for coprocessor disabled exception after the alloca test;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      582fef0f
    • Max Filippov's avatar
      target/xtensa: extract test for alloca exception · 90d6494d
      Max Filippov authored
      
      - mark movsp instruction;
      - put test for alloca exception right after the test for window
        underflow;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      90d6494d
    • Max Filippov's avatar
      target/xtensa: extract test for window underflow exception · f473019a
      Max Filippov authored
      
      - mark retw and retw.n instructions;
      - extract window inderflow test from retw helper;
      - put underflow exception check generation right after the overflow
        check;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      f473019a
    • Max Filippov's avatar
      target/xtensa: extract test for window overflow exception · 6416d16f
      Max Filippov authored
      
      - add ps.callinc to the TB flags, that allows testing all instructions
        for window overflow statically;
      - drop gen_window_check* functions; replace them with get_window_check
        that accepts bitmask of used registers;
      - add XtensaOpcodeOps::test_overflow that returns bitmask of implicitly
        used registers; use it for entry and call{,x}{4,8,12};
      - drop window overflow test from the entry helper;
      - drop parameter 0 from translate_[di]cache and use translate_nop for
        d/i cache opcodes that don't need memory accessibility check;
      - add bitmask XtensaOpcodeOps::windowed_register_op that marks opcode
        arguments that refer to windowed registers;
      - translate windowed_register_op mask to a mask of actually used
        registers in the disassembly loop;
      - add check for window overflow right after the check for debug
        exception;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      6416d16f
    • Max Filippov's avatar
      target/xtensa: extract test for debug exception · 15477819
      Max Filippov authored
      
      - mark break and break.n instructions;
      - collect debug cause bits from parameter 0 of instructions marked for
        debug exception;
      - put debug exception check right after syscall check;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      15477819
    • Max Filippov's avatar
      target/xtensa: extract test for syscall instruction · 4c6ec5f3
      Max Filippov authored
      
      - mark syscall instruction;
      - put syscall exception check right after privileged exception check;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      4c6ec5f3
    • Max Filippov's avatar
      target/xtensa: extract test for privileged instruction · 21a2dad5
      Max Filippov authored
      
      - mark privileged instructions;
      - put single privileged instruction check after disassembly loop;
      - translate_[di]cache: drop parameter 0, shift parameters one down;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      21a2dad5
    • Max Filippov's avatar
      target/xtensa: extract test for an illegal instruction · 09460970
      Max Filippov authored
      
      - TB flags: add XTENSA_TBFLAG_CWOE that corresponds to the architectural
        CWOE state;
      - entry: move CWOE check from the helper to the test_ill_entry;
      - retw: move CWOE check from the helper to the test_ill_retw;
      - separate instruction disassembly loop and translation loop; save
        disassembly results in local array;
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      09460970
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · e32e62f2
      Peter Maydell authored
      
      Block layer patches:
      
      - qcow2 cache option default changes (Linux: 32 MB maximum, limited by
        whatever cache size can be made use of with the specific image;
        default cache-clean-interval of 10 minutes)
      - reopen: Allow specifying unchanged child node references, and changing
        a few generic options (discard, detect-zeroes)
      - Fix werror/rerror defaults for -device drive=<node-name>
      - Test case fixes
      
      # gpg: Signature made Mon 01 Oct 2018 18:17:35 BST
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream: (23 commits)
        tests/test-bdrv-drain: Fix too late qemu_event_reset()
        test-replication: Lock AioContext around blk_unref()
        qcow2: Fix cache-clean-interval documentation
        block-backend: Set werror/rerror defaults in blk_new()
        qcow2: Explicit number replaced by a constant
        qcow2: Set the default cache-clean-interval to 10 minutes
        qcow2: Resize the cache upon image resizing
        qcow2: Increase the default upper limit on the L2 cache size
        qcow2: Assign the L2 cache relatively to the image size
        qcow2: Avoid duplication in setting the refcount cache size
        qcow2: Make sizes more humanly readable
        include: Add a lookup table of sizes
        qcow2: Options' documentation fixes
        block: Allow changing 'detect-zeroes' on reopen
        block: Allow changing 'discard' on reopen
        file-posix: Forbid trying to change unsupported options during reopen
        block: Forbid trying to change unsupported options during reopen
        block: Allow child references on reopen
        block: Don't look for child references in append_open_options()
        block: Remove child references from bs->{options,explicit_options}
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      e32e62f2
    • Kevin Wolf's avatar
      tests/test-bdrv-drain: Fix too late qemu_event_reset() · dd353157
      Kevin Wolf authored
      
      qemu_event_reset() must be called before the AIO request in a different
      iothread is submitted. Otherwise the request could be completed before
      we do the qemu_event_reset() and the test would hang in
      qemu_event_wait().
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Tested-by: default avatarMax Reitz <mreitz@redhat.com>
      dd353157
    • Kevin Wolf's avatar
      test-replication: Lock AioContext around blk_unref() · 90042c6a
      Kevin Wolf authored
      
      Recently, the test case has started failing because some job related
      functions want to drop the AioContext lock even though it hasn't been
      taken:
      
          (gdb) bt
          #0  0x00007f51c067c9fb in raise () from /lib64/libc.so.6
          #1  0x00007f51c067e77d in abort () from /lib64/libc.so.6
          #2  0x0000558c9d5dde7b in error_exit (err=<optimized out>, msg=msg@entry=0x558c9d6fe120 <__func__.18373> "qemu_mutex_unlock_impl") at util/qemu-thread-posix.c:36
          #3  0x0000558c9d6b5263 in qemu_mutex_unlock_impl (mutex=mutex@entry=0x558c9f3999a0, file=file@entry=0x558c9d6fd36f "util/async.c", line=line@entry=516) at util/qemu-thread-posix.c:96
          #4  0x0000558c9d6b0565 in aio_context_release (ctx=ctx@entry=0x558c9f399940) at util/async.c:516
          #5  0x0000558c9d5eb3da in job_completed_txn_abort (job=0x558c9f68e640) at job.c:738
          #6  0x0000558c9d5eb227 in job_finish_sync (job=0x558c9f68e640, finish=finish@entry=0x558c9d5eb8d0 <job_cancel_err>, errp=errp@entry=0x0) at job.c:986
          #7  0x0000558c9d5eb8ee in job_cancel_sync (job=<optimized out>) at job.c:941
          #8  0x0000558c9d64d853 in replication_close (bs=<optimized out>) at block/replication.c:148
          #9  0x0000558c9d5e5c9f in bdrv_close (bs=0x558c9f41b020) at block.c:3420
          #10 bdrv_delete (bs=0x558c9f41b020) at block.c:3629
          #11 bdrv_unref (bs=0x558c9f41b020) at block.c:4685
          #12 0x0000558c9d62a3f3 in blk_remove_bs (blk=blk@entry=0x558c9f42a7c0) at block/block-backend.c:783
          #13 0x0000558c9d62a667 in blk_delete (blk=0x558c9f42a7c0) at block/block-backend.c:402
          #14 blk_unref (blk=0x558c9f42a7c0) at block/block-backend.c:457
          #15 0x0000558c9d5dfcea in test_secondary_stop () at tests/test-replication.c:478
          #16 0x00007f51c1f13178 in g_test_run_suite_internal () from /lib64/libglib-2.0.so.0
          #17 0x00007f51c1f1337b in g_test_run_suite_internal () from /lib64/libglib-2.0.so.0
          #18 0x00007f51c1f1337b in g_test_run_suite_internal () from /lib64/libglib-2.0.so.0
          #19 0x00007f51c1f13552 in g_test_run_suite () from /lib64/libglib-2.0.so.0
          #20 0x00007f51c1f13571 in g_test_run () from /lib64/libglib-2.0.so.0
          #21 0x0000558c9d5de31f in main (argc=<optimized out>, argv=<optimized out>) at tests/test-replication.c:581
      
      It is yet unclear whether this should really be considered a bug in the
      test case or whether blk_unref() should work for callers that haven't
      taken the AioContext lock, but in order to fix the build tests quickly,
      just take the AioContext lock around blk_unref().
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      90042c6a
    • Leonid Bloch's avatar
      qcow2: Fix cache-clean-interval documentation · e3a7b455
      Leonid Bloch authored
      
      Fixing cache-clean-interval documentation following the recent change to
      a default of 600 seconds on supported plarforms (only Linux currently).
      
      Signed-off-by: default avatarLeonid Bloch <lbloch@janustech.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e3a7b455
Loading