1. 27 1月, 2017 18 次提交
  2. 26 1月, 2017 7 次提交
    • D
      io: fix possible double free of task error object · 80fb34ed
      Daniel P. Berrange 提交于
      If a QIOTask has an error set and the calling code uses
      qio_task_propagate_error() to steal the reference to
      that Error object, the task would not clear its own
      reference. This would lead to a double-free when
      qio_task_free runs, if the caller had (correctly) freed
      the Error object they now owned.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      80fb34ed
    • S
      aio-posix: honor is_external in AioContext polling · 59c9f437
      Stefan Hajnoczi 提交于
      AioHandlers marked ->is_external must be skipped when aio_node_check()
      fails.  bdrv_drained_begin() needs this to prevent dataplane from
      submitting new I/O requests while another thread accesses the device and
      relies on it being quiesced.
      
      This patch fixes the following segfault:
      
        Program terminated with signal SIGSEGV, Segmentation fault.
        #0  0x00005577f6127dad in bdrv_io_plug (bs=0x5577f7ae52f0) at qemu/block/io.c:2650
        2650            bdrv_io_plug(child->bs);
        [Current thread is 1 (Thread 0x7ff5c4bd1c80 (LWP 10917))]
        (gdb) bt
        #0  0x00005577f6127dad in bdrv_io_plug (bs=0x5577f7ae52f0) at qemu/block/io.c:2650
        #1  0x00005577f6114363 in blk_io_plug (blk=0x5577f7b8ba20) at qemu/block/block-backend.c:1561
        #2  0x00005577f5d4091d in virtio_blk_handle_vq (s=0x5577f9ada030, vq=0x5577f9b3d2a0) at qemu/hw/block/virtio-blk.c:589
        #3  0x00005577f5d4240d in virtio_blk_data_plane_handle_output (vdev=0x5577f9ada030, vq=0x5577f9b3d2a0) at qemu/hw/block/dataplane/virtio-blk.c:158
        #4  0x00005577f5d88acd in virtio_queue_notify_aio_vq (vq=0x5577f9b3d2a0) at qemu/hw/virtio/virtio.c:1304
        #5  0x00005577f5d8aaaf in virtio_queue_host_notifier_aio_poll (opaque=0x5577f9b3d308) at qemu/hw/virtio/virtio.c:2134
        #6  0x00005577f60ca077 in run_poll_handlers_once (ctx=0x5577f79ddbb0) at qemu/aio-posix.c:493
        #7  0x00005577f60ca268 in try_poll_mode (ctx=0x5577f79ddbb0, blocking=true) at qemu/aio-posix.c:569
        #8  0x00005577f60ca331 in aio_poll (ctx=0x5577f79ddbb0, blocking=true) at qemu/aio-posix.c:601
        #9  0x00005577f612722a in bdrv_flush (bs=0x5577f7c20970) at qemu/block/io.c:2403
        #10 0x00005577f60c1b2d in bdrv_close (bs=0x5577f7c20970) at qemu/block.c:2322
        #11 0x00005577f60c20e7 in bdrv_delete (bs=0x5577f7c20970) at qemu/block.c:2465
        #12 0x00005577f60c3ecf in bdrv_unref (bs=0x5577f7c20970) at qemu/block.c:3425
        #13 0x00005577f60bf951 in bdrv_root_unref_child (child=0x5577f7a2de70) at qemu/block.c:1361
        #14 0x00005577f6112162 in blk_remove_bs (blk=0x5577f7b8ba20) at qemu/block/block-backend.c:491
        #15 0x00005577f6111b1b in blk_remove_all_bs () at qemu/block/block-backend.c:245
        #16 0x00005577f60c1db6 in bdrv_close_all () at qemu/block.c:2382
        #17 0x00005577f5e60cca in main (argc=20, argv=0x7ffea6eb8398, envp=0x7ffea6eb8440) at qemu/vl.c:4684
      
      The key thing is that bdrv_close() uses bdrv_drained_begin() and
      virtio_queue_host_notifier_aio_poll() must not be called.
      
      Thanks to Fam Zheng <famz@redhat.com> for identifying the root cause of
      this crash.
      Reported-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Tested-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 20170124095350.16679-1-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      59c9f437
    • C
      s390x/flic: fix compilation of kvm flic · a87adb66
      Cornelia Huck 提交于
      2c21ee76 ("migration: extend VMStateInfo") missed a void -> int
      return conversion for kvm_flic_save().
      
      Fixes: 2c21ee76 ("migration: extend VMStateInfo")
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      a87adb66
    • M
      test-hbitmap: Add hbitmap_is_serializable() calls · 7cdc49b9
      Max Reitz 提交于
      Add calls to hbitmap_is_serializable() (asserting that it returns true)
      where necessary (i.e. before every series of (de-)serialization function
      invocations).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <20161115225746.3590-3-mreitz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      7cdc49b9
    • M
      hbitmap: Add hbitmap_is_serializable() · 20a579de
      Max Reitz 提交于
      Bitmaps with a granularity of 58 or above can be neither serialized nor
      deserialized (see the comment in the function added in this series for
      an explanation). This patch adds a function so that we can check whether
      a bitmap actually can be (de-)serialized at all, thus avoiding failing
      the necessary assertion in hbitmap_serialization_granularity().
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <20161115225746.3590-2-mreitz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      20a579de
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · c7f1cf01
      Peter Maydell 提交于
      This pull request fixes a 2.9 regression and a long standing bug that can
      cause 9p clients to hang. Other patches are minor enhancements.
      
      # gpg: Signature made Wed 25 Jan 2017 10:12:27 GMT
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@fr.ibm.com>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "Gregory Kurz (Cimai Technology) <gkurz@cimai.com>"
      # gpg:                 aka "Gregory Kurz (Meiosys Technology) <gkurz@meiosys.com>"
      # 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: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        9pfs: fix offset error in v9fs_xattr_read()
        9pfs: local: trivial cosmetic fix in pwritev op
        9pfs: fix off-by-one error in PDU free list
        tests: virtio-9p: improve error reporting
        9pfs: add missing coroutine_fn annotations
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c7f1cf01
    • P
      Merge remote-tracking branch 'remotes/xtensa/tags/20170124-xtensa' into staging · e32c41e4
      Peter Maydell 提交于
      target/xtensa updates:
      
      - refactor CCOUNT/CCOMPARE (use QEMU timers instead of instruction counting);
      - support icount; run target/xtensa TCG tests with icount;
      - implement SMP prerequisites: static vector selection, RUNSTALL and RER/WER.
      
      # gpg: Signature made Wed 25 Jan 2017 00:27:51 GMT
      # gpg:                using RSA key 0x51F9CC91F83FA044
      # gpg: Good signature from "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/20170124-xtensa:
        target-xtensa: implement RER/WER instructions
        target/xtensa: tests: clean up interrupt tests
        target/xtensa: tests: add memctl test
        target/xtensa: implement MEMCTL SR
        target/xtensa: fix ICACHE/DCACHE options detection
        target/xtensa: tests: add ccount write tests
        target/xtensa: tests: replace hardcoded interrupt masks
        target/xtensa: tests: fix timer tests
        target/xtensa: tests: run tests with icount
        target/xtensa: don't continue translation after exception
        target/xtensa: support icount
        target/xtensa: refactor CCOUNT/CCOMPARE
        target/xtensa: implement RUNSTALL
        target/xtensa: add static vectors selection
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e32c41e4
  3. 25 1月, 2017 15 次提交
    • P
      Merge remote-tracking branch 'remotes/rth/tags/pull-nios-20170124' into staging · ae5045ae
      Peter Maydell 提交于
      nios2 target support
      
      # gpg: Signature made Tue 24 Jan 2017 21:11:47 GMT
      # gpg:                using RSA key 0xAD1270CC4DD0279B
      # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
      # gpg:                 aka "Richard Henderson <rth@redhat.com>"
      # gpg:                 aka "Richard Henderson <rth@twiddle.net>"
      # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B
      
      * remotes/rth/tags/pull-nios-20170124:
        nios2: Add support for Nios-II R1
        nios2: Add Altera 10M50 GHRD emulation
        nios2: Add periodic timer emulation
        nios2: Add IIC interrupt controller emulation
        nios2: Add usermode binaries emulation
        nios2: Add disas entries
        nios2: Add architecture emulation support
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ae5045ae
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging · ffb5a69c
      Peter Maydell 提交于
      trivial patches for 2017-01-24
      
      # gpg: Signature made Tue 24 Jan 2017 20:27:08 GMT
      # gpg:                using RSA key 0x701B4F6B1A693E59
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
      #      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59
      
      * remotes/mjt/tags/trivial-patches-fetch: (31 commits)
        hw/isa/isa-bus: Set category of the "isabus-bridge" device
        usb: Set category and description of the MTP device
        gdbstub.c: update old error report statements
        gdbstub.c: fix GDB connection segfault caused by empty machines
        scsi-disk: add 'fall through' comment to switch VERIFY cases
        Drop duplicate display option documentation
        hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
        win32: use glib gpoll if glib >= 2.50
        util/mmap-alloc: refactor a little bit for readability
        util/mmap-alloc: check parameter before using
        vfio: remove a duplicated word in comments
        docs: sync pci-ids.txt
        disas/cris.c: Fix Coverity warning about unchecked NULL
        lm32: milkymist-tmu2: fix another integer overflow
        hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
        doc/usb2: fix typo
        qga: fix erroneous argument to strerror
        block: remove dead check
        pci-assign: avoid pointless stat
        qemu-img: remove dead check
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ffb5a69c
    • G
      9pfs: fix offset error in v9fs_xattr_read() · fa0eb5c5
      Greg Kurz 提交于
      The current code tries to copy `read_count' bytes starting at offset
      `offset' from a `read_count`-sized iovec. This causes v9fs_pack() to
      fail with ENOBUFS.
      
      Since the PDU iovec is already partially filled with `offset' bytes,
      let's skip them when creating `qiov_full' and have v9fs_pack() to
      copy the whole of it. Moreover, this is consistent with the other
      places where v9fs_init_qiov_from_pdu() is called.
      
      This fixes commit "bcb8998f 9pfs: call v9fs_init_qiov_from_pdu
      before v9fs_pack".
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
      fa0eb5c5
    • G
      9pfs: local: trivial cosmetic fix in pwritev op · 6fe76acc
      Greg Kurz 提交于
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      6fe76acc
    • G
      9pfs: fix off-by-one error in PDU free list · 0d78289c
      Greg Kurz 提交于
      The server can handle MAX_REQ - 1 PDUs at a time and the virtio-9p
      device has a MAX_REQ sized virtqueue. If the client manages to fill
      up the virtqueue, pdu_alloc() will fail and the request won't be
      processed without any notice to the client (it actually causes the
      linux 9p client to hang).
      
      This has been there since the beginning (commit 9f107513 "virtio-9p:
      Add a virtio 9p device to qemu"), but it needs an agressive workload to
      run in the guest to show up.
      
      We actually allocate MAX_REQ PDUs and I see no reason not to link them
      all into the free list, so let's fix the init loop.
      Reported-by: NTuomas Tynkkynen <tuomas@tuxera.com>
      Suggested-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      0d78289c
    • G
      tests: virtio-9p: improve error reporting · 6e37f458
      Greg Kurz 提交于
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      6e37f458
    • G
      9pfs: add missing coroutine_fn annotations · a1bf8b74
      Greg Kurz 提交于
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      a1bf8b74
    • M
      nios2: Add support for Nios-II R1 · e671711c
      Marek Vasut 提交于
      Add remaining bits of the Altera NiosII R1 support into qemu, which
      is documentation, MAINTAINERS file entry, configure bits, arch_init
      and configuration files for both linux-user (userland binaries) and
      softmmu (hardware emulation).
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-8-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      e671711c
    • M
      nios2: Add Altera 10M50 GHRD emulation · b7862564
      Marek Vasut 提交于
      Add the Altera 10M50 Nios2 GHRD model. This allows emulating the
      10M50 development kit with the Nios2 GHRD loaded in the FPGA. It
      is possible to boot Linux kernel and run userspace, thus far only
      from initrd as storage support is not yet implemented.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-7-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      b7862564
    • C
      nios2: Add periodic timer emulation · a32a2253
      Chris Wulff 提交于
      Add the Altera timer model.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-6-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      a32a2253
    • C
      nios2: Add IIC interrupt controller emulation · d2fe4ec1
      Chris Wulff 提交于
      Add the Altera Nios2 internal interrupt controller model.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-5-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      d2fe4ec1
    • M
      nios2: Add usermode binaries emulation · a0a839b6
      Marek Vasut 提交于
      Add missing bits for qemu-user required for emulating Altera Nios2
      userspace binaries.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-4-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      a0a839b6
    • M
      nios2: Add disas entries · 3f0c3423
      Marek Vasut 提交于
      Add nios2 disassembler support. This patch is composed from binutils files
      from commit "Opcodes and assembler support for Nios II R2". The files from
      binutils used in this patch are:
      
          include/opcode/nios2.h
          include/opcode/nios2r1.h
          include/opcode/nios2r2.h
          opcodes/nios2-opc.c
          opcodes/nios2-dis.c
      
      Checkpatch says total: 114 errors, 0 warnings, 3609 lines checked , which
      is caused by a different coding style in those files. These warnings and
      errors are not addressed To let these files be easily synchronized between
      binutils and qemu.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-2-marex@denx.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      3f0c3423
    • C
      nios2: Add architecture emulation support · 032c76bc
      Chris Wulff 提交于
      Add support for emulating Altera NiosII R1 architecture into qemu.
      This patch is based on previous work by Chris Wulff from 2012 and
      updated to latest mainline QEMU.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Wulff <crwulff@gmail.com>
      Cc: Jeff Da Silva <jdasilva@altera.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Sandra Loosemore <sandra@codesourcery.com>
      Cc: Yves Vandervennet <yvanderv@altera.com>
      Cc: Alexander Graf <agraf@suse.de>
      Message-Id: <20170118220146.489-3-marex@denx.de>
      [rth: Remove tlb_flush from nios2_cpu_reset.]
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      032c76bc
    • T
      hw/isa/isa-bus: Set category of the "isabus-bridge" device · 5658ffa3
      Thomas Huth 提交于
      It has "bridge" in its name, so it should be in the category
      DEVICE_CATEGORY_BRIDGE.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      5658ffa3