1. 03 10月, 2018 7 次提交
    • E
      cacheinfo: add i/d cache_linesize_log · 5fe21034
      Emilio G. Cota 提交于
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <20180910232752.31565-2-cota@braap.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5fe21034
    • E
      cpus: initialize timers_state.vm_clock_lock · 87a09cdc
      Emilio G. Cota 提交于
      We forgot to initialize the spinlock introduced in 94377115
      ("cpus: protect TimerState writes with a spinlock", 2018-08-23).
      Fix it.
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <20180903171831.15446-5-cota@braap.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      87a09cdc
    • E
      atomic: fix comment s/x64_64/x86_64/ · 119c440c
      Emilio G. Cota 提交于
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <20180903171831.15446-4-cota@braap.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      119c440c
    • P
      ps2: prevent changing irq state on save and load · a1f2ed2a
      Pavel Dovgalyuk 提交于
      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: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Message-Id: <20180511081601.14610.39946.stgit@pasha-VirtualBox>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a1f2ed2a
    • P
      es1370: fix ADC_FRAMEADR and ADC_FRAMECNT · cf9270e5
      Paolo Bonzini 提交于
      They are not consecutive with DAC1_FRAME* and DAC2_FRAME*.
      
      Fixes: 154c1d1fSigned-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      cf9270e5
    • P
      qsp: hide indirect function calls from Coverity · 07d66672
      Paolo Bonzini 提交于
      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: NPaolo Bonzini <pbonzini@redhat.com>
      07d66672
    • F
      virtio: Return true from virtio_queue_empty if broken · 2d1df859
      Fam Zheng 提交于
      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: NFam Zheng <famz@redhat.com>
      Message-Id: <20180910145616.8598-2-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2d1df859
  2. 02 10月, 2018 23 次提交
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/libfdt-20181002' into staging · 3892f1f1
      Peter Maydell 提交于
      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: NPeter Maydell <peter.maydell@linaro.org>
      3892f1f1
    • P
      Merge remote-tracking branch 'remotes/xtensa/tags/20181001-xtensa' into staging · 8f09da69
      Peter Maydell 提交于
      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: NPeter Maydell <peter.maydell@linaro.org>
      8f09da69
    • D
      Update dtc/libfdt submodule to v1.4.7 · 0b001b30
      David Gibson 提交于
      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: NDavid Gibson <david@gibson.dropbear.id.au>
      0b001b30
    • M
      target/xtensa: extract gen_check_interrupts call · d74624e5
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      d74624e5
    • M
      target/xtensa: make rsr/wsr helpers return void · c7159acb
      Max Filippov 提交于
      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: NMax Filippov <jcmvbkbc@gmail.com>
      c7159acb
    • M
      target/xtensa: extract unconditional TB termination via slot 0 · bf525107
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      bf525107
    • M
      target/xtensa: always end TB on CCOUNT access/CCOMPARE write · 06ec08a0
      Max Filippov 提交于
      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: NMax Filippov <jcmvbkbc@gmail.com>
      06ec08a0
    • M
      target/xtensa: change SR number checks to assertions · 9dccbd1c
      Max Filippov 提交于
      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: NMax Filippov <jcmvbkbc@gmail.com>
      9dccbd1c
    • M
      target/xtensa: extract unconditional TB termination · 226444a8
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      226444a8
    • M
      target/xtensa: extract test for division by zero · 4a038955
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      4a038955
    • M
      target/xtensa: extract test for cpdisabled exception · 582fef0f
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      582fef0f
    • M
      target/xtensa: extract test for alloca exception · 90d6494d
      Max Filippov 提交于
      - mark movsp instruction;
      - put test for alloca exception right after the test for window
        underflow;
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      90d6494d
    • M
      target/xtensa: extract test for window underflow exception · f473019a
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      f473019a
    • M
      target/xtensa: extract test for window overflow exception · 6416d16f
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      6416d16f
    • M
      target/xtensa: extract test for debug exception · 15477819
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      15477819
    • M
      target/xtensa: extract test for syscall instruction · 4c6ec5f3
      Max Filippov 提交于
      - mark syscall instruction;
      - put syscall exception check right after privileged exception check;
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      4c6ec5f3
    • M
      target/xtensa: extract test for privileged instruction · 21a2dad5
      Max Filippov 提交于
      - mark privileged instructions;
      - put single privileged instruction check after disassembly loop;
      - translate_[di]cache: drop parameter 0, shift parameters one down;
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      21a2dad5
    • M
      target/xtensa: extract test for an illegal instruction · 09460970
      Max Filippov 提交于
      - 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: NMax Filippov <jcmvbkbc@gmail.com>
      09460970
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · e32e62f2
      Peter Maydell 提交于
      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: NPeter Maydell <peter.maydell@linaro.org>
      e32e62f2
    • K
      tests/test-bdrv-drain: Fix too late qemu_event_reset() · dd353157
      Kevin Wolf 提交于
      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: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Tested-by: NMax Reitz <mreitz@redhat.com>
      dd353157
    • K
      test-replication: Lock AioContext around blk_unref() · 90042c6a
      Kevin Wolf 提交于
      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: NKevin Wolf <kwolf@redhat.com>
      90042c6a
    • L
      qcow2: Fix cache-clean-interval documentation · e3a7b455
      Leonid Bloch 提交于
      Fixing cache-clean-interval documentation following the recent change to
      a default of 600 seconds on supported plarforms (only Linux currently).
      Signed-off-by: NLeonid Bloch <lbloch@janustech.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e3a7b455
    • K
      block-backend: Set werror/rerror defaults in blk_new() · cb53460b
      Kevin Wolf 提交于
      Currently, the default values for werror and rerror have to be set
      explicitly with blk_set_on_error() by the callers of blk_new(). The only
      caller actually doing this is blockdev_init(), which is called for
      BlockBackends created using -drive.
      
      In particular, anonymous BlockBackends created with
      -device ...,drive=<node-name> didn't get the correct default set and
      instead defaulted to the integer value 0 (= BLOCKDEV_ON_ERROR_REPORT).
      This is the intended default for rerror anyway, but the default for
      werror should be BLOCKDEV_ON_ERROR_ENOSPC.
      
      Set the defaults in blk_new() instead so that they apply no matter what
      way the BlockBackend was created.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      cb53460b
  3. 01 10月, 2018 10 次提交